Pre-requisite: EWC - OpenStack Command-Line client |
Before backing up resources in OpenStack, it's important to understand the difference between three primary methods:
Choose the appropriate method based on your recovery needs: instance snapshots for full system recovery or replication, volume snapshots for accident prevention and recovery or volume backups for full data recovery.
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 |
To take a snapshot of a instance for later recovery or replication, one must create an image based on the current VM. The list of VMs/servers than can be used for the snapshot can be found with:
openstack server list |
And, to create the image snapshot of a running VM with name or id <server> use the command
openstack server image create --name <image_name> <server> |
where:
--name <image_name>: The name for the new image snapshot<server>: The name of your server / VM.Lastly, to see the list of images, including the recent snapshot
openstack image list |
and the specific details of the created image
```
openstack image show <image_name>
```
To list all available backups in your cloud, you can use the following command:
openstack volume backup list |
Additionally, you can filter the results with additional options to list backups for a specific volume:
openstack volume backup list --volume VOLUME_ID |
To create a backup of a volume:
openstack volume backup create [--incremental] [--force] [--name NAME] VOLUME |
Where:
--incremental: Create an incremental backup (requires a previous full backup)--force: Create a backup even if the volume is attached--name NAME: Specify a name for the backupVOLUME: The ID or name of the volume to back up