Migrating Non-Global Zones in the Solaris 10 OSSudhakar Ramakrishnan, December 2008 This document explains the process of migrating Solaris non-global zones from an old LUN to a new LUN. The target audience is system administrators for the Solaris Operating System and storage administrators. This article covers the following topics: OverviewMigration is the process of moving a zone from a disk to another. The need to move a zone might arise for any of the following reasons:
This document is focused only on the following zone architectures:
Migration TheoryMigration happens in two phases:
Migration be visualized as shown in Figure 1. Figure 1: Diagram of Migration Process In Figure 1, before migration, the root and application file systems reside on a metadevice, and in the new LUN, a metaset is used to accommodate the file systems. Metasets provide the following advantages:
PrerequisitesBefore you start the zone migration process, capture the output of the following commands. The output would be helpful in a backout plan.
metaset metaset -s SetName -p metastat format metastat -p luxadm probe Also capture the output of the following commands for Veritas Volume Manager: vxdisk list vxprint -g <diskgroup> -hmQqs vxdg list If any of the file systems from the zone are shared as NFS file systems, unshare them before the migration to prevent the file systems from being locked at the target. Migration ProcedureFollow these steps to perform the migration process: 1. Create a metaset: metaset -s s10-12 -a -h <HostName> 2. Add the new LUN to the metaset: metaset -s s10-12 -a /dev/rdsk/<NewLUN> 3. Create a RAID-0 (stripe) volume on the new LUN: metainit -s s10-12 d300 1 1 /dev/rdsk/<NewLUN>
4. Enable the metaset; then the volume is ready to be used by soft partitions. metaset -s s10-12 -A enable 5. Create the required number of soft partitions with the required space. The number of soft partitions equals the number of zone root file systems plus the number of zone application file systems. metainit -s s10-12 d200 -p d300 4gb metainit -s s10-12 d201 -p d300 50gb Initialize the soft partitions with the required storage space that has to be allocated. 6. Create new directories for the zone root and application file systems: mkdir /zones/TestZone_new mkdir /zones/TestZone/root/app_new 7. Create a new file system on all new soft partitions: newfs /dev/md/s10-12/rdsk/d200 newfs /dev/md/s10-12/rdsk/d201 8. Mount the soft partition mount /dev/md/s10-12/rdsk/d200 /zones/TestZone_new 9. Similarly, mount the application file system, mount /dev/md/s10-12/rdsk/d201 /zones/TestZone/root/app_new Now, you can see the mountpoint The new file systems are ready to be synchronized with the zone file systems that are in use now. Synchronization happens in two steps:
10. Do the first-level sync: /usr/local/bin/rsync -av -e /usr/local/bin/ssh \ /zones/TestZone/root/app/ /zones/TestZone/root/app_new Verify both the application file system sizes. In this example, 11. Confirm that all the applications and databases running on the zone are shut down, and then halt the zone. 12. Do the final sync: /usr/local/bin/rsync -av -e /usr/local/bin/ssh \ /zones/TestZone/ /zones/TestZone_new Note: A forward slash (/) must be appended at the end of the source file system while synchronizing. 13. Unmount both the zone root file systems. umount /zones/TestZone umount /zones/TestZone_new 14. Make a backup of the zone configuration file ( cd /etc/zones cp TestZone.xml /export/home/User/ TestZone.xml.bakup 15. Replace the raw and block device of the old application file system with the new application file system in the zone
configuration file ( a. Edit the vi TestZone.xml b. Change the information from this: <filesystem special="/dev/md/dsk/d101" raw="/dev/md/rdsk/d101" directory="/app" type="ufs"> To this: <filesystem special="/dev/md/s10-12/dsk/d201" raw="/dev/md/s10-12/rdsk/d201" directory="/app" type="ufs"> 16. Cross mount the zone root file system, that is, mount the new zone root file system ( mount /dev/md/s10-12/rdsk/d200 /zones/TestZone Now, we have the new file system for the zone root. We have already defined in the zone configuration file that 17. Boot up the zone, log in, and verify the file system: Zoneadm -z TestZone boot 18. Edit the Change this: /dev/md/s10-12/dsk/d301 /dev/md/s10-12/rdsk/d301 /TestZone ufs 2 yes - To this: /dev/md/s10-12/dsk/d200 /dev/md/s10-12/rdsk/d200 / TestZone ufs 2 yes - 19. Start up and verify the status of the applications and databases. References
Comments (latest comments first)Discuss and comment on this resource in the BigAdmin Wiki
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics | ||||||||||