Wednesday, 26 October 2016

Migrating a zone from Solaris 11.3 to 11.1

The title of the article is misleading since it's not exactly a migration. I did have to rebuild the entire zone from scratch. This post is a description of a specific scenario & the procedure followed to complete the task at hand.

So, to start with I shut down the zone on my Solaris 11.3 global zone & detached it. The SAN admin exported all the LUNs from the 11.3 global zone to the Solaris 11.1 global zone. I could see the migrated disks on the destination system.
In our current environment we configure local zones such that they their root zpools on a dedicated SAN disk.
On the Solaris 11.1 host, the export pools were visible in zpool import output:

root@solaris11dot1:/tmp# zpool import | grep localzone
  pool: localzone_dpool01
        localzone_dpool01                        UNAVAIL  newer version
  pool: localzone_rpool
        localzone_rpool                            UNAVAIL  newer version


I did the zone configuration & when I tried to attach the zone on the Solaris 11.1 global zone, it began to import the two zpools belonging to the local zone & after a few seconds threw the following error:

root@solaris11dot1:/tmp# zoneadm -z localzone attach
cannot import 'localzone_rpool': pool is formatted using a newer ZFS version: unsupported version
zoneadm: zone 'localzone': failed to verify and/or setup all required zone zpool resources
zoneadm: zone 'localzone': attach not done
Manually correct the problem(s) reported above and attach the zone with:

        zoneadm -z localzone attach
or uninstall the zone with:
        zoneadm -z localzone uninstall

I tried to import the zpool manually but this also failed.

root@solaris11dot1:/tmp# zpool import localzone_rpool
cannot import 'localzone_rpool': pool is formatted using a newer ZFS version: unsupported version


So, the zfs version was upgraded in Solaris 11.3 & there is no backward compatibility.

To fix this problem, one method could be to ask the SAN admin to export the disks back to the Solaris 11.3 server, import the pools, destroy them & ask the SAN admin to export the disks again to the Solaris 11.1 server. But that would be a lengthy process.

So, here's the quick fix:

We can't delete an unavailable exported pool. So I did a forceful creation of the zpools with the required nomenclature on the disks used by the exported pools & then exported them.

 zpool create -f localzone_rpool c0t60002AC00000000000004A480000935Dd0
 zpool create -f localzone_dpool01 c0t60002AC00000000000004A490000935Dd0

 zpool export localzone_rpool
 zpool export localzone_dpool01

After this the zone attach worked & the zone was able to boot smoothly.

No comments:

Post a Comment

Using capture groups in grep in Linux

Introduction Let me start by saying that this article isn't about capture groups in grep per se. What we are going to do here with gr...