Assign metadevice to Solaris non-global zone

  1. From the global zone, create the SVM Metadevice like you normally would.
  2. Create the zone and add the SVM Metadevice to the zone configuration via zonecfg.

global-zone# zonecfg -z myzone
myzone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:myzone> create
zonecfg:myzone> set zonepath=/zones/myzone
zonecfg:myzone> set autoboot=true
zonecfg:myzone> add net
zonecfg:myzone:net> set address=192.168.1.100
zonecfg:myzone:net> set physical=ce0
zonecfg:myzone:net> end
zonecfg:myzone:net> add device
zonecfg:myzone:net> set match=/dev/md/*dsk/d110
zonecfg:myzone:net> end
zonecfg:myzone> add attr
zonecfg:myzone:attr> set name=comment
zonecfg:myzone:attr> set type=string
zonecfg:myzone:attr>set value="My first zone with metadevices - myzone"
zonecfg:myzone:attr> end
zonecfg:myzone> verify
zonecfg:myzone> export


The key line to adding the SVM Metadevice to the non-global zone is the following:

zonecfg:myzone:net> add device
zonecfg:myzone:net> set match=/dev/md/*dsk/d610
zonecfg:myzone:net> end

I used an asterisk to signify that I want both the the dsk and rdsk devices.

Assuming all went well, you should be able to mount and unmount the SVM Metadevice from the non-global zone. Why would you want to provide the ability for a non-global zone to mount and un-mount a file system at will? In my case, the mount point assigned to d110 in the example above is cloned daily using EMC clone technology.


About this entry