May 21, 2014

solaris 11.1 copying zones between machines

I have zone all built up the way I like and I want more zones like it both on the same server and others.

The built zone is ZONENAME on the server SERVER, and it's in the installed state.

1st I did some local copies, using a sc_profile.xml file for each zone, the file must be called sc_profile.xml, and you must use a full pathname to it. Below is without a zone cfg, notes also do a with zone cfg, even better, don't forget to change IP, (maybe gateway) (maybe link name) & hostname in new sc_profile.xml

cp sc_profile.xml-NEW-LOCAL-ZONE sc_profile.xml
zonecfg -z NEW-LOCAL-ZONE "create -t ZONENAME"
zonecfg -z NEW-LOCAL-ZONE "set zonepath=/zones/NEW-LOCAL-ZONE "
zonecfg -z NEW-LOCAL-ZONE "select net physical=net2; set physical=net8;end"
zonecfg -z NEW-LOCAL-ZONE "select net physical=net3; set physical=net9;end"
zoneadm -z NEW-LOCAL-ZONE clone -c /opt/site/sc_profile.xml ZONENAME
zoneadm -z NEW-LOCAL-ZONE boot

Then sort out networking and check services.

Next use the same zone to build zones on other machines:

zfs snapshot -r rpool/zones/ZONENAME@archive
zfs send -rc rpool/zones/ZONENAME@archive |bzip2 >/var/tmp/ZONENAME.zfs.bz2
scp /var/tmp/ZONENAME.zfs.bz2 MYLOGIN@NEW-MACHINE:/var/tmp
scp sc_profile.xml MYLOGIN@NEW-MACHINE:/var/tmp

On new machine NEW-MACHINE:
copy & edit sc_profile.xml and zone cfg file, zoneadm also wants the full pathname to the archive

zonecfg -z NEW-ZONE -f NEW-ZONE.cfg
zoneadm -z NEW-ZONE install -a /var/tmp/ZONENAME.zfs.bz2 -u -c /var/tmp/sc_profile.xml
zoneadm -z NEW-ZONE boot
zlogin -C NEW-ZONE

Then sort out networking and check services.

- No comments Not publicly viewable

Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

May 2014

Mo Tu We Th Fr Sa Su
Apr |  Today  | Jun
         1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Search this blog



Most recent comments

  • hello. i am from poland. i uwielbiam was! by on this entry
  • Hello, It was more for internal consumption, I will check it over and send you a version, can you em… by Maria MacCallum on this entry
  • Hello Maria, i don't see the script setup–, can you post it ? I'am looking too for an example… by FRANCISCO on this entry
  • Solaris 11.2 returns the value of SI_MEMSIZE in Mb's now by Maria MacCallum on this entry

Blog archive

Not signed in
Sign in

Powered by BlogBuilder