Beruflich Dokumente
Kultur Dokumente
Moving the local zones consists of the following steps, described in the sections to
follow:
Shutting down the local zones and detaching them, saving their state using a ZFS
file system snapshot, and exporting the zpool containing their zonepaths.
Importing the zpool containing the zonepaths to the destination host and
attaching it while running the update on attach feature.
Rolling back the zones to their previous state if the update on attach feature fails
to successfully update them.
and iand cdisplay all of the installed and configured zones. In this
instance, there are two local zones
zone1 and zone2 with the zonepaths
/sharedzones/zone1and /sharedzones/zone2respectively:
oldhost#zoneadmlistvic
IDNAMESTATUSPATHBRANDIP
0globalrunning/nativeshared
3zone1running/sharedzones/zone1nativeshared
4zone2running/sharedzones/zone2nativeshared
2. Shut down the local zones:
oldhost#zloginzone1shutdowni0
oldhost#zloginzone2shutdowni0
Each invocation of the shutdowncommand runs the shutdown scripts inside
the zone, removes the zones runtime resources, and halts it.
3. When the state of the zone changes from runningto installed, as shown by
the zoneadmlistcommand, the zones have been halted and can be detached:
oldhost#zoneadmzzone1detach
oldhost#zoneadmzzone2detach
The zoneadmdetachcommand saves the zones package and patch state
information into single files. These files are used to reattach the zones using the
zoneadmattachcommand, once each of the zones is moved.
4. Generate a read-only snapshot of the shared-zones zpool, called
shared-zones@downrev. This snapshot retains the complete state of the zones
file systems:
oldhost#zfssnapshotrsharedzones@downrev
5. List the volumes currently known by the ZFS file system on oldhost. Note the
presence of the shared-zones@downrev snapshot that is not mounted, in
addition to the shared-zones file system:
oldhost#zfslist
NAMEUSEDAVAILREFERMOUNTPOINT
...
sharedzones4.18G15.4G4.14G/sharedzones
sharedzones@downrev46.3M4.13G
Note: A ZFS file system pool cannot be exported if it has a spare device that is shared with
other pools and is currently used.
7. List the zones on oldhost. Only the global zone should be running:
oldhost#zoneadmlistvic
IDNAMESTATUSPATHBRANDIP
0globalrunning/nativeshared
zone1configured/sharedzones/zone1nativeshared
zone2configured/sharedzones/zone2nativeshared
Before moving a local zone, the patch levels of the packages the local zone contains
should be compared with the global zone running on the local zones host, to check
that they are identical. This should be done as part of regular system maintenance to
identify inconsistencies introduced in error. The patch levels of the global and local
zones can be compared by examining the list of packages and patches for each zone
generated with the pkginfoand showrevpcommands. Alternatively, Sun xVM
Ops Center can be used to automate this process.
Note: Only the packages that are installed on the global zone on newhost and that have
the SUNW_PKG_ALL_ZONESflag set to true are updated. The SUNW_PKG_ALL_ZONES
flag indicates that these packages must be consistent across all zones, or are in a package
directory inherited by the zone. The rest of the packages can diverge and remain untouched.
Given that oldhost and newhost share storage, once the zones are halted and
detached from oldhost and the snapshots prepared, the zpools containing their
zonepaths can be exported from oldhost, imported, and reattached to newhost.
2. Run the zpoolimportcommand with the pool name to execute the import:
newhost#zpoolimportsharedzones
3. Run the zoneadmlistcommand to determine what zones are running on this
mount them. This can take one of two forms, depending on the value of the
mountpointproperty set by the zfssetcommand. If the mountpoint
property was set to a specific path, run the following command:
newhost#zfsmountsharedzones
If the mountpointproperty was set to legacy, run the following command:
newhost#mountFzfssharedzones/sharedzones
6. Create the new configured zones with the zonecfgcreatecommand. Use the
zoption to specify the name of the zone, and ato define the path for the
option:
newhost#zoneadmzzone2attachu
Gettingthelistoffilestoremove
Removing15files
Remove2of2packages
Installing31files
Add2of2packages
Updatingeditablefiles
Thefile</var/sadm/system/logs/update_log>withinthezone
containsalogofthezoneupdate.
The superfluous packages are removed and the missing packages are installed
to make zone2 compatible with the package and patch state of the global zone
on newhost.
Note: The time required for the update on attach feature to complete the software upgrade
depends on the number of packages and patches that need to be updated. An invocation of
the update on attach feature with only a few patches should normally take a short period of
time probably no more than a few minutes. However, complex operating system upgrades
can take much longer.
17 Maintaining Solaris with Live Upgrade and Update On Attach Sun Microsystems, Inc.
.
4. Saving ZFS filesystem snapshots prior to executing a procedure that can potentially damage local zones to help
enable their roll-back to a prior state is a recommended precaution to help minimize unplanned disruption.
IDNAMESTATUSPATHBRANDIP
0globalrunning/nativeshared
zone1configured/sharedzones/zone1nativeshared
zone2configured/sharedzones/zone2nativeshared
2. Run the zpoolimportcommand with no parameters to see whether the zpool
is available for import:
oldhost#zpoolimport
pool:sharedzonesid:9978900745171968029
state:ONLINE
action:Thepoolcanbeimportedusingitsnameornumeric
identifier.
config:
sharedzonesONLINE
c0d1ONLINE
3. Run the zpoolimportcommand using the zpool name:
oldhost#zpoolimportsharedzones
4. Run a zfslistcommand to check that the snapshot is available on oldhost:
oldhost#zfslist
NAMEUSEDAVAILREFERMOUNTPOINT
...
sharedzones4.19G15.4G4.14G/sharedzones
sharedzones@downrev46.3M4.13G
18 Maintaining Solaris with Live Upgrade and Update On Attach Sun Microsystems, Inc.
previous state and make it possible to reattach both local zones to oldhost:
oldhost#zfsrollbacksharedzones@downrev
oldhost#zoneadmzzone1attach
oldhost#zoneadmzzone2attach