Bureaucrats, cc_docs_admin, cc_staff
2,306
edits
Line 11: | Line 11: | ||
==OpenStack specific== | ==OpenStack specific== | ||
OpenStack provides tools to create disk images and snapshots of your virtual machines. The two main VM flavors persistent (p) and compute (c) have different behaviors and creating disk images or snapshots should be considered differently for each. | OpenStack provides tools to create disk images and snapshots of your virtual machines. The two main VM flavors - persistent (p) and compute (c) - have different behaviors and creating disk images or snapshots should be considered differently for each. | ||
===Persistent VMs=== | ===Persistent VMs=== | ||
Persistent VMs are designed to boot from volumes (see [[OpenStack#Booting_from_a_Volume| booting from a volume]]) thus creating a copy of the volume(s) the VM has attached to it will produce a backup. However this would not preserver things like VM flavor, public IP, and security rules. The best way to create a copy of a volume for backup purposes is to create an image from that volume. An image can be [[OpenStack#Downloading_an_Image|downloaded]] and reused to create multiple new VMs, can be [[OpenStack#Creating_a_VirtualBox_VM_from_a_Cloud_Image|accessed by VirtualBox]] on your | Persistent VMs are designed to boot from volumes (see [[OpenStack#Booting_from_a_Volume| booting from a volume]]) thus creating a copy of the volume(s) the VM has attached to it will produce a backup. However this would not preserver things like VM flavor, public IP, and security rules. The best way to create a copy of a volume for backup purposes is to create an image from that volume. An image can be [[OpenStack#Downloading_an_Image|downloaded]] and reused to create multiple new VMs, can be [[OpenStack#Creating_a_VirtualBox_VM_from_a_Cloud_Image|accessed by VirtualBox]] on your desktop or laptop, and [[OpenStack#Uploading_an_Image|uploaded]] to other clouds. | ||
To be able to create an image from a volume, that volume must be detached from the VM. In addition, if the volume is the root volume of the VM it | To be able to create an image from a volume, that volume must be detached from the VM. In addition, if the volume is the root volume of the VM it cannot be detached unless the VM is deleted. If you are sure that when you created the VM you did not check the box "Delete Volume on Instance Delete", then you can delete your VM knowing you will not lose any data. However, if you are unsure whether or not you checked this box, OpenStack unfortunately doesn't tell you if this box was checked when you created a VM. One trick which may be useful for getting around this deficiency is to create a snapshot of the volume provided you have a storage quota which allows it, since snapshots count towards your storage quota. As volumes cannot be deleted if there is a volume snapshot created from them, when you delete the VM the volume will not be deleted even if you checked the box. | ||
At this point all the volumes you wish to create images of should be in the "Available" state. To create an image from a volume, select 'Upload to Image' from the drop down menu for the volume. Select the 'QCOW2' disk format and give your image a name. There are several formats for disk images but QCOW2 works well with OpenStack and typically does not take up as much space as "Raw" images. Other formats "vmdk" and "vdi" can be useful when working with other virtualization tools such as VirtualBox. | At this point all the volumes you wish to create images of should be in the "Available" state. To create an image from a volume, select 'Upload to Image' from the drop down menu for the volume. Select the 'QCOW2' disk format and give your image a name. There are several formats for disk images but QCOW2 works well with OpenStack and typically does not take up as much space as "Raw" images. Other formats "vmdk" and "vdi" can be useful when working with other virtualization tools such as VirtualBox. |