From ea51b65e5c2fa7c786e7db01e4647d2b443782ae Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Fri, 12 Mar 2021 16:59:15 +0100 Subject: [PATCH] M #-: Fail in cpds.ssh in undeployed/stopped (#967) --- src/tm_mad/ceph/cpds.ssh | 6 ++++++ src/tm_mad/ceph/mvds.ssh | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/tm_mad/ceph/cpds.ssh b/src/tm_mad/ceph/cpds.ssh index 2a649435b2..bd81ce3af7 100755 --- a/src/tm_mad/ceph/cpds.ssh +++ b/src/tm_mad/ceph/cpds.ssh @@ -97,6 +97,12 @@ if [ "${LCM_STATE}" = '26' -a "${VM_MAD}" != "kvm" ]; then exit 1 fi +# Undeployed, or stopped VM state +if [ "$LCM_STATE" = '67' ] || [ "$LCM_STATE" = '68' ]; then + error_message "cpds.ssh: Operation not supported on undeployed/stopped" + exit 1 +fi + if [ "$SNAP_ID" != "-1" ]; then error_message "cpds.ssh: Operation not supported on disk type ${TYPE} with snapshots" exit 1 diff --git a/src/tm_mad/ceph/mvds.ssh b/src/tm_mad/ceph/mvds.ssh index 7174d9f885..889ae17ac5 100755 --- a/src/tm_mad/ceph/mvds.ssh +++ b/src/tm_mad/ceph/mvds.ssh @@ -85,6 +85,17 @@ ORIGINAL_SIZE="${XPATH_ELEMENTS[j++]}" # Copy Image back to the datastore #------------------------------------------------------------------------------- +if [ "${LCM_STATE}" = '26' -a "${VM_MAD}" != "kvm" ]; then + error_message "mvds.ssh: Live operation not supported on ${VM_MAD}" + exit 1 +fi + +# Undeployed, or stopped VM state +if [ "$LCM_STATE" = '67' ] || [ "$LCM_STATE" = '68' ]; then + error_message "mvds.ssh: Operation not supported on undeployed/stopped" + exit 1 +fi + QEMU_OPTS='' if [ -n "$CEPH_USER" ]; then