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
- Create a volume with the same size as the original volume and the desired volume type.
- Attach the volume to the same instance as the original, format it and mount it on a different location
- 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. Execute this task several times until the data is in sync
- Stop any application/service that is accessing the data on the original volume
- Do a final sync (command in 3)
- Umount the original volume
- Umount the new volume and mount it back on the location of the original volume
- Start the application/service that is accesing the data
- Detach the original volume and delete it.
Windows
- Create a volume with the same size as the original volume and the desired volume type.
- Attach the volume to the same instance as the original, format it and assign a different letter
- 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 Execute this task several times until the data is in sync
- Stop any application/service that is accessing the data on the original volume
- Do a final sync (command in 3)
- Umount the original volume
- Umount the new volume and mount it back on the location of the original volume
- Start the application/service that is accesing the data
- 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.
- Retype the volume with migration-policy on-demand
- Attach the volume to the instance
Using the UI
- 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.
- 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.
- 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
- Retype the volume into the new volume type
- Reattach the volume from the instance