openstack export the virtual machine image

When the software is installed in a virtual machine, in order to create a virtual machine is no longer installed software, but will automatically create after installation, you need to export the virtual machine to use as a mirror image of the original image.

After following the virtual machine, change the password after re-labeled as a mirror, create a virtual machine, use the new password

  

 Check out the location where the mirror, do qemu-img convert -c -O qcow2 / var / lib / nova / instances / c4fcf7dd-74db-4091-93d8-d611248553eb / disk caesar.qcow2 -p will mirror into desired name * .qcow2

 创建镜像 glance image-create --name river --visibility public --container-format bare --disk-format qcow2 --file ./caesar.qcow2

 Create a virtual machine nova boot river --image 5808f608-2b30-4b65-8c2f-436b4d2b5734 --nic net-id = ffe7b6bc-1e0f-457f-b09b-8e1c5b74db6c --flavor 1

 

 Log virtual machine, use the new password, and the file caesar.txt created in the original virtual machine. Use a mirror to create virtual machines there.

 

The above is the use of a local disk, the use of cinder volumes required cinder upload-to-image --container-format bare --disk-format qcow2 <volume id> d40205f9-ecef-491b-90b8-2ce12c6fbb7c <image name> cirros Update mirroring, using glance image-download <image id> --file <download location> download this image for subsequent use.

Guess you like

Origin www.cnblogs.com/CaesarLinsa/p/11666909.html