Sunday, 21 October 2018

Solaris 11.2 : Adding new resources to a running zone online By Devan

Solaris 11.2 : Adding new resources to a running zone online

Solaris 11.2 provides a supported way to add new resources to a running zone online. Prior to this version, a reboot of the non-global zone was required to make the changes effective. The post describes an example of adding a raw disk device online to a non-global zone.
Example:
1. Check the Solaris OS version.
# uname -a
SunOS test 5.11 11.2 sun4v sparc SUNW,T5240
2. List the zones available on the system. In our example we will be adding disk resource to the zone – zone01
# zoneadm list -cv
  ID NAME             STATUS      PATH                         BRAND      IP
   0 global           running     /                            solaris    shared
   1 zone01           running     /zones/zone01                    solaris    shared
3. Verify the availability of the disk being assigned to the zone.
# ls -l /dev/dsk/c1d2s0
lrwxrwxrwx   1 root     root          62 Jan  4 17:14 /dev/dsk/c1d2s0 -> ../../devices/virtual-devices@100/channel-devices@200/disk@2:a
4. Start modifying the zone configuration. Assign the disk to the zone – zone01.
# zonecfg -z zone01
zonecfg:zone01> add device
zonecfg:zone01:device>  set match=/dev/dsk/c1d2s0
zonecfg:zone01:device> set match=/dev/rdsk/c1d2s0
zonecfg:zone01:device> end
zonecfg:zone01> commit
zonecfg:zone01> exit
5. If you check the /dev/rdsk path in the zone, currently you will not find any disk available. This is because we have not yet applied the changes to the non-globa zone.
# zlogin zone01 ls -l /dev/rdsk
total 0
6. Apply the changes to the zone.
# zoneadm -z zone01 apply
zone 'zone01': Checking: Removing net physical=net0
zone 'zone01': Checking: Adding net physical=net0
zone 'zone01': Checking: Adding device match=/dev/rdsk/c1d2s0
zone 'zone01': Applying the changes
7. Verify the new disk under /dev/rdsk directory :
# zlogin zone01 ls -l /dev/rdsk
total 0
crw-------   1 root     sys      264, 16 Jan  4 18:29 c1d2s0

No comments:

Post a Comment