Minggu, 28 November 2010

Setup Network Configuration in Zone


· Plumb NIC network for zone

global# ifconfig e1000g1 plumb

global# zonecfg -z zone1

zonecfg:zone1> add net

zonecfg: zone1:net> set physical=e1000g1 <------ set physical network

zonecfg: zone1:net> set address=192.168.0.43 <------ set network address

zonecfg: zone1:net> set defrouter=192.168.0.2 <------ set default router address

zonecfg: zone1:net> end

zonecfg: zone1> verify

zonecfg: zone1> commit

· list of configuration

zonecfg: zone1> info

zonename: zone1

zonepath: /test1/zone1

brand: native

autoboot: true

bootargs:

pool:

limitpriv:

scheduling-class:

ip-type: shared

inherit-pkg-dir:

dir: /lib

inherit-pkg-dir:

dir: /platform

inherit-pkg-dir:

dir: /sbin

inherit-pkg-dir:

dir: /usr

fs:

dir: /etc/passwd

special: /etc/passwd

raw not specified

type: lofs

options: [ro]

fs:

dir: /etc/shadow

special: /etc/shadow

raw not specified

type: lofs

options: [ro]

net:

address: 192.168.0.43

physical: e1000g1

defrouter: 192.168.0.2

how to boot and halt the zone

• how to boot zone
Global# zoneadm -z zone1 boot

• list zone was booted
global # zoneadm list -cv

ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 zone1 running /test1/zone1 native shared <---- status zone was booted

• how to halt the zone global
# zoneadm -z zone1 halt

• list zone was halted
global # zoneadm list -cv

ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 installed /test1/zone1 native shared <---- status zone was halted

How to Create Simple Zone


• Create directory for zonepath
global# mkdir /test1/zone1

• Change mode for 700
global# chmod 700 /test1/zone1

• Create zone
global# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set autoboot=true
zonecfg:zone1> set zonepath=/test1/zone1
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit

• list zone was created
global# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 configured /test1/zone1 native shared <--- status zone was configured

• Install O/S in zone
global# zoneadm -z zone1 install
Waiting for up to <300> seconds for zone administration commands to become available (another user is administering zones)
Preparing to install zone
.
Creating list of files to copy from the global zone.
Copying <2922> files to the zone.
Preparing to initialize <1104> packages on the zone.
Initializing zone product registry.
Determining zone package initialization order.
Initializing package <723> of <1104>: percent complete: 65%

--------> wait until 100% and next process when finish wil appear below message

Initialized <1104> packages on zone.
Zone
is initialized.
Installation of <2> packages was skipped.
The file

· list zone was installed

global # zoneadm list -cv

ID NAME STATUS PATH BRAND IP

0 global running / native shared

- zone1 installed /test1/zone1 native shared <---- status zone was installed

----> After installation login as console


global # zlogin -C zone1
[Connected to zone 'zone1' console]

You did not enter a selection.
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:.
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.

-------> and then will appear below message

A host name must have at least one character; it can contain letters,
digits, and minus signs (-).


Host name zone1-lab


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

----------> press ESC+2

─ Time Zone ────────────────────────────────────────────────────────────────────

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
──────────────────────────────────
- [ ] Africa
│ [ ] Americas
│ [ ] Antarctica
│ [ ] Arctic Ocean
│ [ ] Asia
│ [ ] Atlantic Ocean
│ [ ] Australia
│ [ ] Europe
v [ ] Indian Ocean

────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

----> choose the time zone and press ESC+2

─ Country or Region ────────────────────────────────────────────────────────────

> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].


Countries and Regions
────────────────────────
^ [ ] Azerbaijan
│ [ ] Bahrain
│ [ ] Bangladesh
│ [ ] Bhutan
│ [ ] Brunei
│ [ ] Cambodia
│ [ ] China
│ [ ] Cyprus
│ [ ] East Timor
│ [ ] Georgia
│ [ ] Hong Kong
│ [ ] India
v [X] Indonesia

────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

------> choose the region and press ESC+2

─ Time Zone ────────────────────────────────────────────────────────────────────

> To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].


Time zones
─────────────────────────────────────────────────────────────────
[X] Java & Sumatra
[ ] west & central Borneo
[ ] east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
[ ] Irian Jaya & the Moluccas


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

-----> choose the time zones and pres ESC+2

─ Confirm Information ──────────────────────────────────────────────────────────

> Confirm the following information. If it is correct, press F2;
to change any information, press F4.


Time zone: Java & Sumatra
(Asia/Jakarta)


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-4_Change Esc-6_Help

------> confirmed and press ESC+2

─ Confirm Information ──────────────────────────────────────────────────────────

> Confirm the following information. If it is correct, press F2;
to change any information, press F4.


Time zone: Java & Sumatra
(Asia/Jakarta)


────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-4_Change Esc-6_Help

-----> press ESC+2

─ Root Password ────────────────────────────────────────────────────────────────

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: ********

────────────────────────────────────────────────────────────────────────────────
Esc-2_Continue Esc-6_Help

-------> give root password and press ESC+2

System identification is completed.

rebooting system due to change(s) in /etc/default/init

[NOTICE: Zone rebooting]

SunOS Release 5.10 Version Generic_120011-14 64-bit
Copyright 1983-2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: zone1-lab

zone1-lab console login:
zone1-lab console login: root
Password:
Nov 22 14:05:16 zone1-lab login: ROOT LOGIN /dev/console
Last login: Mon Nov 22 13:49:58 on pts/4
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#



========================================================
Zone States
Zone state information can be viewed with zoneadm list -iv from the global zone. Non-global zones have one of the following states:
• configured: Configuration complete and in stable storage.
• incomplete: Installation or uninstallation underway
• installed: Configuration instantiated on system. Zone has no associated virtual platform.
• ready: Virtual platform established, zsched started, IPs plumbed, filesystems mounted, zone ID assigned. No zone processes started yet.
• running: This state entered when zone init process starts.
• shutting down: Zone being halted.
• down: Transitional state during zone shutdown.
Zone Control Commands
The following control commands can be used to manage and monitor transitions between states:
• zlogin options zone-name
• zoneadm -z zone-name boot
• zoneadm -z zone-name halt
• zoneadm -z zone-name install
• zoneadm -z zone-name ready
• zoneadm -z zone-name reboot
• zoneadm -z zone-name uninstall
• zoneadm -z zone-name verify
• zonecfg -z zone-name: Interactive mode; can be used to remove properties of the following types: fs, device, rctl, net, attr
• zonecfg -z zone-name commit
• zonecfg -z zone-name create
• zonecfg -z zone-name delete
• zonecfg -z zone-name verify