使用openstack虚拟机创建镜像

1、查询vm所在物理机

nova-manage vm list|grep $vmName

2、查询vm实例名字

virsh list

3、查询vm实例镜像所在位置

virsh domblklist $instanceName

4、将镜像转化为想要的名称*.qcow2

qemu-img convert -c -O qcow2 /var/lib/nova/instances/c77b5266-932f-485c-ad5c-ffee555a5beb/disk Alinux-2.1.0-OUT-1220.qcow2 -p

qemu-img convert -O qcow2 /var/lib/nova/instances/c77b5266-932f-485c-ad5c-ffee555a5beb/disk Alinux-2.1.0-OUT-1220.qcow2 -p

5、创建镜像

glance image-create --name Alinux-2.1.0-OUT-1220 --visibility public --container-format bare --disk-format qcow2 --file ./Alinux-2.1.0-OUT-1220.qcow2  --progress

glance image-create --name aliyun-iamge2 --visibility public --container-format bare --disk-format qcow2 --file ./aliyun-2.1903.qcow2  --progress

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容