Search This Blog

04 January 2010

Zones getting out of sync

The other day, I started an update and walked away. I noticed today it was done, so I zfs snapshotted the zones and xvm sessions then rebooted.

Upon bootup, everything seemed OK until I tried to access the web pages on one of the zones. Checking svcs -xv, I saw that the local filesystem was down! That's not good!

While troubleshooting, it occurred to me that the global is reporting snv_130 and zlogin to a zone is reporting snv_101a. Oops. Just a little outdated.

I looked around for how to get them into sync, and ran across this article.

The solution is actually quite simple.  It takes *forever* so I really wish I would have checked the time for you before I started.  The basic jist of it is:

# pfexec zoneadm -z MYZONE halt
# pfexec zoneadm -z MYZONE detach
# pfexec zoneadm -z MYZONE attach -u

At first, I forgot the '-u' and it came back and told me it was out of sync and reminded me to try again with -u.


root@serveris:~# zoneadm -z eoti.org attach -u

Log File: /var/tmp/eoti.org.attach_log.voaWef
Attaching...

       Global zone version: entire@0.5.11,5.11-0.130:20091219T044839Z
   Non-Global zone version: entire@0.5.11,5.11-0.101:20081204T010954Z
           Publisher Check: Zone preferred publisher does not contain
                            entire@0.5.11,5.11-0.130:20091219T044839Z.
           Publisher Reset: Copying preferred publisher from global zone.
  Updating non-global zone: (Stage 1).  Output follows
Creating Plan                
ERROR: Could not update attaching zone

Oops, now what?  At first I started looking online at things like Bug 13190... Then I realized I was missing the obvious...
Log File: /var/tmp/eoti.org.attach_log.voaWef
hmm, ok, so what does it say?

root@serveris:~# cat /var/tmp/eoti.org.attach_log.voaWef

[Monday, January  4, 2010  8:08:03 PM PST] Log File: /var/tmp/eoti.org.attach_log.voaWef
[Monday, January  4, 2010  8:08:07 PM PST] Attaching...
[Monday, January  4, 2010  8:08:07 PM PST] existing
[Monday, January  4, 2010  8:08:07 PM PST]
[Monday, January  4, 2010  8:08:07 PM PST]   Sanity Check: Passed.  Looks like an OpenSolaris system.

Unable to retrieve package data for publisher 'os-dev' from one
of the following origin(s):

http://pkg.opensolaris.org/dev/

The catalog retrieved from one of the origin(s) listed above only
contains package data for: opensolaris.org.

To resolve this issue, correct the origin information provided for
publisher 'os-dev' using the pkg set-publisher subcommand, or re-add
the publisher using the correct name and remove the 'os-dev'
publisher.

To re-add this publisher with the correct name, execute the following
commands as a privileged user:

pkg set-publisher -P -g http://pkg.opensolaris.org/dev/ opensolaris.org
pkg unset-publisher os-dev


Unable to retrieve package data for publisher 'os-dev' from one
of the following origin(s):

http://pkg.opensolaris.org/dev/

The catalog retrieved from one of the origin(s) listed above only
contains package data for: opensolaris.org.

To resolve this issue, correct the origin information provided for
publisher 'os-dev' using the pkg set-publisher subcommand, or re-add
the publisher using the correct name and remove the 'os-dev'
publisher.

To re-add this publisher with the correct name, execute the following
commands as a privileged user:

pkg set-publisher -P -g http://pkg.opensolaris.org/dev/ opensolaris.org
pkg unset-publisher os-dev


pkg: The following pattern(s) did not match any packages in the current catalog.
Try relaxing the pattern, refreshing and/or examining the catalogs:
    entire@0.5.11,5.11-0.130:20091219T044839Z

This may seem odd to most of you... but I had the default opensolaris package repository AND the dev repository setup at one point; so it was getting confused.  I followed the instructions (the pkg set-publisher and pkg unset-publisher) then retried the attach...

root@serveris:~# zoneadm -z eoti.org attach -u

Log File: /var/tmp/eoti.org.attach_log.4kaGTg
Attaching...

       Global zone version: entire@0.5.11,5.11-0.130:20091219T044839Z
   Non-Global zone version: entire@0.5.11,5.11-0.101:20081204T010954Z
           Publisher Check: Zone preferred publisher does not contain
                            entire@0.5.11,5.11-0.130:20091219T044839Z.
           Publisher Reset: Copying preferred publisher from global zone.
  Updating non-global zone: (Stage 1).  Output follows
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                              121/121 19959/19959  125.0/125.0

PHASE                                        ACTIONS
Removal Phase                              5811/5811
Install Phase                            15876/15876
Update Phase                             12076/12076
PHASE                                          ITEMS
Indexing Packages                            122/122
  Updating non-global zone: (Stage 2).  Output follows
No updates necessary for this image.  
  Updating non-global zone: Zone updated to entire@0.5.11,5.11-0.130:20091219T044839Z
Attach complete.
Yay!