Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
A number of new zonecfg(1M) properties are added to Oracle Solaris 11 zones. Below is a list of the
properties for both a Oracle Solaris 10 and a Oracle Solaris 11 zone. Properties added by Solaris 11
release 11/11 are in bold. Properties added by new releases of Solaris 11 are noted by release.
Oracle Solaris 10 zonecfg properties
For resource type ... there are property types ...:
(global)
zonename
(global)
zonepath
(global)
brand
(global)
autoboot
(global)
bootargs
(global)
pool
(global)
limitpriv
(global)
scheduling-class
(global)
ip-type
(global)
hostid
(global)
max-lwps
(global)
max-shm-memory
(global)
max-shm-ids
(global)
max-msg-ids
(global)
max-sem-ids
(global)
cpu-shares
fs
dir, special, raw, type
inherit-pkg-dir dir
net
address, physical, defrouter
device
match
rctl
name, value
attr
name, type, value
dataset
name
dedicated-cpu
ncpus, importance
capped-cpu
ncpus
capped-memory
physical, swap, locked
In the Oracle Solaris 10 list above the inherit-pkg-dir resource is listed but it is not present in the
Oracle Solaris 11 list below, sparce root model zones are no longer supported. In the Oracle Solaris 11
list the file-mac-profile property, the fs-allowed property, the max-processes property, the anet
resource and admin resource are added. In addition new resource properties are added to the net and
device resources.
Oracle Solaris 11 zonecfg properties
For resource type ... there are property types ...:
(global)
zonename
(global)
zonepath
(global)
brand
(global)
autoboot
(global)
autoshutdown
(global)
bootargs
(Solaris 11.2)
(global)
file-mac-profile
(global)
pool
(global)
limitpriv
(global)
scheduling-class
(global)
ip-type
(global)
hostid
(global)
fs-allowed
(global)
max-lwps
(global)
max-processes
(global)
max-shm-memory
(global)
max-shm-ids
(global)
max-msg-ids
(global)
max-sem-ids
(global)
cpu-shares
(global)
tenant
(Solaris 11.2)
fs
dir, special, raw, type, options
net
address, allowed-address, physical, defrouter, configureallowed-address
anet
linkname, lower-link, allowed-address, configure-allowedaddress, defrouter, allowed-dhcp-cids, link-protection, mac-address, mac-prefix,
mac-slot, vlan-id, priority, rxrings, txrings, mtu, maxbw
(added by Solaris 11.1) rxfanout,vsi-typeid, vsi-vers, vsi-mgrid, etsbw-lcl, cos, pkey,
linkmode,
(added by Solaris 11.2) evs, vport
device
match, allow-partition, allow-raw-io
(added by Solaris 11.2) storage
rctl
name, value
attr
name, type, value
dataset
name
dedicated-cpu
ncpus, importance
(added by Solaris 11.2) cpus, cores, sockets
capped-cpu
ncpus
capped-memory
physical, swap, locked
admin
user, auths
install-size, storage
install-size, name, storage
The file-mac-profile property is used to configure a immutable zone. Immutable zones have a readonly root system. The kernel applies the read restriction based on the setting for this property. The
property is not set by default which is the equivalent of a none setting. The possible settings for this
property are:
To examine the property more a read-only zone has been created, following is the configuration
information for the zone. The network interface is set to be shared, automatic-network configuration
will not work correctly and will require intervention by the administrator of the zone. The better
configurations to use are shared or exclusive with a VNIC configured in the global zone and assigned
specifically to the non-global zone.
Read-only Zone configuration
# zonecfg -z readonly
readonly: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:readonly> create -t SYSdefault-shared-ip
zonecfg:readonly> set zonepath=/zones/readonly
zonecfg:readonly> set file-mac-profile=strict
zonecfg:readonly> add net
zonecfg:readonly:net> set physical=net0
zonecfg:readonly:net> set address=192.168.0.10/24
zonecfg:readonly:net> end
zonecfg:readonly> exit
The zone install is standard, the zone will boot as a writable zone until the system configuration
information is added and the milestone self-assembly-complete completes, the zone will then
reboot to read-only mode. The state of the zone can be examined for the read-write or read-only modes
by using the list -p option to the zoneadm command:
Zone booted, not configured
# zoneadm -z readonly list -p
3:readonly:running:/zones/readonly:8a079b62-bb36-6a1a-f08ab68f4a7e7d2a:solaris:shared:W:strict
The second to last field W indicates the zone is writable, the last field show the file-mac-profile
property setting.
Zone rebooting
# zoneadm -z readonly list -p
5:readonly:ready:/zones/readonly:8a079b62-bb36-6a1a-f08ab68f4a7e7d2a:solaris:shared:-:strict
Next is an examination of the zone to confirm the restrictions, first file writes and syslog:
Test file and syslog write
root@readonly:~# touch /var/tmp/testfile
touch: cannot create /var/tmp/testfile: Read-only file system
root@readonly:~# touch /testfile
touch: cannot create /testfile: Read-only file system
I
root@readonly:~# touch /etc/testfile
touch: cannot create /etc/testfile: Read-only file system
mail.crit] My unqualified
mail.crit] My unqualified
mail.alert] unable to qualify
mail.alert] unable to qualify
The string tester would have been written to /var/adm/messages in a writable zone but in the strict
read-only zone /var/adm/messages is not writable.
Next a service state is changed and a reboot is preformed to show the current state of the service is
persistent (fixed):
root@readonly:~# svcs ssh
STATE
STIME
FMRI
online
4:46:50 svc:/network/ssh:default
root@readonly:~# svcadm disable ssh
root@readonly:~# svcs ssh
STATE
STIME
FMRI
disabled
5:24:42 svc:/network/ssh:default
root@readonly:~# reboot
[Connection to zone 'readonly' pts/3 closed]
# zoneadm -z readonly list -p
6:readonly:running:/zones/readonly:8a079b62-bb36-6a1a-f08ab68f4a7e7d2a:solaris:shared:R:strict
# zlogin readonly
[Connected to zone 'readonly' pts/3]
Oracle Corporation
SunOS 5.11
11.0
November 2011
In a read-write zone changing a service state will survive a reboot. In the read-only zone the repository
is updated in memory so the service can be disabled, however, the repository's new state for that service
can not be written to persistent storage so the state of the repository remains as when the repository was
last written.
Packages are not available to the read-only zone, in the next test the zone is booted as a writable zone
by passing the -w option to the zoneadm command. In the writable state the pkg command is verified,
then the zone is rebooted to read-only mode and the same commands are tested.
Zone Booted Read-write
# zoneadm -z readonly reboot -w
# zoneadm -z readonly list -p
7:readonly:running:/zones/readonly:8a079b62-bb36-6a1a-f08ab68f4a7e7d2a:solaris:shared:W:strict
# zlogin readonly
[Connected to zone 'readonly' pts/3]
Oracle Corporation
SunOS 5.11
root@readonly:~#
11.0
November 2011
11.0
November 2011
In the fixed-configuration read-only configuration most of /var is writable and log files are
writable as seen by the previous commands.
Next the zone is configured as flexible-configuration read-only zone and the configuration is
verified:
Zone configured as flexible-configuration and rebooted
# zonecfg -z readonly set file-mac-profile=flexible-configuration
# zoneadm -z readonly boot
# zoneadm -z readonly list -p
1:readonly:running:/zones/readonly:8a079b62-bb36-6a1a-f08ab68f4a7e7d2a:solaris:shared:R:flexible-configuration
11.0
November 2011
The flexible-configuration configuration allows access to roots home directory, /etc and /var
but other file systems are restricted.
The restriction applied to a read-only zone are not applied to read-write files systems that are mounted
read-write in to the zone via NFS or through zone configuration, for example:
Read-only zone, /opt not writable
# zonecfg -z readonly set file-mac-profile=strict
# zoneadm -z readonly boot
# zlogin readonly
[Connected to zone 'readonly' pts/2]
Oracle Corporation
SunOS 5.11
11.0
November 2011
11.0
November 2011
Solaris 11.2 adds Read-Only Global zone configurations. Immutable zones will have a read-only zone
root.
Read-Only/Immutable Global zone
# zonecfg -z global set file-mac-profile=fixed-configuration
MOUNTPOINT
/rpool
legacy
/
/var
/export
/export/home
/export/home/tim
VERSION
0.5.11-0.175.0.0.0.2.1
IFO
i--
11.0
November 2011
zone.max-lofi
zonecfg:ozone> add rctl
zonecfg:ozone:rctl> set name=zone.max-lofi
zonecfg:ozone:rctl> set value=(priv=privileged,limit=10,action=deny)
zonecfg:ozone:rctl> help
zonecfg:ozone:rctl> end
Results
# prctl -i zone ozone
zone: 5: ozone
NAME
PRIVILEGE
zone.max-lofi
usage
privileged
system
zone.max-swap
usage
system
zone.max-locked-memory
usage
system
zone.max-shm-memory
system
zone.max-shm-ids
system
zone.max-sem-ids
system
zone.max-msg-ids
system
zone.max-processes
usage
privileged
system
zone.max-lwps
usage
privileged
system
zone.cpu-cap
usage
system
zone.cpu-shares
usage
privileged
system
VALUE
FLAG
ACTION
RECIPIENT
0
10
18.4E
max
deny
deny
47.4MB
16.0EB
max
deny
0B
16.0EB
max
deny
16.0EB
max
deny
16.8M
max
deny
16.8M
max
deny
16.8M
max
deny
5
300
2.15G
max
deny
deny
24
3.00K
2.15G
max
deny
deny
0
4.29G
inf
deny
1
1
65.5K
max
none
none
status
rpool
ONLINE
none requested
NAME
rpool
c3t0d0s0
STATE
ONLINE
ONLINE
November 2011
root@fszone:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c3t2d0 <ATA-VBOX HARDDISK-1.0 cyl 98 alt 2 hd 64 sec 32>
sd2 at pciclass,0106010 slave 16
Specify disk (enter its number): 0
selecting c3t2d0
Permission denied.
root@fszone:~# exit
logout
[Connection to zone 'fszone' pts/3 closed]
11.0
November 2011
root@fszone:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c3t2d0 <ATA-VBOX HARDDISK-1.0 cyl 98 alt 2 hd 64 sec 32>
sd2 at pciclass,0106010 slave 16
Specify disk (enter its number): 0
selecting c3t2d0
[disk formatted]
No Solaris fdisk partition found.
FORMAT MENU:
disk
type
partition
current
format
fdisk
repair
label
analyze
defect
backup
verify
save
inquiry
volname
!<cmd>
quit
format> p
select a disk
select (define) a disk type
select (define) a partition table
describe the current disk
format and analyze the disk
run the fdisk program
repair a defective sector
write label to the disk
surface analysis
defect list management
search for backup labels
read and display labels
save new disk/partition definitions
show disk ID
set 8-character volume name
execute <cmd>, then return
PARTITION MENU:
0
- change `0' partition
1
- change `1' partition
2
- change `2' partition
3
- change `3' partition
4
- change `4' partition
5
- change `5' partition
6
- change `6' partition
7
- change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name
- name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 98 + 2 (reserved cylinders)
Part
Tag
0 unassigned
1 unassigned
2
backup
3 unassigned
4 unassigned
5 unassigned
6 unassigned
7 unassigned
8
boot
9 unassigned
Flag
wm
wm
wu
wm
wm
wm
wm
wm
wu
wm
Cylinders
0
0
0 - 97
0
0
0
0
0
0 - 0
0
Size
0
0
98.00MB
0
0
0
0
0
1.00MB
0
Blocks
(0/0/0)
0
(0/0/0)
0
(98/0/0) 200704
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(1/0/0)
2048
(0/0/0)
0
partition> m
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
Part
Tag
Flag
Cylinders
Size
Blocks
0
root
wm
0
0
(0/0/0)
0
1
swap
wu
0
0
(0/0/0)
0
2
backup
wu
0 - 97
98.00MB
(98/0/0) 200704
3 unassigned
wm
0
0
(0/0/0)
0
4 unassigned
wm
0
0
(0/0/0)
0
5 unassigned
wm
0
0
(0/0/0)
0
6
usr
wm
0
0
(0/0/0)
0
7 unassigned
wm
0
0
(0/0/0)
0
8
boot
wu
0 - 0
1.00MB
(1/0/0)
2048
9 alternates
wm
0
0
(0/0/0)
0
Do you wish to continue creating a new partition
table based on above table[yes]?
Free Hog partition[6]? 0
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]:
Part
Tag
0
root
1
swap
2
backup
3 unassigned
4 unassigned
5 unassigned
6
usr
7 unassigned
8
boot
9 alternates
Flag
wm
wu
wu
wm
wm
wm
wm
wm
wu
wm
Cylinders
1 - 97
0
0 - 97
0
0
0
0
0
0 - 0
0
Size
97.00MB
0
98.00MB
0
0
0
0
0
1.00MB
0
Blocks
(97/0/0) 198656
(0/0/0)
0
(98/0/0) 200704
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(1/0/0)
2048
(0/0/0)
0
Flag
wm
wm
wu
wm
wm
wm
wm
wm
wu
wm
Cylinders
1 - 97
0
0 - 97
0
0
0
0
0
0 - 0
0
Size
97.00MB
0
98.00MB
0
0
0
0
0
1.00MB
0
Blocks
(97/0/0) 198656
(0/0/0)
0
(98/0/0) 200704
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(1/0/0)
2048
(0/0/0)
0
partition> ^D
root@fszone:~#
The storage property is added to the device resource by Solaris 11.2. The property can be set to a
storage URI (SURI), see suri(5). The SURI is mapped when the zone boots the allow-partition is
automatically set to true. and the matching device nodes are available inside the zone. The SURI is
unmapped when the zone halts.
configure-allowed-address: true
defrouter not specified
allowed-dhcp-cids not specified
link-protection: mac-nospoof
mac-address: random
auto-mac-address: 2:8:20:fa:fb:da
mac-prefix not specified
mac-slot not specified
vlan-id not specified
priority not specified
rxrings not specified
txrings not specified
mtu not specified
maxbw not specified
Most of the anet properties are self explanatory and all are defined in the zonecfg(1M) man page. The
table examines a few of the more interesting properties.
lower-link: auto
Defines the link in the global zone that will be used for the VNIC, the
property can be set to any existing link as described by the dladm(1M)
command.
When set to auto the link selection order is first a configured link
aggregation in the up state, next a Ethernet link in the up state chosen
based on a alphabetic sort , the net0 link if available.
mac-address: random
Can be set to factory, random or auto. Auto attempts to use a factory MAC
, if no factory address is available then random is used. A random
addressed is preserved cross reboots to support DHCP.
auto-mac-address:
When the anet resource is used this property is populated with the
assigned MAC address.
mac-prefix
mac-slot
Solaris 11.1 added more anet resource properties, these properties are described in the dladm(1M) man
page. Solaris 11.2 added two more anet resource properties, these are properties are used the EVS
environment. See evsadm(1M).
The net resource properties include the defrouter, allowed-address and configure-allowedaddress.
defrouter
allowed-address
configure-allowed-address
tim:~$ roles
zadmin
tim:~$ su zadmin
Password:
zadmin:~$ profiles
Zone Management
All
Basic Solaris User
zadmin:~$ profiles -p "Zone Management"
Found profile in files repository.
profiles:Zone Management> info
name=Zone Management
desc=Zones Virtual Application Environment Administration
help=RtZoneMngmnt.html
cmd=/usr/sbin/zoneadm
cmd=/usr/sbin/zlogin
profiles:Zone Management> exit
PATH
/
/zones/ozone
/zones/zone1
BRAND
solaris
solaris
solaris
11.0
December 2011
proc
root
rpool
sbin
root@ozone:~# cd ..
root@ozone:/# ls
bin
etc
home
dev
export lib
mnt
net
nfs4
opt
system
tmp
root@ozone:/# exit
logout
usr
var
IP
shared
excl
excl
SURI Format
Local Device URI
dev:<local-path-under-/dev>
dev:///<path-with-dev>
dev:<absolute-path-with-dev>
Examples:
dev:dsk/c0t0d0s0
dev:///dev/dsk/c0t0d0s0
dev:/dev/dsk/c0t0d0s0
Examples:
lu:luname.naa.5000c5000288fa25
lu:initiator.naa.2100001d38089fb0,target.naa.2100001d38089fb0,luname.naa.
5000c5000288fa25
iSCSI URI
iscsi:///luname.naa.<ID>
iscsi://<host>[:<port>]/luname.naa.<ID>
Examples:
iscsi:///luname.naa.600144f03d70c80000004ea57da10001
iscsi://[::1]/luname.naa.600144f03d70c80000004ea57da10001
iscsi://127.0.0.1/luname.naa.600144f03d70c80000004ea57da10001
iscsi://127.0.0.1:3260/luname.naa.600144f03d70c80000004ea57da10001
iscsi://hostname:3260/luname.naa.600144f03d70c80000004ea57da10001
This example shows the creation and installation of a zone using both the zpool and rootzpool
resources.
/tmp/manifest.xml.50ayDo
/usr/share/auto_install/sc_profiles/enable_sci.xml
poolzone
Starting ...
SPEED
3.3M/s
ITEMS
48378/48378
Done
Done
Done
STATE
ONLINE
ONLINE
STATE
ONLINE
ONLINE
ONLINE
ONLINE
NAME
rpool
mirror-0
c4t4d0
c4t5d0
STATE
ONLINE
ONLINE
ONLINE
ONLINE