Skip to content

Convert local boot disk to volume

Overview

This document will show you how to convert an instance which was created with local storage to use a persistent volume as boot medium. To do this a snapshot of the local disk needs to be created and uploaded to the image service. This process is called shelving and will also stop the instance to ensure data integrity.

Prerequisites

Prerequisites

or if using the CLI:

Shelve instance and create a new one with volume

In the instances overview locate the instance and click on the arrow in the column "Actions". Then select "Shelve Instance". Depending on the size of the local disk, this can take a while.

Next, create a new volume by switching to the volumes overview and clicking "Create Volume". Choose "Image" as volume source and select the recently created snapshot (it's called <instance-name>-shelved). The size is set automatically. Then click on "Create Volume". Depending on the size of the snapshot, this can take a while.

Finally, create a new instance using the first steps tutorial. During source selection choose "Volume" as boot source and pick the recently created one. Make sure that "Delete Volume on Instance Delete" is disabled (this should be the default).

Info

While it is possible to skip the volume creation step by choosing a snapshot as boot source during instance creation, this will fail with larger snapshot sizes (approximately > 5GB). The reason is, that the instance creation times out before the conversion of the snapshot has finished.

OpenStack-CLI

Instead of the GUI, the CLI can be used as well. First, shelve the instance.

openstack server shelve --wait <server-uuid>

Next, fetch the snapshot ID and create a new volume. Make sure to use the same size as defined in the initially used instance flavor, so that block device and filesystem sizes are equal.

openstack image list --private
openstack volume create <volume-name> --image <snapshot-id> --size 20

Finally, create a new instance which boots from the volume.

openstack server create --volume <volume-id> --network <network-id> --flavor <flavor> <server-name>