Migrate VM Storage from Host-Local Storage to Persistent Volume

This guide provides step-by-step instructions for migrating a virtual machine storage from host-local storage to a persistent block storage volume in Private Cloud Director.

Prerequisites

  • The VM for which the storage is being migrated must be in stopped state before the migration.

  • Ensure that the target volume storage backend is configured and available.

  • The OpenStack CLI must be installed and configured.

  • Sufficient storage capacity in the block storage backend.

Steps to Migrate VM Storage

Step 1: Identify the VM and its Local Disk

List all VMs to find the target VM's ID:

openstack server list

Get the details of the specific VM:

openstack server show <VM_ID

The disk location will be under the OS-EXT-SRV-ATTR:root_device name field, typically /dev/vda or similar.

Step 2: Create a New Volume

Create a new volume of the required size to migrate the local disk.

Verify the volume creation:

Step 3: Convert the Local Disk to an Image

Stop the VM if it's running:

Create an image from the local storage disk of the VM:

Verify that the image is successfully created:

Step 4: Create a New Bootable Volume from the Image

Use the newly created image to create a bootable volume:

Ensure the volume is available before proceeding:

Step 5: Detach Local Storage and Attach New Volume

Detach the local storage disk.

Attach the newly created volume.

Step 6: Start the VM

Verify that the VM is running and using the new volume:

Verification

  • Confirm that the VM boots from the new volume.

  • Confirm the new volume shows in-use.

  • Check that the local storage is no longer in use.

  • Connect to the VM and verify disk configuration

Last updated

Was this helpful?