$ whatis zoneadm
zoneadm - zoneadm allows us to administrate a Solaris zone/container.
#hostname MySolaris I run the command below to a list of the available current zones. # zoneadm list global zone2 zone1 I run the command below to find out if the zones are up and running and get status of them. # zoneadm list -p 0:global:running:/::native:shared 1:zone2:running:/opt/zones/zone2:1557face-6fd5-41d9-ff20-835877ea02ed:native:shared 2:zone1:running:/opt/zones/zone1:aa65984e-f6fc-c87f-e393-8510db9db92c:native:shared # zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 zone2 running /opt/zones/zone2 native shared 2 zone1 running /opt/zones/zone1 native shared I am planning to create a new zone so I make sure I have a new IP address assign to the new zone "zone3" in DNS records. # nslookup zone3 Server: 192.168.1.9 Address: 192.168.1.9#53 Name: zone3.OurUNIX.com Address: 192.168.1.217 I want to see the current interfaces and whether or not the new zone3 IP address is configured yet, which should not be the case until I create the zone. # ifconfig -a lo0: flags=2001000849mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 lo0:1: flags=2001000849 mtu 8232 index 1 zone zone1 inet 127.0.0.1 netmask ff000000 lo0:2: flags=2001000849 mtu 8232 index 1 zone zone2 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843 mtu 1500 index 2 inet 192.168.1.141 netmask ffffff00 broadcast 128.149.134.255 groupname ipmp0 ether 0:22:12:a5:7a:2b e1000g0:1: flags=1000843 mtu 1500 index 2 inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255 e1000g0:2: flags=1000843 mtu 1500 index 2 zone zone1 inet 192.168.1.161 netmask ffffff00 broadcast 128.149.134.255 e1000g0:3: flags=1000843 mtu 1500 index 2 zone zone2 inet 192.168.1.162 netmask ffffff00 broadcast 128.149.134.255 e1000g1: flags=69000842 mtu 0 index 3 inet 0.0.0.0 netmask 0 groupname ipmp0 ether 0:22:21:a3:6c:2a To create a new zone "zone3" I run the command below: # zonecfg -z zone3 zone3: No such zone configured Use 'create' to begin configuring a new zone. I run the command "create -b" to create the zone. zonecfg:zone3> create -b I run the command infor to get the information. zonecfg:zone3> info zonename: zone3 zonepath: brand: native autoboot: false bootargs: pool: limitpriv: scheduling-class: ip-type: shared hostid: I need to setup the below properties with their values so that I could continue with the rest of the zone configuration. autoboot=true means if the zone gets rebo zonecfg:zone3> set autoboot=true zonecfg:zone3> set zonepath=/opt/zones/zone3zone3 zonecfg:zone3> add net zonecfg:zone3:net> set physical=e1000g0 zonecfg:zone3:net> seett address=192.168.1.217 zonecfg:zone3:net> end I verify that the commands I used worked without any issues. zonecfg:zone3> verify I run the info command one more time to get information that I provided was recorded properly. zonecfg:zone3> info zonename: zone3 zonepath: /opt/zones/zone3 brand: native autoboot: true bootargs: pool: limitpriv: scheduling-class: ip-type: shared hostid: net: address: 192.168.1.217 physical: e1000g0 defrouter not specified I commit my changes to make sure I don't lose any configuration I just made. zonecfg:zone3> commit I verfiy again and then exit out of the cfgadm command. zonecfg:zone3> verify zonecfg:zone3> exit I can also verify it using the command zoneadm command. # zoneadm -z zone3 verify WARNING: /opt/zones/zone3 does not exist, so it could not be verified. When 'zoneadm install' is run, 'install' will try to create /opt/zones/zone3, and 'verify' will be tried again, but the 'verify' may fail if: the parent directory of /opt/zones/zone3 is group- or other-writable or /opt/zones/zone3 overlaps with any other installed zones. I run the below command to install the new created or configured zone. # zoneadm -z zone3 install Preparing to install zone . Creating list of files to copy from the global zone. Copying <139363> files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize <1120> packages on the zone. Initializing package <0> of <1120>: percent complete: 0% Initializing package <1> of <1120>: percent complete: 0% Initializing package <2> of <1120>: percent complete: 0% Initializing package <3> of <1120>: percent complete: 0% Initializing package <4> of <1120>: percent complete: 0% Initializing package <5> of <1120>: percent complete: 0% Initializing package <6> of <1120>: percent complete: 0% Initializing package <7> of <1120>: percent complete: 0% Initializing package <8> of <1120>: percent complete: 0% Initializing package <9> of <1120>: percent complete: 0% Initializing package <10> of <1120>: percent complete: 0% Initializing package <11> of <1120>: percent complete: 0% Initializing package <12> of <1120>: percent complete: 1% Initializing package <13> of <1120>: percent complete: 1% Initializing package <14> of <1120>: percent complete: 1% Initializing package <15> of <1120>: percent complete: 1% It goes on and on until it completes 100%, you just have to give it time, go for lunch, et a green tea beak etc. The file contains a log of the zone installation. Now I verify again and then list the new directory structures and XML files created as well as the index file that got updated. # zoneadm -z zone3 verify # ls -l /etc/zones total 14 -r--r--r-- 1 root bin 392 Aug 8 2007 SUNWblank.xml -r--r--r-- 1 root bin 562 Aug 8 2007 SUNWdefault.xml -r--r--r-- 1 root bin 777 Mar 11 2008 SUNWtsoldef.xml -rw-r--r-- 1 root sys 537 Sep 15 12:35 index -rw-r--r-- 1 root root 415 Aug 16 18:15 zone1.xml -rw-r--r-- 1 root root 415 May 12 11:18 zone2.xml -rw-r--r-- 1 root root 355 Sep 15 12:07 zone3.xml Now I see the contents of the updated index file which has the zone3 appended at the end of the previous zones information: # cat /etc/zones/index # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident"@(#)zones-index1.204/04/01 SMI" # # DO NOT EDIT: this file is automatically generated by zoneadm(1M) # and zonecfg(1M). Any manual changes will be lost. # global:installed:/ zone1:installed:/opt/zones/zone1:aa65984e-f6fc-c87f-e393-8510db9db92c zone2:installed:/opt/zones/zone2:1557face-6fd5-41d9-ff20-835877ea02ed zone3:installed:/opt/zones/zone3:a178b335-a32c-e79d-82b7-a08fd36eddf0 I see the contents of the file zone3.xml file. It is best to not modify these files manually and use the zonecfg command instead. # cat /etc/zones/zone3.xml Now, I make this zone3 ready for usage. # zoneadm -z zone3 ready # zoneadm -z ;o list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 zone2 running /opt/zones/zone2 native shared 2 zone1 running /opt/zones/zone1 native shared 3 zone3 ready /opt/zones/zone3 native shared As you can see from the above and blow "list -cv and list -vi" zone3 has a status of ready. # zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 zone2 running /opt/zones/zone2 native shared 2 zone1 running /opt/zones/zone1 native shared 3 zone3 ready /opt/zones/zone3 native shared Now, I boot the new created zone3 so I could use it. # zoneadm -z zone3 boot At this time the new zone is up and running so I could login to it for the first time. # zoneadm list vi -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 zone2 running /opt/zones/zone2 native shared 2 zone1 running /opt/zones/zone1 native shared 3 zone3 running /opt/zones/zone3 native shared I use the command zlogin to login to the console of this new zone/container and configure it for ssh connection and updated the root passwd. # zlogin -C -e \@ zone3 [Connected to zone 'zone3' console] 89/152 90/152 91/152 92/152 93/152 94/152 95/152 96/152 97/152 98/152 99/152100/152101/152102/152103/152104/152105/152106/152107/152108/152109/152110/152111/152112/152113/152114/152115/152116/152117/152118/152119/152120/152121/152122/152123/152124/152125/152126/152127/152128/152129/152130/152131/152132/152133/152134/152135/152136/152137/152138/152139/152140/152141/152142/152143/152144/152145/152146/152147/152148/152149/152150/152151/152152/152 Reading ZFS config: *done. What type of terminal are you using? 1) ANSI Standard CRT 2) DEC VT52 3) DEC VT100 4) Heathkit 19 5) Lear Siegler ADM31 6) PC Console 7) Sun Command Tool 8) Sun Workstation 9) Televideo 910 10) Televideo 925 11) Wyse Model 50 12) X Terminal Emulator (xterms) 13) CDE Terminal Emulator (dtterm) 14) Other Type the number of your choice and press Return: 3 Creating new rsa public/private host key pair Creating new dsa public/private host key pair Configuring network interface addresses: e1000g0. qHost Name for e1000g0:4 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Enter the host name which identifies this system on the network. The name must be unique within your domain; creating a duplicate host name will cause problems on the network after you install Solaris. A host name must have at least one character; it can contain letters, digits, and minus signs (-). Host name for e1000g0:4 zone3 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq F2_Continue F6_Helpzone3 zone3 > Press F2 to go to the next screen. F2_Continue F6_Help Esc-2_Continue Esc-6_Helpzone3 qConfirm Information for e1000g0:4 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq > Confirm the following information. If it is correct, press F2; to change any information, press F4. Host name: zone3qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-4_Change Esc-6_Help Esc-2_Continue Esc-4_Change Esc-6_Help Just a moment... qConfigure Security Policy: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Specify Yes if the system will use the Kerberos security mechanism. Specify No if this system will use standard UNIX security. Configure Kerberos Security qqqqqqqqqqqqqqqqqqqqqqqqqqq [ ] Yes [X]Noqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Help Esc-2_Continue Esc-6_HelpqConfirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq > Confirm the following information. If it is correct, press F2; to change any information, press F4. Configure Kerberos Security: Noqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-4_Change Esc-6_Help Esc-2_Continue Esc-4_Change Esc-6_Help Please wait... qName Service qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq On this screen you must provide name service information. Select the name service that will be used by this system, or None if your system will either not use a name service at all, or if it will use a name service not listed here. > To make a selection, use the arrow keys to highlight the option and press Return to mark it [X]. Name service qqqqqqqqqqqq [ ]NIS+ [ ] NIS [x] DNS [ ] LDAP [ ] None qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Help[X] ] ] ] X Esc-2_Continue Esc-6_HelpqDomain Name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq On this screen you must specify the domain where this system resides. Make sure you enter the name correctly including capitalization and punctuation. Domain name:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Helpame: OurUNIX.com Esc-2_Continue Esc-6_HelpOurUNIX.com q DNS Server Addresses qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq On this screen you must enter the IP address of your DNS server(s). You must enter at least one address. IP addresses must contain four sets of numbers separated by periods (for example 129.200.9.1). Server's IP address: Server's IP address: Server's IP address:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Helpess: 192.168.1.20 Esc-2_Continue Esc-6_Helpess: 192.168.1.1.21 Esc-2_Continue Esc-6_Helpess: Esc-2_Continue Esc-6_Helpess: qDNS Search Listqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq On this screen you can enter a list of domains that will be searched when a DNS query is made. If you do not enter any domains, DNS will only search the DNS domain chosen for this system. The domains entered, when concatenated, may not be longer than 250 characters. Search domain: Search domain: Search domain: Search domain: Search domain: Search domain:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Helpain: OurUNIX.com Esc-2_Continue Esc-6_HelpOurUNIX.com qConfirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq > Confirm the following information. If it is correct, press F2; to change any information, press F4. Name service: DNS Domain name: OurUNIX.com Server address(es): 192.168.1.9 192.168.1.19 Search domain(s): OurUNIX.comqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-4_Change Esc-6_Help Esc-2_Continue Esc-4_Change Esc-6_Help Just a moment... qNFSv4 Domain Name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq NFS version 4 uses a domain name that is automatically derived from the system's naming services. The derived domain name is sufficient for most configurations. In a few cases, mounts that cross domain boundaries might cause files to appear to be owned by "nobody" due to the lack of a common domain name. The current NFSv4 default domain is: "OurUNIX.com" NFSv4 Domain Configuration qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq [X]Use the NFSv4 domain derived by the system [ ] Specify a different NFSv4 domainqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Help Esc-2_Continue Esc-6_HelpqConfirm Information for NFSv4 Domain qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq > Confirm the following information. If it is correct, press F2; to change any information, press F4. NFSv4 Domain Name: << Value to be derived dynamically >>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-4_Change Esc-6_Help Esc-2_Continue Esc-4_Change Esc-6_HelpqTime Zone qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq On this screen you must specify your default time zone. You can specify a time zone in three ways: select one of the continents or oceans from the list, select other - offset from GMT, or other - specify time zone file. > To make a selection, use the arrow keys to highlight the option and press Return to mark it [X]. Continents and Oceans qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq - [ ]Africa x[X] Americas x[ ] Antarctica x[ ] Arctic Ocean x[ ] Asia x[ ] Atlantic Ocean x[ ] Australia x[ ] Europe v [ ] Indian Ocean qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Help[ ] ]X Esc-2_Continue Esc-6_HelpqCountry or Region qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq > To make a selection, use the arrow keys to highlight the option and press Return to mark it [X]. Countries and Regions qqqqqqqqqqqqqqqqqqqqqqqqqqq - [x] United States x[ ] Anguilla x[ ] Antigua & Barbuda x[ ] Argentina x[ ] Aruba x[ ] Bahamas x[ ] Barbados x[ ] Belize x[ ] Bolivia x[ ] Brazil x[ ] Canada x[ ] Cayman Islands v [ ] Chile qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Help[ ] ] ] ][X Esc-2_Continue Esc-6_HelpqTime Zone qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq > To make a selection, use the arrow keys to highlight the option and press Return to mark it [X]. Time zones qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq - [ ]Eastern Time x[ ] Eastern Time - Michigan - most locations x[ ] Eastern Time - Kentucky - Louisville area x[ ] Eastern Time - Kentucky - Wayne County x[ ] Eastern Time - Indiana - most locations x[ ] Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties x[ ] Eastern Time - Indiana - Pulaski County x[ ] Eastern Time - Indiana - Crawford County x[ ] Eastern Time - Indiana - Pike County x[ ] Eastern Time - Indiana - Switzerland County x[ ] Central Time x[ ] Central Time - Indiana - Perry County v [ ] Central Time - Indiana - Starke County qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Help[ ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ][ ] ][X Esc-2_Continue Esc-6_HelpqConfirm Information qqqqqqqqqqqqqqqqqqqqqqqq > Confirm the following information. If it is correct, press F2; to change any information, press F4. Time zone: Pacific Time (US/Pacific)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Esc-2_Continue Esc-4_Change Esc-6_Help Esc-2_Continue Esc-4_Change Esc-6_Help Please wait... qRoot Password qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Please enter the root password for this system. The root password may contain alphanumeric and special characters. For security, the password will not be displayed on the screen as you type it. > If you do not want a root password, leave both entries blank. Root password: Root password:qqqqqqqqqqqqqqqqq Esc-2_Continue Esc-6_Helprd: **************** Esc-2_Continue Esc-6_Helprd: **************** ******** > Press F2 to go to the next screen. Esc-2_Continue Esc-6_Help Esc-2_Continue Esc-6_Help******** rebooting system due to change(s) in /etc/default/init [NOTICE: Zone rebooting] SunOS Release 5.10 Version Generic_144488-12 64-bit Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. Hostname: zone3 Reading ZFS config: *done. zone3 console login: [Connection to zone 'zone3' console closed] I login to the zone3 using zlogin command. # zlogin -C -e \@ zone3 [Connected to zone 'zone3' console] zone3 console login: root Password: Sep 15 15:27:03 zone3 login: ROOT LOGIN /dev/console Sun Microsystems Inc. SunOS 5.10 Generic January 2005 I am inside the zone and can verify that using some of the examples below: # hostname zone3 # zoneadm list zone3 # uname -a SunOS zone3 5.10 Generic_144488-12 sun4v sparc SUNW,SPARC-Enterprise-T5120 # pwd / # df -h Filesystem size used avail capacity Mounted on / 94G 16G 77G 18% / /dev 94G 16G 77G 18% /dev proc 0K 0K 0K 0% /proc ctfs 0K 0K 0K 0% /system/contract mnttab 0K 0K 0K 0% /etc/mnttab objfs 0K 0K 0K 0% /system/object swap 69G 360K 69G 1% /etc/svc/volatile /platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr/libc_psr_hwcap2.so.1 94G 16G 77G 18% /platform/sun4v/lib/libc_psr.so.1 /platform/SUNW,SPARC-Enterprise-T5120/lib/sparcv9/libc_psr/libc_psr_hwcap2.so.1 94G 16G 77G 18% /platform/sun4v/lib/sparcv9/libc_psr.so.1 fd 0K 0K 0K 0% /dev/fd swap 69G 32K 69G 1% /tmp swap 69G 48K 69G 1% /var/run # ssh -l developer1 zone3 The authenticity of host 'zone3 (192.168.1.217)' can't be established. RSA key fingerprint is 0d:1f:62:eb:19:30:5e:13:17:42:02:e9:ef:46:51:15. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'zone3,192.168.1.217' (RSA) to the list of known hosts. Password: Last login: Thu Sep 15 15:43:15 2011 from zone3 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 -bash-3.2$ pwd /home/developer1 -bash-3.2$ id uid=21467(developer1) gid=50 -bash-3.2$ hostname zone3 -bash-3.2$ df -h Filesystem size used avail capacity Mounted on / 94G 16G 77G 18% / /dev 94G 16G 77G 18% /dev proc 0K 0K 0K 0% /proc ctfs 0K 0K 0K 0% /system/contract mnttab 0K 0K 0K 0% /etc/mnttab objfs 0K 0K 0K 0% /system/object swap 70G 368K 70G 1% /etc/svc/volatile /platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr/libc_psr_hwcap2.so.1 94G 16G 77G 18% /platform/sun4v/lib/libc_psr.so.1 /platform/SUNW,SPARC-Enterprise-T5120/lib/sparcv9/libc_psr/libc_psr_hwcap2.so.1 94G 16G 77G 18% /platform/sun4v/lib/sparcv9/libc_psr.so.1 fd 0K 0K 0K 0% /dev/fd swap 70G 56K 70G 1% /tmp swap 70G 48K 70G 1% /var/run # zoneadm list zone3
Please click on " man zoneadm. " to see the Manual Page for this command.