Skip to content

Backup & restore raw images

Backup a VM as a raw image

Login to pbil-deb and create a backup folder

cd /beegfs/data/delmotte
mkdir backup-vm
cd backup-vm/

Install the openstack client

The easiest way to install the openstack client is to install uv on your pbil-deb account and then run:

uv tool install --python 3.9 python-openstackclient

Activate your cloud environment

Retrieve your openstackrc file by clicking on the link on your horizon interface

retrieve your settings from the cloud

source mycloudrc.sh

List of VM in my project

openstack server list

get the parameters of the instance VM

openstack server show vm_calc > param_vm_calc.txt

Create and backup local image of your VM

Create image on cinder:

openstack server image create --name imagevm_calc vm_calc

Check if image exist on cinder:

openstack image list

Get and store image to you local disk:

openstack image save --file imagevm.qcow2 imagevm_calc

Put the image to your iRODS space:

Note

to be able to send your vm image to the iRODS server, you need to have an iRODS environment set up.

iput imagevm.qcow2

Clean cinder to leave space for the other user:

openstack image delete imagevm

Restore a VM as a raw image

import image to cinder

openstack image create --disk-format qcow2  --file ./imagevm.qcow2 imagevm_calc

launch image from cinder

ask to Stephane to do the operation (you have to give the parameters)