Tuesday, October 20, 2009

Zone Administration - Simple Steps

Prerequisites to configuration:

1. create a directory for the root of your non-global zone, mkdir /export/zones/mmvzone1.
    chown root:root /export/zones/mmvzone1; chmod 700 /export/zones/mmvzone1
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 mmvzone 1
  2. create
  3. set zonepath=/mmvzone1
  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 mmvzone1 verify
2. zoneadm –z mmvzone1 install
     a. if you get an error message during install check the state
     b. zoneadm –z mmvzone1 list –v
     c. if state is “configured” make corrections specified in the messateg and install the zone again
     d. if state is “incomplete” remove the zone
     e. zoneadm –z mmvzone uninstall
     f. make corrections and install the zone again
3. zoneadm list –iv
      a. should report the zone is “installed”
4. zoneadm –z mmvzone1 ready
5. zoneadm list –v
      a. should report the zone is “ready”
6. zoneadm –z mmvzone1 boot
7. zoneadm list –v
      a. should report the zone is “running”

zlogin

8. zlogin –C mmvzone1
     a. hit return
     b. select 3 DEC VT100
     c. enter hostname for the zone
     d. hit esc-2 to continue
     e. hit esc-2 to continue
     f. be sure NO is checked for kerberos security
     g. hit esc-2 to continue
     h. hit esc-2 to continue
     i. select DNS for name service
     j. esc-2 to continue
     k.enter abcd.com for domain
     l. esc-2 to continue
     m. enter [IP-ADDRESS] for the first IP
     n. enter [IP-ADDRESS] for the second IP
     o. esc-2 to continue
     p. enter abcd.com for search domain
     q. esc-2 to cont
     r. confirm information
     s. esc-2 to cont
     t. choose NO for new name service information
     u. esc-2 to cont
     v. select americas for time zone
     w. esc-2 to cont
     x. select united states
     y. esc-2
     z. select central time
     aa. esc-2
     bb. confirm information
     cc. esc-2
     dd. enter root password
     ee. esc-2 to continue
      ff. zone should reboot
9. if a mistake is made you can zlogin –S mmvzone1 /usr/sbin/sys-unconfig (allows you to re-run the sysidcfg stage and correct and problems)
10. to disconnect from the console use “~.”

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 mmvzone2
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

Login

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

Commands

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

Halt/Shutdown

zoneadm –z mmvzone1 halt

Boot

zoneadm –z mmvzone1 boot

Reboot

zoneadm –z mmvzone1reboot

Grow FileSystem

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

updating resources on the fly for a zone

must run the following command from the global zone
   prctl –n zone.cpu-shares –v -r –i zone

No comments: