amazon-ec2 - 是否可以从 openstack 镜像创建 ami?

标签 amazon-ec2 openstack ec2-ami ec2-api-tools

我正在从 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)

引用: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

针对正在运行的实例执行镜像创建时

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:

但假设您是这样配置的,是的,它将以 AMI 格式输出。

引用:

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

关于amazon-ec2 - 是否可以从 openstack 镜像创建 ami?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15451148/

相关文章:

ubuntu - Hadoop:java.net.UnknownHostException:hadoop-slave-2

java - 获取 OpenStack 容器元数据

amazon-ec2 - 如果我停止 Amazon EC2 实例,这会保存吗?

sql-server - Amazon EC2 实例 - 如何查找 SQL Server 密码

amazon-web-services - 按 Hostrecord (Route53::RecordSet) 对 aws-cli ec2 描述实例的输出进行排序

amazon-web-services - AWS EC2 - 连接超时 - SSH

amazon-web-services - 部署 Common Lisp Web 应用程序

openstack - "The Resource Type could not be found."使用模板合成时

amazon-ec2 - vsftpd 错误列出目录

linux - 为什么 EC2 实例在调整根 EBS 卷大小后无法正常启动?