Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/193326
Change subject: Modify cold-migrate script: ...................................................................... Modify cold-migrate script: - Now it takes an ID rather than a name and a project. - Now has a usage statement! Change-Id: I750b52fe1506c97623d6db3e791621a546341a8f --- M modules/openstack/files/icehouse/virtscripts/cold-migrate 1 file changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/26/193326/1 diff --git a/modules/openstack/files/icehouse/virtscripts/cold-migrate b/modules/openstack/files/icehouse/virtscripts/cold-migrate index 2572afc..6069b9b 100755 --- a/modules/openstack/files/icehouse/virtscripts/cold-migrate +++ b/modules/openstack/files/icehouse/virtscripts/cold-migrate @@ -9,11 +9,14 @@ echo "You must have a forwarded agent to use this script" exit 1 fi -INSTANCENAME=$1 +if [ "$#" -ne 2 ]; then + echo "Usage: $0 <instance-id> <destination-host>" + exit 1 +fi +INSTANCE=$1 TOHOST=$2 -PROJECT=$3 -FROMHOST=`OS_TENANT_NAME=${PROJECT} nova show ${INSTANCENAME} | grep 'OS-EXT-SRV-ATTR:host' | awk '{ print $4 }'` -INSTANCE=`OS_TENANT_NAME=${PROJECT} nova show ${INSTANCENAME} | grep ' id ' | awk '{ print $4 }'` +FROMHOST=`nova show ${INSTANCE} | grep 'OS-EXT-SRV-ATTR:host' | awk '{ print $4 }'` +INSTANCENAME=`nova show ${INSTANCE} | grep ' name ' | awk '{ print $4 }'` echo "Migrating $INSTANCE from $FROMHOST to $TOHOST" echo "" echo "Destroying instance on $FROMHOST" -- To view, visit https://gerrit.wikimedia.org/r/193326 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I750b52fe1506c97623d6db3e791621a546341a8f Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits