Tuesday, 21 May 2013

Migrating a Solaris 10 zone to a Solaris 10 branded zone on Solaris 11


So there's an official Oracle procedure somewhere. Mine just goes into a little more detail and putting in workarounds for some of the bugs I found. 

*Edit: Points 5 and 11 is not necessary with the latest Solaris packages installed.

Zone name: zone1

On old (Solaris 10) global zone:
  1. zoneadm -z zone1 ready
  2. cd /zone/path
  3.  find root -print | cpio -oP@ | gzip >/dumps/zone1.cpio.gz
  4. zonecfg -z zone1 export -f /dumps/zone1.cfg
  5. Copy config and dump across to new global zone
  6. zfs send and recv any extra filesystems across to new global zone
On new (Solaris 11) global zone
  1. Notes:
    1.  I create a zpool with the name “zone”where all my zones data will sit on
    2.  I create a zfs filesystem zone/roots where all the zone paths will be in
    3.  Each zone gets a get a zfs filesystem off /zone where its mounted filesystems stem off from. e.g /zone/zone1 with /zone/zone1/home
  2. vi zone1.cfg*
    1. Change IP if needed
    2. Correct attached filesystems path if needed
    3. Set brand=Solaris10
    4. Set ip-type=exclusive
    5. Change  from net to anet
  3. zonecfg -z  zone1 -f zone1.cfg
  4. zoneadm -z zone1 attach -a /dump/zone1.cpio.gz
  5. Make sure the NIC gets configured on boot - fixes this
    1. vi /zone/path/zone1/root/etc/rc3.d/S99sol11networkaround
      • #This is a workaround for Sol10 zones on Sol11
      • # Till the bug gets fixed
      • ifconfig net0 `cat /etc/hostname.net0`
      • sleep 3
      • svcadm clear svc:/network/physical:default
    2. vi /zone/path/zone1/root/etc/hostname.net0
      • zone1 netmask 255.255.255.0 up
  6. Change root's home from /export/home/root to /root - might not be needed in your environment
    1. vi /zone/path/zone1/root/etc/passwd
    2. mv /zone/zone1/home/root /zone/roots/zone1/root/
  7. If IP is to change, vi /zone/roots/zone1/root/etc/hosts
  8. Boot zone1 and zlogin
  9. ifconfig plumb net0
  10. vi /etc/default/nfs and change: LOCKD_SERVERS=1024 - fixes this
  11. vi /etc/defaultrouter
  12. Reboot zone and test
  13. If you're changing the hostname, you'll have to do a sys-unconfigure and don't forget to update:
    1. /etc/hosts
    2. /etc/nsswitch.conf
    3. /etc/samba/smb.conf
    4. /etc/hostname.net0
    5. and you'll probably have to do a final reboot.

----
*Example zone1.cfg
create -b
set brand=solaris10
set zonepath=/zone/roots/zone1
set autoboot=false
set bootargs=”-m verbose”
set ip-type=exclusive
add fs
set dir=/export/home
set special=/zone/zone1/home
set type=lofs
end
add fs
set dir=/oracle
set special=/zone/zone1/oracle
add anet
set linkname=net0
set lower-link=aggr0
set allowed-address=192.12.23.52/24
set configure-allowed-address=true
set defrouter=192.12.23.1
set link-protection=mac-nospoof
set mac-address=random
end
add capped-memory
set physical=2G
end
----

No comments:

Post a Comment

Note: only a member of this blog may post a comment.