Versions Compared

Key

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

...

Warning

When creating backups or snapshots of, it is highly recommended that the following command are run outside the VMs. Doing so from within may cause corrupted backups or snapshots.

Backing up VMs

...

Instance Snapshots
Anchor

...

InstanceSnapshots

...

InstanceSnapshots

There are two methods of taking snapshots of instances, depending on whether they are image-backed or volume-backed. 

Image-backed instances

Info

All instances on EUMETSAT accounts are volume-backed, see the information on volume-backed instances below.

To take a snapshot of a  image-backed 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:

Code Block
openstack server list

And, to create the image snapshot of a running VM with name or id <server> use the command

Code Block
openstack server image create --name <image_name> <server>

where:

  • --name <image_name>: the name for the new image snapshot
  • <server>: the name or id of your server / VM to be backed up.

In order to see the list of images, including the recently created snapshot, one can run

Code Block
openstack image list

and the specific details of the created image can be found

Code Block
openstack image show <image_name>

It is recommended, though not mandatory, to shut off the server before making a snapshot of it, to make sure all the data has been flushed to disk. This can be done with the command

Code Block
openstack server stop <server>

and after the snapshot it can be restarted with

Code Block
openstack server start <server>

Volume-backed instances

To take a snapshot of a volume-backed instance for later recovery or replication, one must take a snapshot of the root and other attached volumes as well as store the image configuration.  The list of VMs/servers than can be used for the snapshot can be found with:

Code Block
openstack server list

First one needs to find out the volumes attached to the instance, with

Code Block
openstack server show -c volumes_attached <server>

with <server>  the name or id of the VM to backup. This will output a list of attached volumes like 

Image Added

Alternatively, one can list all volumes present in the cloud with

Code Block
openstack volume list

which will also inform about which volumes are mounted on which VMs. For instance

Image Added

Then, to create a snapshot of one of the volumes, do

Code Block
openstack volume snapshot create [--force] --volume <volume> <snapshot_name>

with:

  • --force :  create the snapshot even if the volume is attached
  • –volume <volume> : the name or id of the volume to be backed up
  • <snapshot_name> : the name of the new volume snapshot

To see the list of all snapshots in your cloud, or the snapshots from a specific volume, run

Code Block
openstack volume snapshot list [--volume <volume>]

and to get the details of a specific snapshot

Code Block
openstack volume snapshot show <snapshot_name>

It is recommended to detach the volume from the server before making a snapshot, to avoid potential crashes. This can be done with the command

Code Block
openstack server remove volume <server> <volume>

and it can be reattached after the snapshot with

Code Block
openstack server add volume <server> <volume>

Note that in order to make a snapshot without detaching the volume the --force  flag must be provided. The snapshot or backup of an attached volume is crash consistent.

One can also store the VM configuration for later recovery, simply by exporting the details of the instance to a file, for example with

Code Block
openstack server show <sever> > instance-config.txt

Instance Backups
Anchor
InstanceBackups
InstanceBackups


Backing up Volumes

Volume Snapshots
Anchor
VolumeSnapshots
VolumeSnapshots

To create a snapshot of a volume, root or otherwise, first list the volumes

To take a snapshot of a VM for later recovery or replication, one must take a snapshot of the root and other attached volumes as well as store the image configuration.  The list of VMs/servers than can be used for the snapshot can be found with:

Code Block
openstack server list

First one needs to find out the volumes attached to the instance, with

Code Block
openstack server show -c volumes_attached <server>

with <server>  the name or id of the VM to backup. This will output a list of attached volumes like 

Image Removed

Alternatively, one can list all volumes present in the cloud with

Code Block
openstack volume list

which will also inform about which volumes are mounted on which VMs. For instance

...

Then, to create a snapshot of one of the volumes, do

...

It is recommended to detach the volume from the server before making a snapshot, to avoid potential crashes. This can be done with the command

Code Block
openstack server remove volume <server> <volume>

and it can be reattached after the snapshot withsnapshot, to avoid potential crashes. This can be done with the command

Code Block
openstack server addremove volume <server> <volume>

Note that in order to make a snapshot without detaching the volume the --force  flag must be provided. The snapshot or backup of an attached volume is crash consistent.

 <volume>

and it can be reattached after the snapshot One can also store the VM configuration for later recovery, simply by exporting the details of the instance to a file, for example with

Code Block
openstack server add showvolume <sever> > instance-config.txt

...

<server> <volume>

Note that in order to make a snapshot without detaching the volume the --force  flag must be provided. The snapshot or backup of an attached volume is crash consistent.

Volume Backups
Anchor

...

VolumeBackups

...

VolumeBackups

The procedure to create a backup of a VM volume is almost identical to that of a snapshot. First identify the volumes attached to in the VM cloud as before, then  then back up each of the volumes with

...

It is recommended to detach the volume from the server before backing it up, to avoid potential crashes. This can be done as explained above.  One can force the backup of attached volumes with the --force  option. The snapshot or backup of an attached volume is crash consistent.As before, it is also possible to store the instance configuration data for later recovery.

Common use cases

 These is a list of common configurations of VMs in the cloud and the recommened procedure to backing them up

...