Tuesday 19 March 2013

SAN Migration via LVM: Don't Forget Raw Logical Volumes

Need to migrate several AIX logical partitions to a new SAN storage subsystem. When we looked at our options, we originally planned to migrate the root volume group (rootvg) using a mksysb backup, which would let us restore onto the new SAN and test the reboot without impacting the original configuration. The data volume groups were to be migrated using the AIX Logical Volume Manager (LVM). But our plan ran into a hitch when we realized the source system had some raw logical volumes in rootvg.

Well, what difference would that make? 

If you have raw logical volumes (LVs) in rootvg, the contents of those LVs won't get backed up by the mksysb command. The reason for this is that the mksysb file-system image is in backup-file format. In other words mksysb only captures files that are present in a mounted file system. 

So we were left with a challenge. How could we migrate the data in the raw LVs to the new SAN? 

We thought of using the alt_disk_copy command to clone rootvg to a disk on the new SAN, but then we would have faced the same difficulty as with the mksysb command. The alt_disk_copy command backs up only mounted file systems -- not raw logical volumes. Another option was to create a separate application-level backup of the raw LVs. Unfortunately, that would involve some extra backups and possibly more extensive downtime. 

Mirror, Mirror! 

In the end we found a simple solution that didn't involve rebuilding or restoring the raw logical volumes. We created a mirror of the rootvg using the mirrorvg command. This approach guaranteed we'd have a mirror copy of rootvg, including all the raw logical volumes. The volume group on the new SAN would be fully synchronised with the copy on the original SAN. Mirrorvg gave us a truly up-to-date mirror of the rootvg. Once the mirror was completed, we'd change the bootlist to point to the physical volume on the new SAN, and then reboot. 

The migration went smoothly, and after the mirrorvg, we rebuilt the boot image on the new SAN disk using the bosboot command. 

We then rebooted and were able to mirror the rest of the data volume groups to the new SAN. Finally, we removed the copies from the original SAN disk, starting with rootvg (via the unmirrorvg command). We had to remove the original rootvg disk from the bootlist, and finally detach the original SAN from the AIX VM. 

Playing in the SAN
There were some pros and cons with using a mirror instead of a mksysb backup or disk clone. With the mksysb restore or alt_disk_copy, you can verify ahead of time that the OS will boot neatly on the new SAN. You can also play a little with the new SAN, checking performance and getting famlliar with procedures for assigning new disk. 

The risk is that you would lose any rootvg changes between the time of creating the backup/clone and the time you cut over to the new SAN. 

The mirrorvg isn't a perfect solution either. For starters, you don't get a chance to verify the VM boots from the new SAN until you have shut down your system on the original SAN. Another limitation is that you can only mirror to the new SAN if your configuration allows you to connect to the old SAN and the new SAN at the same time. That may not be an option for your environment. 

Quick and Clean
In my client's environment, the mirror of the volume group worked cleanly and quickly. Most importantly, it captured all of the data that was in the raw logical volumes and mirrored them all to the new SAN subsystem. 

In preparing our migration, we were able to draw on a number of excellent resources. One of these was an article by my colleague, Chris Gibson, on Using the AIX Logical Volume Manager to Perform SAN Storage Migrations. That article includes many practical examples, as well as the commands you need to run to make your SAN migration as smooth as possible. 

Resources 

AIX Installation and Migrationhttp://bit.ly/OmKmLH 

Clone a running system to an alternate disk using alt_disk_copyhttp://bit.ly/QudX0S 

Create a backup of the root volume group using mksysb command 
http://bit.ly/OUxngf 

Mirror all the logical volumes in a volume group with mirrorvghttp://bit.ly/MSWR1H 

Give rootvg the space it needs: why your OS needs some room to breathehttp://ibm.co/Oe745W 


Courtesy POWER IT Pro.

No comments:

Post a Comment