You are on page 1of 10

TASK SHEET

PROJECT

AUTHORS NAME

DATE OF CREATION

LARDILLIER
FREQUENCY
Date

TO APPLY FROM
Date

20 / 12 / 2007
M

On request

Time

On Incident

History
20 / 12 / 2007

Subject

CYCLIC

Author
LARDILLIER

Creation of the document

Moving a local zone between two global zones

1. Description
This document aims at describing a method for moving a Solaris 10 local zone from one server to
another.
In our

example:
The source global zone is udkctm99,
The target global zone is udkgz1,
The name of the moved local zone is udkdwp01.

At the technical level:


The servers are in Solaris 10 update 4,
Data related to the local zone is on the EMC bay, seen through a SAN,
The multipath to the data is managed by the EMC Powerpath tool.

2. Pre-requisites
2.1. Recovery of the zone configuration
root@udkctm99 # zonecfg -z udkdwp01 info
zonename: udkdwp01
zonepath: /zones/udkdwp01
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
fs:
dir: /DPRHMA/data
special: /dev/vx/dsk/DG28/DG28_data
raw: /dev/vx/rdsk/DG28/DG28_data
type: ufs
/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 1 of 10

Cap Gemini Ernst & Young

TASK SHEET
options: []
fs:
dir: /DPRHMA/oracle
special: /dev/vx/dsk/DG28/DG28_oracle
raw: /dev/vx/rdsk/DG28/DG28_oracle
type: ufs
options: []
fs:
dir: /DPRHMA/redo1
special: /dev/vx/dsk/DG28/DG28_redo1
raw: /dev/vx/rdsk/DG28/DG28_redo1
type: ufs
options: []
fs:
dir: /DPRHMA/redo2
special: /dev/vx/dsk/DG28/DG28_redo2
raw: /dev/vx/rdsk/DG28/DG28_redo2
type: ufs
options: []
fs:
dir: /DPRDW1/data
special: /dev/vx/dsk/DG29/DG29_data
raw: /dev/vx/rdsk/DG29/DG29_data
type: ufs
options: []
fs:
dir: /DPRDW1/oracle
special: /dev/vx/dsk/DG29/DG29_oracle
raw: /dev/vx/rdsk/DG29/DG29_oracle
type: ufs
options: []
fs:
dir: /DPRDW1/redo1
special: /dev/vx/dsk/DG29/DG29_redo1
raw: /dev/vx/rdsk/DG29/DG29_redo1
type: ufs
options: []
fs:
dir: /DPRDW1/redo2
special: /dev/vx/dsk/DG29/DG29_redo2
raw: /dev/vx/rdsk/DG29/DG29_redo2
type: ufs
options: []
fs:
dir: /DPRDW1/exploit
special: /dev/vx/dsk/DG29/DG29_exploit
raw: /dev/vx/rdsk/DG29/DG29_exploit
type: ufs
options: []
fs:
dir: /u02
special: /dev/vx/dsk/DG29/DG29_u02
raw: /dev/vx/rdsk/DG29/DG29_u02
type: ufs
options: []
net:
address: 10.0.101.124
physical: ce0
net:
address: 192.168.3.211
physical: ce2
root@udkctm99 #
/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 2 of 10

Cap Gemini Ernst & Young

TASK SHEET
2.2. Inhibition/suppression of the automatic reboot of the zone : modification
autoboot=false
To prevent the udkdwp01 zone from starting at the reboot of the global zone udkctm99, we are going
to change its configuration : the parameter autoboot is changed to false.
root@udkctm99 # zonecfg -z udkdwp01 set autoboot=false

2.3. Recovering information on the LUN to be migrated:


The zone path of the zone to be migrated:
root@udkctm99 # zonecfg -z udkdwp01 info|grep zonepath
zonepath: /zones/udkdwp01
root@udkctm99 # df -h /zones/udkdwp01
Filesystem
size
used avail capacity
/dev/vx/dsk/DG29/DG29_zones
20G
4.3G
15G
23%
root@udkctm99 #

