Updated 22 March 2010
Linux Logo

Adding a Dedicated Device to a Local Zone


Description:
  • This procedure describes how to add a dedicated device such as a disk drive, scanner or network interface to an existing zone configuration so it may be accessed from the zone.
Prerequisites:
  • The device to be assigned must be part of the global zone configuration.
Notes:
  • None
References:

Step Action Description
1 Use zonecfg -z <zone name>
# /usr/sbin/zonecfg -z <zone name>
 

Acces the zone configuration with zonecfg -z <zonename>.

global# /usr/sbin/zonecfg -z myzone 
zonecfg:myzone> info
zonepath: /zones/myzone
autoboot: true
pool: 
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
inherit-pkg-dir:
        dir: /opt/sfw
net:
        address: 192.168.3.36/24
        physical: rtls0
zonecfg:myzone>
2 Use add device to assign new device
zonecfg:{zone name}> add device
  In the zonecfg command used add device and assign with set the device path.
zonecfg:myzone> add device
zonecfg:myzone:device> set match=/dev/scsi/scanner/c3t4*
zonecfg:myzone:device> end
zonecfg:test> info
zonepath: /zones/myzone
autoboot: true
pool: 
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
inherit-pkg-dir:
        dir: /opt/sfw
net:
        address: 192.168.3.36/24
        physical: rtls0
device
        match:/dev/scsi/scanner/c3t4*
zonecfg:myzone> verify
zonecfg:myzone> exit
global#
Notes:
  • set match makes a device available and dedicated to a specific zone. It will not be available to the local zone unless it has been to the zone configured entires.
3 Use zoneadm -z <zone name> reboot
# /usr/sbin/zoneadm -z <zone name> reboot
 

On the global zone, use the zoneadm -z <zone name> reboot to enable the new network in the updated zone configuration.

global# /usr/sbin/zoneadm -z myzone reboot
global#
Notes:
  • The device must be configured within the local zone so that is will be attached if required. For example a disk partition mounted to a directory will require that the /etc/vfstab file in the local zone be edited. The disk partition must not be mounted in the global zone or any other zone. set match dedicated a device to a specific zone.
Click for more info