DEPRECATED

Check Julia 2 documentation instead!

How to backup a OpenStack machine

You need a python environment for this procedure to work. Also you need the following details:

  • Project Name
  • Project Id
  • Your username and password

You can get the first two details, when you login to OpenStack and visit Project -> Api Access or by visting: https://julia.uni-wuerzburg.de/project/api_access/

Click on the button View Credentials

Create a OpenStack Credential file

There are two options in how to accomplish this

Option 1: Use a clouds.yaml config file

Create a global clouds.yaml configuration file and place it in $HOME/.config/openstack/

Replace the variables like <variable> with your corresponding values.

clouds:
  julia:
    auth:
      auth_url: https://julia.uni-wuerzburg.de:5000/
      project_id: <project_id>
      project_name: <project_name>
      user_domain_name: julia
      username: <username>
      password: <password>
    region_name: RegionOne

Since that configuration file is written in YAML, make sure the identation for each level with two spaces is kept intact. You can copy the example from above and adjust it to your needs.

The clouds.yaml file can contain multiple entries for cloud instances. Therefore you have to set a default one in your .bashrc, once!

echo "export OS_CLOUD=julia" >> $HOME/.bashrc
source $HOME/.bashrc

You can switch between cloud instances by changeing that variable or by using the --os-cloud <cloud name> comandline option later.

Option 2: Download the OpenStack RC File

On the Project -> Api Access page click the corresponding button and download the RC file for Idendity API v3. Place that RC file to a known folder on your drive. e.g. $HOME/Documents/openstack

Source the RC file and provide your credentials

source $HOME/Documents/openstack/<project-name>-openrc.sh

Install the python openstack client

pip install --user python-openstackclient

Check connectivity

Run

openstack server list
+--------------------------------------+--------------+--------+------------------------------------+------------------------+------------------+
| ID                                   | Name         | Status | Networks                           | Image                  | Flavor           |
+--------------------------------------+--------------+--------+------------------------------------+------------------------+------------------+
| 1758646f-fc7f-45df-805f-c83d743628ce | rstudio-test | ACTIVE | admin=10.106.242.189, 192.168.0.16 | Ubuntu18.04-Julia      | tiny             |
| 1e4e4665-6821-465c-9e1e-4077d4834ae4 | minitest     | ACTIVE | admin=10.106.241.9, 192.168.0.9    | Debian10-Julia-Vanilla | tiny_4_smalldisk |
+--------------------------------------+--------------+--------+------------------------------------+------------------------+------------------+

You should get an output of your current vms. If not, check your connection and credentials.

Snapshot handling

Shutdown your machine and create a snapshot in the webinterface, if not already done yet. Creating a snapshot takes a while, so please be patient and grab a cup of your favorite beverage.

Also delete your machine after the snapshot was successfully created. You can later create a machine from the snapshot image.

Download snapshots

Get a list of your snapshot images:

openstack image list
+--------------------------------------+-----------------------------+-------------+
| ID                                   | Name                        | Status      |
+--------------------------------------+-----------------------------+-------------+
| 60532e8b-a0d0-445f-a056-ab7f6e8b0254 | some image                  | active      |
+--------------------------------------+-----------------------------+-------------+

Now you can download your snapshot image by providing a local filename and the snapshot image id.

openstack image save --file my_local_snaphot.img 60532e8b-a0d0-445f-a056-ab7f6e8b0254

Unfortunately the output is blank and just will take quite a while depeding on the image size (usually ~40GB per image!)