unix sysadmin archives
Donation will make us pay more time on the project:
          

Monday 27 June 2011

Patching a global zone with more than 3 local zones

Just incase you are patching a global zone with more than 3 local zones. If this is the case, we should detach all of the zones from the container before patching. There is a chance you might encounter some errors while re-attaching resulting to an incomplete state of the zones. One of the cause might be full file system. Make a quick check abd perform cleanup before re-attaching. If it fails, here is a workaround.

globalsys# zoneadm -z zone-sys1 attach -u
Getting the list of files to remove
Removing 5 files
Remove 7 of 7 packages
Installing 594 files
Add 192 of 192 packages
Installation of these packages generated warnings: SUNWzfsr SUNWzfsu SUNWzoner SUNWzoneu
Updating editable files
pkgserv: ERROR: pkglog is not complete
pkgserv: ERROR: Ignoring 5889 bytes from log
pkgserv: ERROR: cannot rewrite the contents file
The file </var/sadm/system/logs/update_log> within the zone contains a log of the zone update.
cat: output error (0/240 characters written)
No space left on device
zoneadm: zone 'zone-sys1': '/etc/release' failed with exit code 2.
could not update zone

globalsys# zoneadm -z zone-sys1 attach -u
zoneadm: zone 'zone-sys1': zone is incomplete; uninstall required.

globalsys# zoneadm list -vic
  ID NAME             STATUS     PATH                           BRAND    IP   
   0 global           running    /                              native   shared
   - zone-sys1          incomplete /zones/zone-sys1                 native   shared
   - zone-sys2          installed  /zones/zone-sys2                 native   shared
   - zone-sys3          configured /zones/zone-sys3                 solaris9 shared
   - zone-sys4          configured /zones/zone-sys4                 native   shared
   - zone-sys5          configured /zones/zone-sys5                 solaris9 shared
   - zone-sys6          configured /zones/zone-sys6                 native   shared
   - zone-sys7          configured /zones/zone-sys7                 solaris9 shared
   - zone-sys8          configured /zones/zone-sys8                 native   shared
globalsys# cd /zones/zone-sys1

globalsys# ls
SUNWdetached.xml  lost+found        root
dev               lu

Move the SUNWdetached.xml file somewhere safe.

globalsys# mv SUNWdetached.xml SUNWdetached.xml_bak.zone-sys1
globalsys# mv SUNWdetached.xml_bak.zone-sys1 /var/tmp


Then make a copy of the /etc/zones/index file.

globalsys# cp /etc/zones/index /etc/zones/index.incomplete


**Now, edit the /etc/zones/index. Change the line containing the "incomplete" keyword and replace it with "installed".

globalsys# vi /etc/zones/index

# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)zones-index        1.2     04/04/01 SMI"
#
# DO NOT EDIT: this file is automatically generated by zoneadm(1M)
# and zonecfg(1M).  Any manual changes will be lost.
#
global:configured:/:
zone-sys1:incomplete:/zones/zone-sys1:66e6b6eb-8666-ebe6-ebe8-b6fb6bf66868
zone-sys2:installed:/zones/zone-sys2:f6b66668-6866-eb6e-eeb6-8b66f6bb66fb
zone-sys3:installed:/zones/zone-sys3:ef66e8e6-688b-e6b8-bfbe-866e8f666f6e
zone-sys4:installed:/zones/zone-sys4:66b66b66-68e6-668f-ebe6-eb6bb68efbf6
zone-sys5:installed:/zones/zone-sys5:6e666bf6-8bbb-6688-b6b6-b66eebb666be
zone-sys6:installed:/zones/zone-sys6:6e6b6e6f-6eb8-6b68-b66e-ee686bebbe66
zone-sys7:installed:/zones/zone-sys7:6bf6e6e6-8f6f-66b6-e66e-b6668e66febb
zone-sys8:installed:/zones/zone-sys8:e6666b6b-86ee-e6e6-bbb6-86e6eb66f686

Now, detach the zone to put it in configured state

globalsys# zoneadm -z zone-sys1 detach
globalsys# zoneadm list -vic
  ID NAME             STATUS     PATH                           BRAND    IP   
   0 global           running    /                              native   shared
   - zone-sys2          installed  /zones/zone-sys2                 native   shared
   - zone-sys1          configured /zones/zone-sys1                 native   shared
   - zone-sys3          installed  /zones/zone-sys3                 solaris9 shared
   - zone-sys4          installed  /zones/zone-sys4                 native   shared
   - zone-sys5          installed  /zones/zone-sys5                 solaris9 shared
   - zone-sys6          installed  /zones/zone-sys6                 native   shared
   - zone-sys7          installed  /zones/zone-sys7                 solaris9 shared
   - zone-sys8          installed  /zones/zone-sys8                 native   shared

That's it. Try to reattach the zone again. It should be good by now.

globalsys# zoneadm -z zone-sys1 attach -u
Getting the list of files to remove
Removing 5 files
Remove 8 of 8 packages
Installing 6 files
Add 9 of 9 packages
Updating editable files
The file </var/sadm/system/logs/update_log> within the zone contains a log of the zone update.
globalsys# zoneadm list -vic
  ID NAME             STATUS     PATH                           BRAND    IP   
   0 global           running    /                              native   shared
   - zone-sys2          installed  /zones/zone-sys2                 native   shared
   - zone-sys1          installed  /zones/zone-sys1                 native   shared
   - zone-sys3          installed  /zones/zone-sys3                 solaris9 shared
   - zone-sys4          installed  /zones/zone-sys4                 native   shared
   - zone-sys5          installed  /zones/zone-sys5                 solaris9 shared
   - zone-sys6          installed  /zones/zone-sys6                 native   shared
   - zone-sys7          installed  /zones/zone-sys7                 solaris9 shared
   - zone-sys8          installed  /zones/zone-sys8                 native   shared



No comments:

Post a Comment