summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmgrid/XX_vmgrid.sh
diff options
context:
space:
mode:
authorMichael Janczyk2010-03-25 18:33:20 +0100
committerMichael Janczyk2010-03-25 18:33:20 +0100
commit05d263fe3e313bde1c3da2fa67237df894971d43 (patch)
treece66520706d9b0c4362a308788d418bca62c139c /os-plugins/plugins/vmgrid/XX_vmgrid.sh
parentnew run-virt.include for xen plugin. qemukvm modules now loaded via runlevels... (diff)
downloadcore-05d263fe3e313bde1c3da2fa67237df894971d43.tar.gz
core-05d263fe3e313bde1c3da2fa67237df894971d43.tar.xz
core-05d263fe3e313bde1c3da2fa67237df894971d43.zip
added support for rw disks and netboot
Diffstat (limited to 'os-plugins/plugins/vmgrid/XX_vmgrid.sh')
-rw-r--r--os-plugins/plugins/vmgrid/XX_vmgrid.sh31
1 files changed, 17 insertions, 14 deletions
diff --git a/os-plugins/plugins/vmgrid/XX_vmgrid.sh b/os-plugins/plugins/vmgrid/XX_vmgrid.sh
index bdbd4836..39b8501a 100644
--- a/os-plugins/plugins/vmgrid/XX_vmgrid.sh
+++ b/os-plugins/plugins/vmgrid/XX_vmgrid.sh
@@ -18,9 +18,6 @@
# include functions
. /etc/functions
-# hostname?
-host_name=${host_name:=$clientip}
-
CONFFILE="/initramfs/plugin-conf/vmgrid.conf"
PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/vmgrid
VIRTUALIZATIONPLUGIN=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization
@@ -30,7 +27,6 @@ RWSHAREMNT=/mnt/var/opt/openslx/mnt/vmgrid
BINDIR=/mnt/${OPENSLX_DEFAULT_BINDIR}
PLUGINDIR=${OPENSLX_DEFAULT_DIR}/plugin-repo/vmgrid
VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}/vmgrid
-LOGDIR=/mnt/${OPENSLX_DEFAULT_LOGDIR}
if [ -f $CONFFILE ]; then
@@ -67,15 +63,16 @@ if [ -f $CONFFILE ]; then
fi
# create rw share
- testmkd ${RWSHARE}
+ testmkd 1777 ${RWSHARE}/rwdir
# bind mount id 45 to ${RWSHARE}
if strinstr "id45" "${vmgrid_rwshare}" ; then
id45part=$(grep " 45 " /etc/disk.partition | awk '{print $1}' | \
cut -f 3,3 -d /)
if [ -n "${id45part}" ]; then
- testmkd /mnt/media/${id45part}/vmgrid
- mount --bind -n /mnt/media/${id45part}/vmgrid ${RWSHARE} \
- >>${LOGDIR}/vmgrid.log 2>&1
+ # use rwdir because we want to use rwimg.vdi as well
+ testmkd /mnt/media/${id45part}/vmgrid/rwdir
+ mount --bind -n /mnt/media/${id45part}/vmgrid/rwdir ${RWSHARE}/rwdir \
+ >>/tmp/vmgrid.log 2>&1
fi
# mount nfs rw share
elif strinstr "nfs://" "${vmgrid_rwshare}" ; then
@@ -89,16 +86,22 @@ if [ -f $CONFFILE ]; then
rwtarget=${RWSHAREMNT}
# mount the vmgrid source rw
fsmount ${rwshareprot} ${rwshareserv} ${rwsharepath} ${rwtarget} rw
- testmkd ${RWSHAREMNT}/${host_name}
- mount --bind ${RWSHAREMNT}/${host_name} ${RWSHARE} \
- >>${LOGDIR}/vmgrid.log 2>&1
+ # hostname?
+ host_name=${host_name:=$clientip}
+ # use rwdir because we want to use rwimg.vdi as well
+ testmkd ${RWSHAREMNT}/${host_name}/rwdir
+ mount --bind ${RWSHAREMNT}/${host_name}/rwdir ${RWSHARE}/rwdir \
+ >>/tmp/vmgrid.log 2>&1
fi
else
- testmkd /mnt/tmp/vmgrid
- mount --bind -n /mnt/tmp/vmgrid ${RWSHARE} >>${LOGDIR}/vmgrid.log 2>&1
+ # use rwdir because we want to use rwimg.vdi as well
+ testmkd 1777 /mnt/tmp/vmgrid/rwdir
+ mount --bind -n /mnt/tmp/vmgrid/rwdir ${RWSHARE}/rwdir \
+ >>/tmp/vmgrid.log 2>&1
fi
# chmod so that everybody can write
- chmod 1777 ${RWSHARE}
+ chmod -R 1777 ${RWSHARE}
+ echo "vmgrid_rwdir=${RWSHARE#/mnt}" >> ${PLUGINCONFDIR}/vmgrid.conf
# TODO: virtual virtualization plugin