...
When backing up resources in OpenStack, it's important to understand the difference between two primary methods:
- VM Images (Glance): These capture the entire virtual machine, including the operating system, applications, and configuration. VM images are useful for cloning VMs, creating templates, or disaster recovery scenarios. They're managed through the Glance service.
- Volume Backups (Cinder): These are point-in-time copies of block storage volumes. Volume backups preserve the data within a volume and can be used to restore the volume to the exact state it was in when backed up. They're ideal for data recovery and are managed through the Cinder service.
- VM Images (Glance): These capture the entire virtual machine, including the operating system, applications, and configuration. VM images are useful for cloning VMs, creating templates, or disaster recovery scenarios. They're managed through the Glance service.
Choose the appropriate method based on your recovery needs: volume backups for data recovery, VM images for full system recovery or replication.
...
| Info |
|---|
Before starting make sure you are in the machine where you configured openstack client and you can run openstack commands as described in EWC - OpenStack Command-Line client |
VM Images Backup
List available image
To list all available images:
| Code Block |
|---|
openstack image list |
Creating VM Images Snapshots
To create a new VM image snapshot:
| Code Block |
|---|
openstack server image create --name IMAGE_NAME SERVER |
Where:
--name IMAGE_NAME: The name for the new image snapshotSERVER: The above command creates the imageSERVERby taking a snapshot of a running server.
Restoring VMs from Images
OpenStack provide a mechanism to replace the underlying disk of an existing VM with an image without creating a new VM instance running the following command:
| Code Block |
|---|
openstack server rebuild VM-NAME --image IMAGE_ID |
where
VM-NAME: The name of the existing imageIMAGE_ID: Name of the backup image of the VM you created before
Volume Backups
List available backups
...
3. Now, you need to attach the volume again to the VM as explained in `Configuring the extra volume in the instance`.
VM Images Backup
List available image
To list all available images:
| Code Block |
|---|
openstack image list |
Creating VM Images Snapshots
To create a new VM image snapshot:
| Code Block |
|---|
openstack server image create --name IMAGE_NAME SERVER |
Where:
--name IMAGE_NAME: The name for the new image snapshotSERVER: The above command creates the imageSERVERby taking a snapshot of a running server.
Restoring VMs from Images
OpenStack provide a mechanism to replace the underlying disk of an existing VM with an image without creating a new VM instance running the following command:
| Code Block |
|---|
openstack server rebuild VM-NAME --image IMAGE_ID |
where
...
VM-NAME: The name of the existing image...