Mounted on
/zones/udkdwp01

The Disk Groups hosting the data of the local zone udkdwp01 are hosted on DG28 and DG29. These two
DGs are defined on the visible Luns through the SAN.
root@udkctm99 # df -kZ|grep udkdwp01|grep vx|awk '{print $1"
"$6;}'
/dev/vx/dsk/DG29/DG29_zones
/zones/udkdwp01
/dev/vx/dsk/DG29/DG29_data
/zones/udkdwp01/root/DPRDW1/data
/dev/vx/dsk/DG29/DG29_exploit
/zones/udkdwp01/root/DPRDW1/exploit
/dev/vx/dsk/DG29/DG29_oracle
/zones/udkdwp01/root/DPRDW1/oracle
/dev/vx/dsk/DG29/DG29_redo1
/zones/udkdwp01/root/DPRDW1/redo1
/dev/vx/dsk/DG29/DG29_redo2
/zones/udkdwp01/root/DPRDW1/redo2
/dev/vx/dsk/DG28/DG28_data
/zones/udkdwp01/root/DPRHMA/data
/dev/vx/dsk/DG28/DG28_oracle
/zones/udkdwp01/root/DPRHMA/oracle
/dev/vx/dsk/DG28/DG28_redo1
/zones/udkdwp01/root/DPRHMA/redo1
/dev/vx/dsk/DG28/DG28_redo2
/zones/udkdwp01/root/DPRHMA/redo2
/dev/vx/dsk/DG29/DG29_u02
/zones/udkdwp01/root/u02
root@udkctm99 #
root@udkctm99 # vxdisk -g DG28 list
DEVICE
TYPE
DISK
GROUP
STATUS
emcpower7s2 auto:cdsdisk
CX500_METALUN86 DG28
online
root@udkctm99 # vxdisk -g DG29 list
DEVICE
TYPE
DISK
GROUP
STATUS
emcpower8s2 auto:cdsdisk
CX500_METALUN81 DG29
online

PowerPath configuration:
root@udkctm99 # powermt display dev=emcpower7
Pseudo name=emcpower7a
CLARiiON ID=CK200042700426 [udkctm99_cx500]
Logical device ID=60060160F0821100001A6ECCDDD8D911 [Meta86]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP A, current=SP B
==============================================================================
---------------- Host --------------- Stor -- I/O Path - -- Stats --### HW Path
I/O Paths
Interf.
Mode
State Q-IOs Errors
==============================================================================
3074
3074
3072
3072

ssm@0,0/pci@1c,600000/SUNW,qlc@1/fp@0,0
ssm@0,0/pci@1c,600000/SUNW,qlc@1/fp@0,0
ssm@0,0/pci@1d,600000/SUNW,qlc@1/fp@0,0
ssm@0,0/pci@1d,600000/SUNW,qlc@1/fp@0,0

c3t5006016030202828d6s0
c3t5006016930202828d6s0
c5t5006016130202828d6s0
c5t5006016830202828d6s0

SP
SP
SP
SP

A0
B1
A1
B0

active
active
active
active

alive
alive
alive
alive

0
0
0
0

0
0
0
0

root@udkctm99 #

root@udkctm99 # powermt display dev=emcpower8


Pseudo name=emcpower8a
CLARiiON ID=CK200042700426 [udkctm99_cx500]
/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 3 of 10

Cap Gemini Ernst & Young

TASK SHEET
Logical device ID=6006016097C711004CBE11C98AE3DC11 [Meta81]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP A, current=SP B
==============================================================================
---------------- Host --------------- Stor -- I/O Path - -- Stats --### HW Path
I/O Paths
Interf.
Mode
State Q-IOs Errors
==============================================================================
3074
3074
3072
3072

ssm@0,0/pci@1c,600000/SUNW,qlc@1/fp@0,0
ssm@0,0/pci@1c,600000/SUNW,qlc@1/fp@0,0
ssm@0,0/pci@1d,600000/SUNW,qlc@1/fp@0,0
ssm@0,0/pci@1d,600000/SUNW,qlc@1/fp@0,0

