Sei sulla pagina 1di 3

ZONE TIPS

How to Remove a Non-Global Zone


1.

Shut down the zone myzone.

global#zloginmyzoneshutdown

2.

Remove the root file system for myzone.

global#zoneadmzmyzoneuninstallF

3.

Delete the configuration for myzone.

global#zonecfgzmyzonedeleteF

4.

List the zones on the system, to verify that myzone is no longer listed.

global#zoneadmlistiv

5.

You will see a display that is similar to the following:

IDNAMESTATUSPATHBRANDIP
0globalrunning/nativeshared

First create 2 new filesystems for your zone. One for its root area and one for its data area. You
can use the newfs command to do this once you determine which partitions are available for use.
For this example, we will use /dev/dsk/c0t1d0s0 and /dev/dsk/c0t1d0s3 for the root and data
areas respectively.
# newfs /dev/rdsk/c0t1d0s0
# newfs /dev/rdsk/c0t1d0s3
Next add an entry as follows for the root area in your vfstab:
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /export/zone1 ufs 1 yes -

Next mount the filesytem and ensure correct permissions:


# mkdir /export/zone1
# chown root:root /export
# mount /export/zone1
# chmod 700 /export/zone1
Now we can create the zone configuration.
# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/export/zone1
zonecfg:zone1> set autoboot=true
zonecfg:zone1> add fs
zonecfg:zone1:fs> set dir=/dir1
zonecfg:zone1:fs> set special=/dev/dsk/c0t1d0s3
zonecfg:zone1:fs> set raw=/dev/rdsk/c0t1d0s3
zonecfg:zone1:fs> set type=ufs
zonecfg:zone1:fs> end
zonecfg:zone1> add net
zonecfg:zone1:net> set physical=eri0
zonecfg:zone1:net> set address=192.168.201.121
zonecfg:zone1:net> end
zonecfg:zone1> add attr
zonecfg:zone1:attr> set name=comment
zonecfg:zone1:attr> set type=string
zonecfg:zone1:attr> set value="zone one"
zonecfg:zone1:attr> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> info
zonecfg:zone1> exit
You can use this procedure for multiple zones making sure that the filesystem, network, and
attribute configurations are appropriately modified. I have created an additional zone in this
manner called zone2 as you will see in the following zoneadm command outputs.
# zoneadm list -i
global
Notice that your new zone does not show up. It isn't installed yet, it is just configured. Next we will
install it.
# zoneadm -z zone1 install
Once complete, you can see the zones are installed:
# zoneadm list -iv
ID NAME
STATUS
0 global
running
- zone1
installed
- zone2
installed
# zoneadm -z zone1 boot
# zoneadm list -iv
ID NAME
STATUS
0 global
running
5 zone1
running
- zone2
installed

PATH
/
/export/zone1
/export/zone2
PATH
/
/export/zone1
/export/zone2

To log into a running zone use the zlogin command.


# zlogin -C zone1
[Connected to zone 'zone1' console]
117/117
With a brand new zone, you will go through the typical sysidcfg interactions (Language, Locale,
Terminal, Hostname,kerberos, Name service,Timezone, and password settings) that you would
normally do with a new Solaris install.
The zone will reboot and ready for general use.
Internal Comments
If the zone install fails, check the install.log for further errors.
The install.log is located in the zone's home path.
In this example, the install.log would be located at:
/export/zone1/root/var/sadm/system/logs/install.log
or
/export/zone2/root/var/sadm/system/logs/install.log

Regards,
Ambarish M.V

1. To display the existing Zones in the server.


# zoneadm list cv
2.

Potrebbero piacerti anche