diff options
author | Josh Wilsdon <jwilsdon@joyent.com> | 2012-01-13 08:23:00 +0000 |
---|---|---|
committer | Josh Wilsdon <jwilsdon@joyent.com> | 2012-01-13 08:23:00 +0000 |
commit | 38ec95afc22893692d3c5329077c4c6e60613071 (patch) | |
tree | 3ccd09ad43249feffec9ecf74f658f1a74f17ed2 /usr/src | |
parent | dc5ef915c6127b762e1e490dff77ed8e5dfe5f56 (diff) | |
download | illumos-joyent-38ec95afc22893692d3c5329077c4c6e60613071.tar.gz |
OS-866 add support for creating kvm branded zones with a custom root dataset.
Diffstat (limited to 'usr/src')
-rwxr-xr-x | usr/src/lib/brand/kvm/zone/kinstall.ksh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/src/lib/brand/kvm/zone/kinstall.ksh b/usr/src/lib/brand/kvm/zone/kinstall.ksh index abd60a17b7..43b0c953d1 100755 --- a/usr/src/lib/brand/kvm/zone/kinstall.ksh +++ b/usr/src/lib/brand/kvm/zone/kinstall.ksh @@ -66,6 +66,14 @@ PDS_NAME=`mount | nawk -v p=$dname '{if ($1 == p) print $3}'` [ -z "$PDS_NAME" ] && \ print -u2 "Brand error: missing parent ZFS dataset for $dname" +# it's possible to specify a zone root here if you specified the +# '-x nodataset' when installing the zone. +if [[ -n ${TMPLZONE} ]]; then + zfs snapshot $PDS_NAME/${TMPLZONE}@${bname} + zfs clone -o quota=${ZQUOTA}g $PDS_NAME/${TMPLZONE}@${bname} \ + $PDS_NAME/$bname +fi + if [ ! -d ${ZONEPATH}/config ]; then mkdir -p ${ZONEPATH}/config chmod 755 ${ZONEPATH}/config |