c3t5006016030202828d1s0
c3t5006016930202828d1s0
c5t5006016130202828d1s0
c5t5006016830202828d1s0

SP
SP
SP
SP

A0
B1
A1
B0

active
active
active
active

alive
alive
alive
alive

0
0
0
0

0
0
0
0

3. Operating method
3.1. We shutdown the udkdwp01 zone:
root@udkctm99 # zlogin -S udkdwp01 halt

3.2. We detach the udkdwp01 zone from its global zone udkctm99:
This operation allows taking a backup of the configuration information of the udkdwp01 zone. This backup
is related to, especially, information regarding patches and packages and will be generated in the zonepath
of the zone in the format of a manifesto.
Normally, once the zone is detached, we take a backup of its zonepath. Preferably, this backup will be
taken through the pax tool for portability reasons.
Since the zonepath of the udkdwp01 zone will be migrated to udkgz1 through the lunmasking, we do not
need such a backup.
root@udkctm99 # zoneadm -z udkdwp01 detach
root@udkctm99 # cd /zones/udkdwp01

3.3. We check that all the FS defined on DG28 and DG29 are shut down, then we
shutdown the volumes and we de-attach both the DGs :
root@udkctm99
root@udkctm99
root@udkctm99
root@udkctm99
root@udkctm99

#
#
#
#
#

df -k |egrep "DG28|DG29"
vxvol g DG28 stopall
vxdg deport DG28
vxvol g DG28 stopall
vxdg deport DG28

Checking:
root@udkctm99 # vxdisk -o alldgs list

3.4. SAN manipulation + Visibility of the LUN by udkgz1

The SAN team must modify the zoning so that both the LUNs : Meta86 and Meta81 are not
visible only by udkgz1

We make the LUN visible on udkgz1

root@udkgz1
root@udkgz1
root@udkgz1
root@udkgz1
root@udkgz1
root@udkgz1
root@udkgz1

#
#
#
#
#
#
#

devfsadm Cv
powercf -q
powermt config
powermt display dev=all class=clariion
vxdctl enable
vxdisk -o alldgs list
vxdg -C import DG28

/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 4 of 10

Cap Gemini Ernst & Young

TASK SHEET
root@udkgz1 # vxdg -C import DG29
root@udkgz1 # vxvol -g DG28 startall
root@udkgz1 # vxvol -g DG29 startall

3.5. Starting the zone on udkgz1


3.5.1. Mount point creation for the udkdwp01 zonepath on udkgz1
root@udkgz1
root@udkgz1
root@udkgz1
root@udkgz1

#
#
#
#

mkdir /zones/udkdwp01
chmod 700 /zones/udkdwp01
mount /dev/vx/dsk/DG29/DG29_zones /zones/udkdwp01
vi /etc/vfstab

/dev/vx/dsk/DG29/DG29_zones /dev/vx/rdsk/DG29/DG29_zones /zones/udkdwp01 ufs - yes largefiles,suid

root@udkgz1 # mount /zones/udkdwp01

3.5.2. Declaration/starting the udkdwp01 zone on udkgz1:


We create the command zonecfg and the option -a /zones/udkdwp01 , then we attach the zone
with the command zoneadm and the option attach .
Remark : if the command attach is not working, (perhaps due to a one to one compatibility of
patches between both the global zones) you must force the operation by using the option -F .
root@udkgz1 # zonecfg -z udkdwp01
>create -a /zones/udkdwp01
>exit
root@udkgz1 # zoneadm -z udkdwp01 attach
....
....
119276: not installed
119276: not installed
120085: not installed
119404: not installed
119404: not installed
119088: version mismatch
(09) (10)
123809: not installed
120272: version mismatch
(06) (15)
123324: not installed
124442: not installed
These patches installed on this system were not installed on the source system:
119746

If that does not work: we use the option -F :


root@udkgz1 # zoneadm -z udkdwp01 attach -F

Checking that the zone is in the installed status.


