Is it possible to create an ami from an openstack image?

。_饼干妹妹 提交于 2019-12-23 18:48:25

问题


I'm creating an image from a running instance in OpenStack

nova image-create <server-name>

and i'm just wondering,can this image be uploaded to ec2? Or do i need to create an ami from it?

Can someone guide me on how to go about this?


回答1:


glance, the openstack image service is capable of storing a number of image types:

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/

So basically. You can upload AMIs to openstack directly.

Example:

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

When performing an image-create against a running instance

Images can only be created from running instances if Compute is configured to use qcow2 > images, which is the default setting. You can explicitly enable the use of qcow2 images > by adding the following line to nova.conf:

But assuming you are configured as such, yes it will output in AMI format.

Ref:

http://docs.openstack.org/trunk/openstack-compute/admin/content/creating-images-from-running-instances.html



来源:https://stackoverflow.com/questions/15451148/is-it-possible-to-create-an-ami-from-an-openstack-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!