This section describes how to create a Solaris zone.
Note
If you use a virtual interface of the redundant line control function in a Solaris zone, be sure to check that the environment setting of the redundant line control function is completed on the global zone and that the virtual interface is enabled. For information on how to set up the environment of the redundant line control function, see "3.3 Additional system setup".
(1) Create a zone
The following example shows how to create a zone. Note that the zone name is "zone0", the IP address for the shared-IP zone is 192.168.10.100", and the interface name used by the zone is "sha0".
# zonecfg -z zone0 zone0: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zone0> create zonecfg:zone0> set zonepath=/zones/zone0 <- Specify a root path of the zone. zonecfg:zone0> add net <- Set up a network interface zonecfg:zone0:net> set address=192.168.10.100/24 zonecfg:zone0:net> set physical=sha0 <- Specify a virtual interface for fast switching mode. zonecfg:zone0:net> end zonecfg:zone0> export <- Check the setting. create -b set zonepath=/zones/zone0 set autoboot=false add inherit-pkg-dir set dir=/lib end add inherit-pkg-dir set dir=/platform end add inherit-pkg-dir set dir=/sbin end add inherit-pkg-dir set dir=/usr end add net set address=192.168.10.100/24 set physical=sha0 end zonecfg:zone0> verify <- Check integrity. zonecfg:zone0> commit <- Register a zone. zonecfg:zone0> exit <- Zone setting is completed. # zoneadm list -vc <- Check if the zone is properly registered. ID NAME STATUS PATH 0 global running / - zone0 configured /zones/zone0 |
Note
When setting Redundant Line Control function in an exclusive-IP zone, be sure to set the following and create the zone configuration as a whole root zone.
zonecfg:zone0> remove inherit-pkg-dir dir=/lib zonecfg:zone0> remove inherit-pkg-dir dir=/platform zonecfg:zone0> remove inherit-pkg-dir dir=/sbin zonecfg:zone0> remove inherit-pkg-dir dir=/usr |
When configuring an exclusive-IP zone, add network interfaces for redundancy after setting the following using the zonecfg command. In this case, setting IP addresses using the zonecfg command is not necessary. After startup of the zone, log in the zone and set up IP addresses.
zonecfg:zone0> set ip-type=exclusive |
When sereval zones connect to the same network, set the configuration avoiding duplication of MAC addresses.
Note
Note the following points when configuring the network interface of a shared-IP zone.
Virtual interface name
For fast switching mode, specify "shaX" for the virtual interface name.
For NIC switching mode, specify a primary interface name of the redundant physical interface, such as "hmeX". "shaX" for the virtual interface name is not allowed to use.
In addition, specify the same network address as that of the physical interface for the IP address.
For GS/SURE linkage mode, the communication is conducted by allocating a logical virtual interface to zones with the ifconfig command. Do not set the network interface with the zonecfg command.
For starting zones automatically when the system is started, create the script for service of the redundant line control function of the user command execution function (/etc/opt/FJSVhanet/script/init.sh) and allocate IP to zones. The following is an example of the script.
#!/bin/sh /usr/sbin/ifconfig sha0:2 zone zone0 exit 0 |
Default Gateway settings
In NIC switching mode, if a default gateway is set via the zonecfg command, the settings will be deleted when NIC switching occurs. Note that you must set up a default gateway on the global zone.
(2) Install the zone
You can install a zone using the following steps;
# zoneadm -z zone0 install Preparing to install zone <zone0>. Creating list of files to copy from the global zone. Copying <3370> files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize <1150> packages on the zone. Initializing package <40> of <1150>: percent complete: 3% . . . . . . . . Initialized <1150> packages on zone. Zone <zone0> is initialized. Installation of <2> packages was skipped. Installation of these packages generated warnings: <SUNWvtsr> The file </zones/zone0/root/var/sadm/system/logs/install_log> contains a log of the zone installation. # zoneadm list -vc <- Check if the zone is installed properly. ID NAME STATUS PATH 0 global running / - zone0 installed /zones/zone0 |
Note
When a zone is booted for the first time after installation, the zone is in an unconfigured state. Therefore, it is necessary to define an internal zone configuration. Please refer to the manual of Solaris for the definition methods.
(3) Start the zone
Start the zone using the following steps. Before starting it, be sure to check the virtual interface is activated. If it is not activated, you cannot start the zone.
# /opt/FJSVhanet/usr/sbin/dsphanet [IPv4,Patrol] Name Status Mode CL Device +----------+--------+----+----+------------------------------------------------+ sha0 Active t OFF hme0(ON),hme1(ON) <- Check the status. [IPv6] Name Status Mode CL Device +----------+--------+----+----+------------------------------------------------+ # # zoneadm -z zone0 boot <- Start the zone. # zoneadm list -vc ID NAME STATUS PATH 0 global running / 1 zone0 running /zones/zone0 <- Check if the zone is started properly. |
(4) Log in to the zone
You can log in to the zone using the following steps:
# zlogin -l root zone0
[Connected to zone 'zone0' pts/4]
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# |
(5) Check the interface state
If you check the interface state on the zone, it will be displayed as follows:
# ifconfig -a lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 sha0:1: flags=1000843<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,IPv4> mtu 1500 index 5 inet 192.168.10.100 netmask ffffff00 broadcast 192.168.10.255 |
(6) Log out of the zone
You can log out of the zone using the following steps:
# exit
[Connection to zone 'zone0' pts/4 closed] |
(7) Stop the zone
You can stop the zone using the following steps:
# zoneadm -z zone0 halt |
(8) Change the network setting
You can change the network setting using the following steps. In the following example, you are supposed to select the resource that is set "192.168.10.100" for the IP address, then change the interface name to "zone0", and the IP address to "192.168.20.123".
# zonecfg -z zone0 zonecfg:zone0> select net address=192.168.10.100 <- Select the resource. zonecfg:zone0:net> set physical=hme0 <- Change the interface zonecfg:zone0:net> set address=192.168.20.123 <- Change the IP address zonecfg:zone0:net> end zonecfg:zone0> export create -b set zonepath=/zones/zone0 set autoboot=false add inherit-pkg-dir set dir=/lib end add inherit-pkg-dir set dir=/platform end add inherit-pkg-dir set dir=/sbin end add inherit-pkg-dir set dir=/usr end add net set address=192.168.20.123 <- IP address changed set physical=hme0 <- Interface name changed end zonecfg:zone0> verify zonecfg:zone0> commit zonecfg:zone0> exit |
(9) Uninstall the zone
You can uninstall the zone using the following steps:
# zoneadm -z zone0 uninstall -F # zoneadm list -vc ID NAME STATUS PATH 0 global running / - zone0 configured /zones/zone0 |
(10) Delete the zone
You can delete the zone using the following steps:
# zonecfg -z zone0 delete -F # zoneadm list -vc ID NAME STATUS PATH 0 global running / |
See
For further details, see the "Solaris 10 OS" manual.