Solaris: Steps to install a zone

Prerequisites to configuration

  1. create a directory for the root of your non-global zone, mkdir /export/zones/dzone1.
    chown root:root /export/zones/dzone1; chmod 700 /export/zones/dzone1
  2. create a 1G partition for the non-global zone root file system
  3. add filesystems to any volumes you have created from steps above
  4. mount your additional space for the root of your new zone (add to vfstab in global zone 0)

Zoneconfig

  1. zonecfg –z dzone1
  2. create
  3. set zonepath=/dzone1
  4. set autoboot=true
  5. add inherit-pkg-dir
  6. set dir=/opt
  7. end
  8. add net
  9. set address=[IP-ADDRESS]
  10. set physical=hme0
  11. end
  12. (could add a device here, but don’t believe it necessary for right now, we’ll see what we get by default)
  13. add rctl
  14. set name=zone.cpu-shares
  15. add value (priv=privileged,limit=20,action=none)
  16. end
  17. add attr
  18. set name=comment
  19. set type=string
  20. set value=”First test zone”
  21. end
  22. verify
  23. commit
  24. exit

    Zoneadm

    1. zoneadm –z dzone1 verify
    2. zoneadm –z dzone1 install
      1. if you get an error message during install check the state
      2. zoneadm –z dzone1 list –v
      3. if state is “configured” make corrections specified in the messateg and install the zone again
      4. if state is “incomplete” remove the zone
      5. zoneadm –z dzone1 uninstall
      6. make corrections and install the zone again
    3. style=”MARGIN-TOP: 0in” type=a>
    4. should report the zone is “installed”
  1. y
  2. zoneadm list –v

    1. should report the zone is “ready”
  3. –z dzone1 boot
  4. zoneadm list –v

    1. should report the zone is “running”

2 style=”MARGIN: 12pt 0in 3pt”>font>

  1. zlogin –C dzone1
    1. hit return
    2. select 3 DEC VT100
    3. enter hostname for the zone
    4. hit esc-2 to continue
    5. hit esc-2 to continue
    6. be sure NO is checked for kerberos security
    7. hit esc-2 to continue
    8. hit esc-2 to continue
    9. select DNS for name service
    10. esc-2 to continue
    11. enter abcd.com for domain
    12. esc-2 to continue
    13. enter [IP-ADDRESS] for the first IP
    14. enter [IP-ADDRESS] for the second IP
    15. esc-2 to continue
    16. enter abcd.com for search domain
    17. esc-2 to cont
    18. confirm information
    19. esc-2 to cont
    20. choose NO for new name service information
    21. esc-2 to cont
    22. select americas for time zone
    23. esc-2 to cont
    24. select united states
    25. esc-2
    26. select central time
    27. esc-2
    28. confirm information
    29. esc-2
    30. enter root password
    31. esc-2 to continue
    32. zone should reboot

  2. style=”MARGIN: 0in 0in 0pt; mso-list: l11 level1 lfo3; tab-stops: list .5in”>to disconnect from the console use “~.”

MARGIN: 12pt 0in 3pt”>Additional zonecfg

  1. following zone initialization to add additional filesystem resources and resource controls follow the following instructions
  2. create the directories in the zone you are going to modify
  3. zonecfg –z dzone2
  4. add fs
  5. set dir=/export/home
  6. set special=/dev/md/dsk/d51
  7. set raw=/dev/md/rdsk/d51
  8. set type=ufs
  9. set options=logging
  10. end
  11. verify
  12. commit
  13. exit
  14. bounce the zone

12pt 0in 3pt”>Login

  1. zlogin –C zone
  2. zlogin –l c1196 zone

Arial>Commands

  1. ps with –Z
  2. ipcs, pgrep, ptree, prstat with –z zonename option

Arial>Halt/Shutdown

  1. zoneadm –z myzone halt
     

face=Arial>Boot

  1. zoneadm –z myzone boot

face=Arial>Reboot

  1. zoneadm –z myzone reboot

face=Arial>Grow FileSystem

  1. from the global machine
  2. growfs –M /zoneroot/root/filesystem /dev/md/rdsk/device

Arial>updating resources on the fly for a zone

  1. must run the following command from the global zone
    1. prctl –n zone.cpu-shares –v <value> -r –i zone <zone number>

h2 style=”MARGIN: 12pt 0in 3pt”>=Arial>Notes

  1. You can install apps either at a global or non-global level.  Caveat, user’s will be unable to install packages to /usr/local at a non-global level unless we create /usr/local as a filesystem to mount. 
    But then, we must effectively cover anything in the global /usr/local.  Just be aware.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.