solaris 11 exercise zones (1)

1. The zones will have /software as root.

# df -h | grep software
software 20G 33K 16G 1% /software

2. Create a vnic for a new zone.
# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet up 1000 full e1000g0
net1 Ethernet unknown 0 unknown e1000g1
net2 Ethernet unknown 0 unknown e1000g2
net3 Ethernet unknown 0 unknown e1000g3
# dladm create-vnic vnic20 -l net3

3. Create a zone called zone20
# zonecfg -z zone20
zone20: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone20> create
create: Using system default template 'SYSdefault'
zonecfg:zone20> set zonepath=/software/zone20
zonecfg:zone20> add net
zonecfg:zone20:net> set physical=vnic20
zonecfg:zone20:net> end
zonecfg:zone20> commit
zonecfg:zone20> exit
zoneadm -z zone20 install
(wait...)

Boot the zone and login to the console.

# zoneadm -z zone20 boot
# zlogin -C zone20
(in the sysidtool select manual network configuration and
select vnic20)
use 192.168.0.20 as the IP-Address.
use the default netmask
use router 192.168.0.1

DNS server: 192.168.4.1

root password : e1car0

4. Migrate a Solaris 10 zone to Solaris 11.
You will use a prepared cpio file from a Solaris 10 VM
to host a solaris 10 zone on Solaris 11.

Use the automounter to access the preconfigured file.
# cd /net/192.168.4.159/zones
# ls
zone10 zone10.cpio.gz

Create a new zone.
# zonecfg -z zone10
zone10: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone10> create -t SYSsolaris10
zonecfg:zone10> set zonepath=/zones/zone1
zonecfg:zone10> set autoboot=true
zonecfg:zone10> select anet linkname=net0
zonecfg:zone10:anet> set allowed-address=192.168.0.30/24
zonecfg:zone10:anet> set configure-allowed-address=true
zonecfg:zone10:anet> end
zonecfg:zone10> set hostid=2ee3a870
zonecfg:zone10> verify
zonecfg:zone10> commit
zonecfg:zone10> exit

Attach the cpio file to the new zone
# zoneadm -z zone10 attach -a /net/192.168.4.159/zones/zone10.cpio.gz
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20140301T180221Z.zone10.attach
Log File: /var/log/zones/zoneadm.20140301T180221Z.zone10.attach
Attaching...
Installing: This may take several minutes...

# zoneadm -z zone10 boot

5. Delegate zonemanagement of zone3 to user peter.

# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
2 zone3 running /rpool/zones/zone3 solaris excl

# zonecfg -z zone3
zonecfg:zone3> add admin
zonecfg:zone3:admin> set user=peter
zonecfg:zone3:admin> set auths=manage
zonecfg:zone3:admin> end
zonecfg:zone3> commit
zonecfg:zone3> exit

# su - peter
# pfexec bash
# zlogin zone3

[Connected to zone 'zone3' pts/7]
Oracle Corporation SunOS 5.11 11.0 August 2012
root@zone3:~# exit

# zoneadm -z zone3 halt

note: another way of setting authorizations
# usermod -P+"Zone Management" -A+solaris.zone.manage/zone1 peter
# usermod -A+solaris.zone.login/zone2 peter

note: use pfexec bash to test because bash is not RBAC aware.

Optional exercise.
6. Create an additional zone called zone21.
The zone will have to vnic interfaces, vnic30 and vnic31.
Vnic30 will be connected to an etherstub. Vnic31 will be
connected to net0.

Zone20 has one vnic called vnic20. This vnic will also be
connected to the etherstub. Zone20 will use zone21
as a router.

|zone20-vnic20 | 192.168.0.0 | vnic30-zone21-vnic31 | 192.168.4.0 |

This entry was posted in solaris. Bookmark the permalink.

Comments are closed.