Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Pre-requisite: EWC - OpenStack Command-Line client


Table of Contents

General

When backing up resources in OpenStack, it's important to understand the difference between two primary methods:

...

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

The following command creates the image SERVER by taking a snapshot of a running server.

...

  • --name IMAGE_NAME: The name for the new image snapshot
  • SERVER: The name of your server (as given by openstack server list).


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:

...

  • VM-NAME: The name of the existing VM
  • IMAGE_ID: Name of the backup image of the VM you created before

Volume Backups

List available backups

To list all available backups in your cloud, you can use the following command:

...

Code Block
 openstack volume backup list --volume VOLUME_ID

Creating Backups

To create a backup of a volume:

...

  • --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 backup
  • VOLUME: The ID or name of the volume to back up

Restoring Backups

  1. To restore a backup to a new volume, first you need to detach the volume from the VM:
    1. ssh into your VM
    2. become root
    3. unmount the volume 
      Code Block
       sudo umount --verbose <path-to-volume>
  2. Then you can restore the backup to the volume with OpenStack (from the machine where you are running Openstack commands):
Code Block
openstack volume backup restore BACKUP_ID VOLUME_ID

Where:

  • BACKUP_ID: The ID of the backup to restore
  • VOLUME_ID: The ID of the volume to restore to (must be at least as large as the original volume)

3. Now, you need to attach the volume again to the VM as explained in `Configuring the extra volume in the instance`.