Step-by-step Procedure for Cutover of Linux LVM Volumes
This is the cutover procedure for a set of disks that are Physical Volumes (PVs) of the Volume Groups (VGs) for the Logical Volumes (LVs) that are migrated to a new set of disks (PVs). This procedure is for a non-cluster host, with brief cutover downtime available at for the cutover. For clustered Linux nodes, follow this article for zero-downtime cutover: [check back later for the link.]
When it is time to cutover a CMC migration session for a set of disks that are using Linux LVM, follow the below steps:
The application running at the host must first be shutdown
The LVs are unmounted from their mountpoints
Trigger the cMotion Cutover and Finalize Cutover at the Migration Session Action menu
The VGs are disabled
The migration session is triggered with the "Complete Session" action, thereby disabling redirection and dependencies on the Source volumes
The Source volumes for the migrated VGs are removed from the host
A rescan is performed to remove the offline source volumes
A “pvscan --cache” is performed for the LVM system to recognize the newly migrated PVs for the VGs
The VGs are Activated
The LVs are mounted back to the mountpoints
The following are detailed step-by-step actions for the cutover:
At the Linux host, stop the application so that the Logical Volumes can be unmounted
Unmount all the relevant LVs by the following example:
At CMC Portal’s Migration Session page, use MIGRATION SESSION ACTIONS to trigger cMotion and then Finalize Cutover
Disable each of the VGs relevant to the cutover, using the following example:
Complete the Migration Session: at the CMC Web Portal, Migration Session page, click on “MIGRATION SESSION ACTIONS” and select “COMPLETE SESSION”.
Using the GUI or CLI/API of the Source Storage, remove the Source Volumes relevant for the cutover from the host. For Clouds, use appropriate Cloud instance management tools. For VMWare, use vCenter or vSphere Client or CLI for ESX. The goal is to remove the source disks so that they are no longer attached to the host.
At the Linux host, perform a low level SCSI rescan to ensure source disks are removed with this rescan command:
Force a fresh rescan of new PVs and ensure the PVs are recognized (note that the new PVs have the same PV UUIDs as the old). Use the ‘--cache’ option to force reading from the physical disks:
Activate each of the VGs by this sample command:
Inspect the LVs and confirm that they are activated:
If the /etc/fstab already has an auto-mount line for the VGs, they should all be mounted automatically (given that the VG and LV names did not change due to migration). Verify using:
Restart the application again after the mount points are verified to be activated again.
The cut-over is complete and the application is up and running on the new storage.
When it is time to cutover a CMC migration session for a set of disks that are using Linux LVM, follow the below steps:
The application running at the host must first be shutdown
The LVs are unmounted from their mountpoints
Trigger the cMotion Cutover and Finalize Cutover at the Migration Session Action menu
The VGs are disabled
The migration session is triggered with the "Complete Session" action, thereby disabling redirection and dependencies on the Source volumes
The Source volumes for the migrated VGs are removed from the host
A rescan is performed to remove the offline source volumes
A “pvscan --cache” is performed for the LVM system to recognize the newly migrated PVs for the VGs
The VGs are Activated
The LVs are mounted back to the mountpoints
Step-by-step Actions
The following are detailed step-by-step actions for the cutover:
At the Linux host, stop the application so that the Logical Volumes can be unmounted
Unmount all the relevant LVs by the following example:
sudo umount /dev/vg1/lvr5
At CMC Portal’s Migration Session page, use MIGRATION SESSION ACTIONS to trigger cMotion and then Finalize Cutover
Disable each of the VGs relevant to the cutover, using the following example:
sudo vgchange -a n vg1
Complete the Migration Session: at the CMC Web Portal, Migration Session page, click on “MIGRATION SESSION ACTIONS” and select “COMPLETE SESSION”.
Using the GUI or CLI/API of the Source Storage, remove the Source Volumes relevant for the cutover from the host. For Clouds, use appropriate Cloud instance management tools. For VMWare, use vCenter or vSphere Client or CLI for ESX. The goal is to remove the source disks so that they are no longer attached to the host.
At the Linux host, perform a low level SCSI rescan to ensure source disks are removed with this rescan command:
sudo rescan-scsi-bus.sh -r -a
Force a fresh rescan of new PVs and ensure the PVs are recognized (note that the new PVs have the same PV UUIDs as the old). Use the ‘--cache’ option to force reading from the physical disks:
sudo pvscan --cache
Activate each of the VGs by this sample command:
sudo vgchange -a y vg1
Inspect the LVs and confirm that they are activated:
sudo lvs -o +segtype
If the /etc/fstab already has an auto-mount line for the VGs, they should all be mounted automatically (given that the VG and LV names did not change due to migration). Verify using:
df -T
Restart the application again after the mount points are verified to be activated again.
The cut-over is complete and the application is up and running on the new storage.
Updated on: 21/02/2023
Thank you!