ACTION="$2"
MACHINE="d_$ORIGMACHINE"
-xm () {
- command xm "$@" || exit 35
-}
-
case "$ACTION" in
list|vcpu-list|uptime)
xm "$ACTION" "$MACHINE"
;;
install|create)
shift; shift;
+ if [ -f "/etc/invirt/nocreate" ]; then
+ echo "Host $HOSTNAME is currently refusing VM creation." && exit 2
+ fi
xm list "$MACHINE" >/dev/null 2>/dev/null && echo "$MACHINE already exists" && exit 1
if [ "$ACTION" = "install" ]; then
xm create invirt-database machine_name="$ORIGMACHINE" installer_options="$(printf '%q ' "$@")"