##############################
+shared_disk_ids="tmp/shared_disk_ids"
+
register_hook create_cluster_hooks shared_disk_setup
shared_disk_setup ()
{
+ rm -f "$shared_disk_ids"
+
if [ -n "$SHAREDDISKSIZE" -a -n "$SHAREDDISK_TEMPLATE" -a \
-n "$SHAREDDISK_COUNT" -a "$SHAREDDISK_COUNT" != 0 ] ; then
# setup a nice ID at the start of the disk
"$SHARED_DISK_ID_GEN" "$i" > tmp/diskid
dd if=tmp/diskid of=$VIRTBASE/$CLUSTER/shared$i conv=notrunc bs=1 > /dev/null 2>&1
+ head -n 1 tmp/diskid >>"$shared_disk_ids"
done
echo
echo "${t:0:13}"
}
+install_shared_disk_ids ()
+{
+ if [ -r "$shared_disk_ids" ] ; then
+ local t="/root/scripts/${shared_disk_ids##*/}"
+ echo "Installing shared disk ID file \"${t}\""
+ diskimage mkdir_p "/root/scripts"
+ diskimage put "$shared_disk_ids" "$t"
+ fi
+}
+
+register_hook setup_base_hooks install_shared_disk_ids
+
##########
# Allow other configuration files to override this function but still