- Create a root directory for zones with rwx permission for user.
- mkdir /zones1
- chmod 700 /zones1
- Create a zone configuration file as under:
- create
- set zonepath=/zones1
- set autoboot=true
- Add network (exclusive IP or default shared IP):
If you are setting up exclusive IP: (do not set address attribute for exclusive IP)
set ip-type=exclusive
add net
set physical=e1000g2
end
Additional info about exclsive IP setup:
http://download.oracle.com/docs/cd/E19082-01/819-6990/gicom/index.html
- Setting default shared IP
If you are setting default shared IPadd net
set physical=e1000g2
set address=<ip address of container>
end
To add raw devices to the containers configuration
add device
set match=/dev/rdsk/c6t20030003BACCC902*
end
add device
set match=/dev/rdsk/c6t20030003BACCC8FA*
end
On Solaris 11:
zonecfg:rac4Zone> add device
zonecfg:rac4Zone:device> set match=/dev/rdsk/c1t0d0s0
zonecfg:rac4Zone:device> set allow-partition=true
zonecfg:rac4Zone:device> set allow-raw-io=true
zonecfg:rac4Zone:device> end
To add fs refer to
- http://docs.oracle.com/cd/E23824_01/html/821-1460/z.admin.task-11.html
To mount a global directory as lofs to container
zonecfg -z zones1
add fs
set dir=/oracle11gR2
set special=/oracle11gR2
set type=lofs
set options=nodevices
end
global# zonecfg -z myzone
zonecfg:myzone> set max-shm-memory=50G
Adding dedicated -cpu is a simpler form of creating a pool and attaching it to the container. Add dedicated-cpu command creates a temporary pool and assigns it to the container
add dedicated-cpu
set ncpus=32
end
To remove the dedicated-cpu, issue the following command
remove dedicated-cpu
- Add resource pool
- Remove pool
- On Solaris 11
- On Solaris 10 Update 3 and below
- Steps to create and configure a container
- Invoke zonecfg command to configure the zone
- zonecfg -z zones1 -f test.cfg
- Install the configured zone
- zoneadm -z zones1 install
- Use the list subcommand of zoneadm to list the installed zones and verify their status. The status of the zone is "Installed"
- zoneadm list -iv
- Boot the zone
- zoneadm -z zones1 boot
- Verify that status of the zone is "running"
- zoneadm list -v
- Log in to Zone console to perform the internal zone configuration
- zlogin -C zone1
- Optionally edit /etc/sysidcfg file to perfom the inital zone configuration
- Go to /etc/ directory of the local zone
- cd /export/home/zones/root/etc
- Create sysidcfg file in this directory
- Steps to delete a container
- zoneadm -z myzone halt
- zoneadm -z myzone uninstall
- zonecfg -z myzone delete -F
- List a container and info about it
- List all zones from global zone
- Login to local zone from global zone:
- In the zone , issue zonename to print its name
- Get info about the zone
- To verify if /dev/rdsk/c6 is accessible in local container
- ls /my_zone/root/dev/rdsk/.....
- Initial zone configuration
- Hostname and ip address:
- The hostname can be resolved through DNS or NIS
- Verify if it is resolved through DNS
- Verify if it resolves through NIS
- ypcat hosts | grep isve-111-212
- If hostname is resolved through dns /etc/nsswitch.conf should have the following
- else it should be as under:
- netmask: /etc/inet/netmasks
- Router IP : /etc/defaultrouter
- Dominname : exec domainname command
- Name service : Check /etc/nsswitch.conf to confirm it is NIS
- Name server: output of ypwhich command
- Ip addres of name server : ping -s <nameserver>
- DNS name server ip address from /etc/resolv.conf
- Change net settings {removing address or physical attribute of the net will delete both network parameters
- zonecfg -z zone1 info
- remove net address=<value> {or remove net physical=<value>}
- add net
- set physical
- set address
- end
- Some changes need the zone to be rebooted to take effect
If you want to restart initial zone configuration
- zlogin -S zonename /usr/sbin/sys-unconfig
- or login to zones (zlogin zonename) , issue sys-unconfig and reboot
- On Solaris 11, you can configure using the following commnd
- /usr/sbin/sysconfig unconfigure
How to specify netmask in containers:
Why is zone booting command failing as under:
zoneadm -z zones2 boot
zoneadm: zone 'zones2': These file-systems are mounted on subdirectories of /zones2/root:
zoneadm: zone 'zones2': /zones2/root/var/sadm/install/.door
zoneadm: zone 'zones2': call to zoneadmd failed
You do not have the right zones patch installed..... Wait for 10 minutes and issue the command and it will work if you do not want to install the updated patches
If you see the following error, login in to the console to view the
SCI ....
root@unknown:~# sysconfig configure
This program will re-configure your system.
Do you want to continue (y/[n])? y
Interactive configuration requested.
System Configuration Interactive (SCI) tool will be launched on
console.
Since you are currently not logged on console,
you may not be able to navigate SCI tool.
Would you like to proceed with re-configuration (y/[n])? y