我正在从 OpenStack 中正在运行的实例创建图像
nova image-create <server-name>
我只是想知道,这张图片可以上传到 ec2 吗?或者我需要从中创建一个 ami 吗?
有人可以指导我如何解决这个问题吗?
乍一看,openstack 镜像服务能够存储多种镜像类型:
Raw
Machine (kernel/ramdisk outside of image, a.k.a. AMI)
VHD (Hyper-V)
VDI (VirtualBox)
qcow2 (Qemu/KVM)
VMDK (VMWare)
OVF (VMWare, others)
Ref: http://www.openstack.org/projects/image-service/ 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
对正在运行的实例执行映像创建时
如果计算配置为使用 qcow2 > images(默认设置),则只能从正在运行的实例创建映像。您可以通过将以下行添加到 nova.conf 来显式启用 qcow2 映像的使用:
但假设您是这样配置的,是的,它将以 AMI 格式输出。
Ref:
http://docs.openstack.org/trunk/openstack-compute/admin/content/creating-images-from-running-instances.html http://docs.openstack.org/trunk/openstack-compute/admin/content/creating-images-from-running-instances.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)