root@udkgz1 # zoneadm list -cv
ID NAME
STATUS
0 global
running
1 udkema
running
7 udksep04
running
12 udkhap01
running
13 udkdwp01
installed

PATH
/
/zones/udkema
/zones/udksep04
/zones/udkhap01
/zones/udkdwp01

The only thing that remains is to start the zones.


3.6. Clean up on udkctm99
/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 5 of 10

Cap Gemini Ernst & Young

TASK SHEET
We must clean up the Powerpath config on the udkctm99 server:
udkctm99#
udkctm99#
udkctm99#
udkctm99#
udkctm99#

devfsadm Cv
powercf q
powermt check
powermt display dev=emcpower8 puis dev=emcpower7
vxdctl enable

Updating of /etc/vfstab :
udkctm99# vi /etc/vfstab
udkctm99# Suppression de la zone udkdwp01 de la configuration solaris 1 de udkctm99.

Remark: extract of man powercf :


-q

Runs powercf in quiet mode.


Updates the emcp.conf file by removing PowerPath
devices not found in the HBA scan and adding new
PowerPath devices that were found. Saves a primary
and an alternate path to each PowerPath device.

END OF DOCUMENT

/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 6 of 10

Cap Gemini Ernst & Young

TASK SHEET
Overview
Migrating a zone from one system to another involves the following
steps:
1. Detaching the Zone. This leaves the zone on the originating
system in the "configured" state. Behind the scenes, the
system will generate a "manifest" of the information needed
to validate that the zone can be successfully attached to a new
host machine.
2. Data Migration. The system administrator moves the data which
represents the zone to a new host system (more details below).
3. Zone Configuration. The system administrator creates the zone
configuration on the new host using zonecfg(1m).
4. Attaching the zone. This will validate that the host is
capable of supporting the zone before the attach can succeed.
The zone is left in the "installed" state.
Validation
The validation will check that the exact version of the required
packages and patches are installed on the new host. The algorithm
to determine the packages and patches that must be validated is:
For each package installed in the global zone:
- ignore the package if SUNW_PKG_THISZONE is 'true'
otherwise,
- validate the package if
a) SUNW_PKG_ALLZONES is 'true',
or
b) any file delivered by the package is in a file system
that is inherited from the global zone.
If the zone does not inherit any file systems (whole root)
then (b) will be skipped.
For each of the packages that is being validated we will
also validate all of the associated patches.
In the future we plan to extend this so that we might upgrade
the zone or add patches to the zone when we attach, but initially
we will only validate the new host and inform the sys-admin if there
are packages or patches that are out of sync with what was installed
on the original host machine.
In order to validate the package and patch versions from the
original host and new host, we will read this information
from the pkginfo files in /var/sadm/pkg. We will also need to
read the /var/sadm/install/contents file to determine which packages
are within inherited-pkg-dirs. While some of this information
is public, the contents file format and the existence of the pkginfo
files within /var/sadm/pkg is not. These are contract private
interfaces and a contract with the Install group, to allow us to
access these files, is part of this case.
zoneadm Sub-Commands
We will add two new sub-commands to the zoneadm command and one
new option to the create subcommand within zonecfg.
The syntax for detaching a zone will be:
/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 7 of 10

Cap Gemini Ernst & Young

