X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/d9bf37acde985cbe8366c52a528809a0ae078a3f..602d2e0f6b958aa58ebe1a13b0116efe36423aca:/host/usr/sbin/invirt-vmcontrol diff --git a/host/usr/sbin/invirt-vmcontrol b/host/usr/sbin/invirt-vmcontrol index 9080dfc..66f5ca6 100755 --- a/host/usr/sbin/invirt-vmcontrol +++ b/host/usr/sbin/invirt-vmcontrol @@ -12,10 +12,6 @@ ORIGMACHINE="$1" ACTION="$2" MACHINE="d_$ORIGMACHINE" -xm () { - command xm "$@" || exit 35 -} - case "$ACTION" in list|vcpu-list|uptime) xm "$ACTION" "$MACHINE" @@ -26,6 +22,9 @@ case "$ACTION" in ;; 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 ' "$@")"