Versions Compared

Key

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

...

Restoration of VM snapshots
Anchor
RestoreVMSnapshots
RestoreVMSnapshots

OpenStack  provide a mechanism to replace In-place restoration of VM snapshots can be performed with OpenStack by replacing the underlying disk of an existing VM with an image without creating . In this way it is not necessary to create a new VM instance running the following command:

...

, but rather replace an existing one. This can be achieve by running:

Code Block
openstack server rebuild <instance> --image <image_snapshot>

where

  • <instance> : The name or id of the existing VM
  • <image_snapshot> : Name or id of the snapshot image of the VM previously created

Instead of performing an in-place restoration, it is possible to create a new VM using the image snapshot. This is done in the same manner as for creating a new instance, see EWC - How to create a VM using the Openstack CLI,  using the command

Code Block
openstack server create --flavor <flavor_name> --image <image_snapshot> --key-name <keyname> --network <network_name> --security-group <security_group_name> <vm_name>

where here the <image_name> is the name or id of the image snapshot. It is worth noting that the image snapshot does not contain information about the flavor, networks or security groups, and therefore these need to be manually provided. Restoring a snapshot onto a flavor of smaller size than the original will result in a failure.

Info
An important consequence of restoring a VM in this manner,  either in-place or not, is that

...

the image snapshot becomes the underlying image of the VM, instead of the original, e.g. Ubuntu or Rocky OS, and therefore the image can no longer be removed from the list of images available in the cloud.

Restoration of Volume Snapshots
Anchor
RestoreVolumeSnapshots
RestoreVolumeSnapshots

Restoration of Volume Backups
Anchor
RestoreVolumeBackups
RestoreVolumeBackups

To restore a backup to a new volume, first you need to detach the volume from the VM:

...

become root

unmount the volume  

sudo umount --verbose <path-to-volume>

  1. Then you can restore the backup to the volume with OpenStack (from the machine where you are running Openstack commands):

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`.
  • Common use cases
  • WIP
  • Backup automation
  • WIP
  •