TASK SHEET
# zoneadm -z my-zone detach
The zone must be halted before being detached.
During detach we will generate metadata describing the versions of
the packages and patches installed on the host. This will be stored
in an XML file in the zonepath, alongside the root and dev
directories. This facilitates easy movement of the zonepath from one
system to another.
We will not implement any kind of archive for a detached zone.
We will document what the sys-admin must do to move the zone
bits around, but they can move this any way they choose.
In some cases, such as a SAN environment, the bits might not have
to move at all.
When we detach, we leave the zone in the configured state.
The sys-admin can then delete the configured zone or attach to
it later.
The syntax for attaching a zone will be:
# zoneadm -z my-zone attach [-F]
Attaching a zone is analogous to installing a zone. That is, you
first must configure the new zone using the zonecfg command. Once
you have the new zone in the configured state you can use attach to
set up the zone root instead of installing.
During attach we will perform the package and patch sanity checks
described above. This will validate that the attach can occur.
If the packages and patches don't match we will list which packages
and patches are out of sync and the zone will be left in the
configured state. The sys-admin can then apply any required
packages or patches to the host to enable the attach to succeed.
Or, they may not be able to attach to the specific host if the
installed software is sufficiently incompatible with the environment
on the original machine.
Once the attach has completed successfully, the XML file describing
the zone will be removed. If you try to install or clone to a
configured zone and there is an XML description for a detached zone
in the zonepath, we will give an error and won't proceed.
The -F option for attach allows the sys-admin to force the attach
with no validation. This is useful in certain cases such as
a clustered environment or for backup/restore, but it does require
that the sys-admin is certain that the system is properly configured
to host the zone or undefined behavior may later occur.
zonecfg create option
To facilitate configuring the detached zone on a new host we will
add a new '-a' option to the create subcommand within zonecfg.
The subcommand for creating a new zone from the detached XML data
will be:
zonecfg:my-zone> create -a path_to_zone_root
The -a option will used the XML description of the detached
zone to configure the new zone instance. It is not required to
/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 8 of 10

Cap Gemini Ernst & Young

TASK SHEET
to configure the new zone this way. That is, the new zone
can be configured using the traditional zonecfg operations and
then "zoneadm attach" can be used to attach the zone root.
All of the validation of the zone happens during attach, not
during configuration of the zone.
EXAMPLE
host1# zoneadm -z my-zone detach
- move the my-zone zonepath from host1 to host2
host2# zonecfg -z my-zone
my-zone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:my-zone> create -a /export/zones/my-zone
zonecfg:my-zone> commit
zonecfg:my-zone> exit
host2# zoneadm -z my-zone attach
Here is an example where some packages and patches are out of sync
between the source host and the local host we are attempting to attach
to. The actual syntax of the error messages will be different in the
final implementation, this is just an example to give an idea of what
might happen.
host2# zoneadm -z my-zone attach
source host packages inconsistent with local host
SUNWgnome-libs (2.6.0,REV=101.0.3.2005.12.06.20.27) version mismatch
(2.6.0,REV=101.0.3.2005.12.19.21.22)
SUNWudaplr (11.11,REV=2005.12.13.01.06) version mismatch
(11.11,REV=2006.01.03.00.45)
SUNWradpu320 (11.10.0,REV=2005.01.21.16.34) is not installed
SUNWaudf (11.11,REV=2005.12.13.01.06) version mismatch
(11.11,REV=2006.01.03.00.45)
NCRos86r (11.10.0,REV=2005.01.17.23.31) is not installed
local host packages inconsistent with source host
SUNWukspfw (11.11,REV=2006.01.03.00.45) was not installed
SUNWsmcmd (1.0,REV=2005.12.14.01.53) was not installed
source host patches inconsistent with local host
120081 is not installed
118844 is not installed
118344 is not installed
local host patches inconsistent with source host
118669 was not installed
118668 was not installed
116299 was not installed
EXPORTED INTERFACES
zoneadm subcommands
detach
EVOLVING
attach [-F]
EVOLVING
zonecfg create subcommand option
-a path
EVOLVING
IMPORTED INTERFACES
/var/sadm/install/contents
/var/sadm/pkg/*/pkginfo

Contracted Unstable
(LSARC/2004/464)
Contracted Unstable

A contract is part of this case.


/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 9 of 10

Cap Gemini Ernst & Young

TASK SHEET
pkginfo(4)
VERSION keyword
PATCHLIST keyword

public
evolving (pkginfo(4))
public (psarc/1995/063)

REFERENCES
1. PSARC 2002/174 Virtualization and Namespace Isolation in Solaris
2. RFE: Ability to migrate zones across machines Bugid 5022513
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=5022513

/
var/www/apps/conversion/tmp/scratch_3/317894383.d
oc

Page 10 of 10

Cap Gemini Ernst & Young

You might also like