Skip to content

Volume data migration between volume types

If you need to migrate the data between volume types you have several options available.

a. side by side synchronization b. volume retype

Use a) if you can't afford downtime, once the sync has been completed you can flip over to the new machine. Use b) if you can schedule some downtime for your application.

Side by side synchronization

In this procedure we will create a new volume with the same size as the original and the new desired type. Once ready you need to attach the new volume to the instance, format it and mount it. When done you can synchronize the data and flip the volume mounts once ready. To finalise the procedure you must unmount the original volume and delete it at the end. The copy procedure is OS dependent, please follow one of the recipes listed corresponding to the OS of the machine.

Linux

  1. Create a volume with the same size as the original volume and the desired volume type.
  2. Attach the volume to the same instance as the original, format it and mount it on a different location
  3. Execute the synchronization between the volumes. Let's say that we have two volumes mounted in /mnt/volumeOLD and /mnt/volumeNEW, we can start syncing the data between them.
$ rsync -a /mnt/volumeOLD/ /mnt/volumeNEW

Execute this task several times until the data is in sync 4. Stop any application/service that is accessing the data on the original volume 5. Do a final sync (command in 3) 6. Umount the original volume 7. Umount the new volume and mount it back on the location of the original volume 8. Start the application/service that is accesing the data 9. Detach the original volume and delete it.

Windows

  1. Create a volume with the same size as the original volume and the desired volume type.
  2. Attach the volume to the same instance as the original, format it and assign a different letter
  3. Execute the synchronization between the volumes. Let's say that we have two volumes mounted in D: and E: we can start syncing the data between them. Please open a cmd command prompt, and type the following command
   %SystemRoot%\system32\robocopy.exe D: E: /MT:16 /R:0 /W:0 /ZB /NP /COPYALL /DCOPY:T /MIR /NFL /NDL /XJD /XO

Execute this task several times until the data is in sync 4. Stop any application/service that is accessing the data on the original volume 5. Do a final sync (command in 3) 6. Umount the original volume 7. Umount the new volume and mount it back on the location of the original volume 8. Start the application/service that is accesing the data 9. Detach the original volume and delete it.

Volume retype

This procedure is based in executing a series of OpenStack commands in the API. These commands can be executed in the website, or in the CLI. Here are the steps you need to do to migrate a volume to another volume type.

  1. Retype the volume with migration-policy on-demand
  2. Attach the volume to the instance

Using the UI

  1. Detach the volume from the instance in the UI. Please select manage attachments in the Volumes view. Once the window is open, click on delete attachments.
  2. Once the volume is available, click on retype volume. Please select the new volume type and set on-demand in the migration policy field. This could take several hours.
  3. Once completed, click again on manage attachments and add it back to the server you have removed it.

Using the CLI

Please log into lxplus8 or aiadm 1. Detach the volume from the instance

$ openstack server remove volume SERVER_NAME_OR_ID VOLUME_NAME_OR_ID
  1. Retype the volume into the new volume type
$ openstack volume set --type NEW_TYPE --retype-policy on-demand VOLUME_NAME_OR_ID
  1. Reattach the volume from the instance
$ openstack server add volume SERVER_NAME_OR_ID VOLUME_NAME_OR_ID