我正在从OpenStack运行的实例中创建一张图片
nova image-create <server-name>
我在想,这张图片能上传到EC2吗?还是说我需要基于它创建一个AMI?
有人可以指导我该如何操作吗?
我正在从OpenStack运行的实例中创建一张图片
nova image-create <server-name>
我在想,这张图片能上传到EC2吗?还是说我需要基于它创建一个AMI?
有人可以指导我该如何操作吗?
Raw
Machine (kernel/ramdisk outside of image, a.k.a. AMI)
VHD (Hyper-V)
VDI (VirtualBox)
qcow2 (Qemu/KVM)
VMDK (VMWare)
OVF (VMWare, others)
参考: http://www.openstack.org/projects/image-service/
基本上,您可以直接将 AMI 上传到 OpenStack。
示例:
KERNEL_ID=`glance image-create --name="tty-linux-kernel" --disk-format=aki --container-format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz | awk '/ id / { print $4 }'`
INITRD_ID=`glance image-create --name="tty-linux-ramdisk" --disk-format=ari --container-format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader | awk '/ id / { print $4 }'`
glance image-create --name="tty-linux" --disk-format=ami --container-format=ami --property kernel_id=${KERNEL_ID} --property ramdisk_id=${INITRD_ID} < ttylinux-uec-amd64-12.1_2.6.35-22_1.img
当对正在运行的实例执行image-create时
如果计算机配置为使用qcow2映像(默认设置),则只能从运行的实例创建映像。您可以通过将以下行添加到nova.conf来显式启用qcow2图像的使用:
但是假设您已经进行了配置,那么它将以AMI格式输出。
参考: