Posts Tagged ‘migration’

Moving populated disks out of rootdg or moving rootdg to another system

Friday, March 19th, 2010

First, moving populated disks between diskgroups.
Get a list of disks in the diskgroup that you intend to move the populated disks out of.
# vxdisk list | grep rootdg

Get the configuration of the diskgroup.
# vxprint -ht -g rootdg

Determine which disks contain the volumes that are to be moved.

Save the configuration of the desired volumes in a format that can be used later by vxmake to recreate the volumes. Specify all volumes on the disks in question, plus any unassociated plexes and their child subdisks, plus any unassociated subdisks.
# vxprint -hmQq -g rootdg vol01 vol02 vol03 > /tmp/volinfo

Unmount the appropriate filesystems, and/or stop any processes holding the volumes open.

Stop all the volumes.
# vxvol -g rootdg stop vol01 vol02 vol03

Remove from the configuration database the definitions of the structures ( (volumes, plexes, subdisks) to be moved. NOTE that this does not affect your data.
# vxedit -g rootdg -r rm vol01 vol02 vol03

Remove the disks from the original diskgroup.
# vxdg -g roodg rmdisk rootdg01 rootdg02 rootdg03 rootdg04

If you are moving the disks to a preexisting diskgroup, SKIP THIS STEP. If not, initialize the diskgroup using one of your disks. It is simplest to keep the old disk names until a later step.
# vxdg init newdg rootdg01=c1t2d0s2

Add the disks to their new disk group. It is simplest to keep the old disk names until a later step.
# vxdg -g newdg adddisk rootdg02 rootdg03 rootdg04

Verify that the disks are in their new diskgroup.
# vxdisk list | grep newdg

Reload the object configuration into the new diskgroup.
# vxmake -g newdg -d /tmp/volinfo

Verify the configuration of the new diskgroup.
# vxprint -ht -g newdg

Test your data.

Second, moving rootdg between systems.

Get the diskgroup ID (dgid) of rootdg from the old host.
# vxdisk -s list
(example)

Disk: c1t5d0s2type: slicedflags: online ready private autoconfig autoimport importeddiskid: 824180434.4523.csclust2dgname: rootdgdgid: 824180442.4528.csclust2hostid: csclust1 Disk: c1t9d0s2type: slicedflags: online ready private autoconfig autoimport importeddiskid: 824180440.4525.csclust2dgname: rootdgdgid: 824180442.4528.csclust2hostid: csclust1 Disk: c1t13d0s2type: slicedflags: online ready private autoconfig autoimport importeddiskid: 830532975.3418.csclust1dgname: rootdgdgid: 824180442.4528.csclust2hostid: csclust1

Shutdown the old host, remove the disks, and connect the disks to the new host.

Import the diskgroup with its new name, assigning ownership of the diskgroup to the new host, using the dgid for the diskgroup name.
# vxdg -C -n newdg import 824180442.4528.csclust2

Perform the necessary steps to make the new host and VxVM recognize the new disks. I.e. perform the steps necessary to make the OS see the disks, and then perform a ‘vxdctl enable’ to restart vxconfigd so that VxVM also recognizes the disks.

Start all volumes in the diskgroup.
# vxrecover -g newdg -sb

zone migration

Monday, January 25th, 2010

Procedure to do a zone migration.
——————————————-

Actions on nodeA

create a pool called pool1 with some disk in it on NodeA

NodeA# zpool import pool1
NodeA# zfs create zones/labzone3 /zones/labzone3
NodeA# chmod 700 /zones/labzone3
NodeA# zonecfg -z labzone3
>create
>set zonepath /labzone3
>set autoboot=true
>set pool=pool_default
>add net
net:set physical=eri0
net:set address=10.45.13.202
net:end
>verify
>commit
>exit
NodeA# zoneadm -z labzone3 intall ( this takes about 20 Minutes)
NodeA# zoneadm -z labzone3 ready
NodeA# zoneadm -z labzone3 boot
NodeA# zlogin -C labzone3
labzone3# df -k
labzone3# init 0
NodeA# zonecfg -z labzone3 export -f /tmp/labzone3.cfg
NodeA# umount /zones/labzone3
NodeA# zpool export pool1

Actions on nodeB

NodeB# mkdir -p -m 700 /zones/labzone3
NodeB# zpool import pool1
….successfull
NodeB# zpool iostat
NodeB# zpool ls
NodeB# mount -F zfs pool1/labzone3 /zones/labzone3
NodeB# scp NodeA:/tmp/labzone3.cfg /tmp/labzone3.cfg
NodeB# zonecfgadm -z labzone3 -f /tmp/labzone3.cfg

NodeB# vi /etc/zones/index
change here configured into installed
NodeB#zoneadm -list -i
NodeB#ftp NodeA
get> /etc/zones/labzone3.xml
to> /etc/zones/labzone3.xml
NodeB#zoneadm -z labzone3 boot

zone boot successfullly on NodeB