Sunday, October 30, 2005

Mount global zone /var/tmp/ZoneFile on /mnt of non-global zone (10)

1) mkfile 500m /var/tmp/ZoneFile
2) lofiadm -a /var/tmp/ZoneFile
3) zonecfg:ZoneName> add device
4) zonecfg:ZoneName> set match=/dev/rlofi/1
5) zonecfg:ZoneName> end
6) repeat for match=/dev/lofi/1
7) zoneadm -z ZoneName reboot
8) rlogin ZoneName
9) newfs /dev/rlofi/1
10) vi /etc/vfstab : /dev/lofi/1 /dev/rlofi/1 /mnt ufs 2 yes logging

Remove fs: resource-type with zonecfg

zonecfg:ZoneName> remove fs type=ufs

To append ZoneName to global core files

coreadm -g /var/core/core.%f.%p.%z

Zone configuration file

/etc/zones/ZoneName.xml

To config IPMP in non-global zones (2)

1) config it in the global zone first
2) add non-global IPs to the IPMP group from the global zone

List processes for a defined zone

ps -z ZoneName

List processe tree for a defined zone

ptree -z ZoneName

List current zone

zonename

Clean shutdown of a zone

zlogin ZoneName shutdown -i5 -g10 -y

Run `zonename` command w/o loging in

zlogin ZoneName zonename

Difference between zlogin ZoneName and zlogin -C ZoneName

zlogin ZoneName : pseudo-terminal device (/dev/pts/*) login
zlogin -C ZoneName : console (/dev/console) login
* `tty` while in the zone to display current device

To exit a non-global zone

~.

If sysidtool does not run at first login,

zlogin -S ZoneName /usr/sbin/sys-unconfig

Failsave zone console login

zlogin -S

Zone login as a user sergey

zlogin -l sergey ZoneName

Flag to login into a zone that is not in a running state

zlogin -C

Difference between deleting and uninstalling a zone

Uninistalling leaves zone's configuration untouched : zoneadm used
Deleting needs uninstalling to be run first : zonecfg used

To delete even zone's configuration

zonecfg -z ZoneName delete

To boot a zone into single-user mode

zoneadm -z ZoneName boot -s

To boot a zone

zoneadm -z ZoneName boot

Two ways to perform internal zone config before booting a zone

1) place configured sysidcfg in zone's /etc dir
2) zone console login: zlogin

To transition zone into ready state

zoneadm -z ZoneName ready

If zone status is incomplete

zoneadm -z ZoneName uninstall

List all installed zones

zoneadm list -iv
* posmotret' na vse chetire storoni

zonepath permissions

700

To list zone status

zoneadm -z ZoneName list -v
* ZoneName, give me five

To reboot a zone

zoneadm -z ZoneName reboot

To change a zone ID

reboot it

To halt a zone

zoneadm -z ZoneName halt

zsched is started by

zoneadmd

For each zone in a ready state

there is a running zoneadmd daemon

Two daemons of the ready state

1) zsched
2) zoneadmd

Difference between a ready state and a running state

ready does not have any user processes running yet

Command to install and administer non-global zones

zoneadm

Path to the zone root is called

zonepath

Set zonepath to /export/zones

zonecfg:ZoneName> set zonepath=/export/zones

To make a zone boot automatically when global boots

zonecfg:ZoneName> set autoboot=true
* default is false

zonecfg -z ZoneName on a new zone needs

zonecfg:ZoneName> create

Check zone configuration with zonecfg

zonecfg:ZoneName> verify

Command run together with "exit"

zonecfg:ZoneName> commit

zonecfg changes take effect when

the zone is rebooted

Modify attr value to "Zone called ZZ" (5)

1) zonecfg -z ZoneName
2) zonecfg:ZoneName> info (choose one pair in attr: section, such as "name: comment")
3) zonecfg:ZoneName> select attr name=comment
4) zonecfg:ZoneName:attr> set value="Zone called ZZ"
5) end

To delete a zone

zonecfg -z ZoneName delete
* -F not to be prompted a confirmation

To revert a change before commited

zonecfg:ZoneName> revert

Display zone info

zonecfg -z ZoneName info

Restricting zone size (2)

1) Zone on a lofi mounted partition
2) Zone on a soft partition

Sparse root zone space requirement

100MB

Four default inherit-pkg-dir resources are

PLUS:
/platform
/lib
/usr
/sbin

inherit-pkg-dir resources are shared through a

read-only loopback file system mount

inherit-pkg-dir is configured in a

sparse root zone

inherit-pkg-dir is NOT configured in a

whole root zone

Is zone name case-sensitive?

yes

A non-global zone has this many states

6 : C-i-i-r-r-S
Configured
Incomplete
Installed
Ready
Running
Shutting down and Down

To boot the zone

zoneadm

To complete internal config for the zone

zlogin

Command to install a zone

zoneadm

Command to config a non-global zone

zonecfg

Individual non-global zones can be administered by a

zone administrator with Zone Management profile

Each zone has a separate

node name

Global zone ID is always

0

Each zone has a name and a

numeric ID

The global zone is always named

global

Every Solaris 10 system has a

global zone