OpenStack virtual machine image format made qcow2

Take a snapshot of the virtual machine to export
1. The virtual image creating mechanisms (i.e., take a snapshot);
2. using the snapshot of the virtual machine, create a snapshot volume, according to the size of the size of the snapshot is automatically set;
3. snapshot volume using a command upload -to-image to the virtual machine snapshot
cinder upload-to-image 5b956878-22cc- 483d-8cb8-502dcd2863ad ( snapshot volume id) 4fdfe925-7885-46ab-92ab-aff11c1d9dab (VM produced image ID)
4. by command to export a snapshot retention
glance image-download --file /var/sdn.raw 4fdfe925-7885-46ab- 92ab-aff11c1d9dab --progress

A method :( be verified)
1. Create a cloud Snapshot
2. Create a Snapshot Volume The cloud
3. Creating a virtual machine using the test volume is available volume
4 to the volume is unmounted, image upload

Method Two possible :( verification)
procedure is as follows :( local virtual machine)
1. Locate the instance ID as: b0778aff-ff7e-42dd-9b76-d753c9d1bea3
2. enter the instance directory / var / lib / nova In instances where the node / instances / b0778aff-ff7e-42dd-9b76-d753c9d1bea3
3. inside a disk file, the disk file is the corresponding example
4. stop the instance is running
the compressed copy of the file qemu-img convert -c -O qcow2 disk centos7.2 .qcow2
6. mirrored to upload centos7.2.qcow2

Method three possible :()
1. Create a virtual machine snapshot volume according volume01
2. Create a similarly sized blank volume volume02
3. Create a virtual machine
4. Two volumes created above simultaneously mount the virtual machine
5 using the volume copy command
dd conv = sparse bs = 1M if = / dev / vdb of = / dev / vdc (vdb snapshot volumes, vdc blank roll)
6. the blank roll volume02 out previously created detach
7. command volume02 upload-to-image of
cinder upload-to-image --disk- format qcow2 1112ea3d-67cd-48b9-8650-1f0c53b076e5 RHEL6.9-DSJ-NBU.qcow2 ( new image name)
8. create a virtual machine test
9. View mirror property
glance image-show 1007eedb-af71-4309- bedc-2f9726b481ab
update image attribute
the Glance Image-update 1007eedb-af71-4309-bedc-2f9726b481ab --property hw_ovirt_guest_agent --property hw_qemu_guest_agent = yes = yes \
--property image.os_type = linux

Guess you like

Origin www.cnblogs.com/xiaoqi-home/p/12040885.html