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

por | 13 agosto, 2016

http://solaris11adventures.blogspot.mx/2013/05/migrating-solaris-10-zone-to-solaris-10.html

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:

zoneadm -z zone1 ready
cd /zone/path
find root -print | cpio -oP@ | gzip >/dumps/zone1.cpio.gz
zonecfg -z zone1 export -f /dumps/zone1.cfg
Copy config and dump across to new global zone
zfs send and recv any extra filesystems across to new global zone

On new (Solaris 11) global zone

Notes:
I create a zpool with the name “zone”where all my zones data will sit on
I create a zfs filesystem zone/roots where all the zone paths will be in
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
vi zone1.cfg*
Change IP if needed
Correct attached filesystems path if needed
Set brand=Solaris10
Set ip-type=exclusive
Change from net to anet
zonecfg -z zone1 -f zone1.cfg
zoneadm -z zone1 attach -a /dump/zone1.cpio.gz
Make sure the NIC gets configured on boot – fixes this
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
vi /zone/path/zone1/root/etc/hostname.net0
zone1 netmask 255.255.255.0 up
Change root’s home from /export/home/root to /root – might not be needed in your environment
vi /zone/path/zone1/root/etc/passwd
mv /zone/zone1/home/root /zone/roots/zone1/root/
If IP is to change, vi /zone/roots/zone1/root/etc/hosts
Boot zone1 and zlogin
ifconfig plumb net0
vi /etc/default/nfs and change: LOCKD_SERVERS=1024 – fixes this
vi /etc/defaultrouter
Reboot zone and test
If you’re changing the hostname, you’ll have to do a sys-unconfigure and don’t forget to update:
/etc/hosts
/etc/nsswitch.conf
/etc/samba/smb.conf
/etc/hostname.net0
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
—-