Joe,
Something like this should work:
DISPLAY_NAME=supercoolwebserver cloudmonkey destroy virtualmachine id=$(
cloudmonkey list virtualmachines filter=id displayname=${DISPLAY_NAME} | awk
-F'' '/id/ {print $4}' )
Depending on how you've named your instances, you may need 'name=' or
'displayname='.
Note this won't expunge the instance (add expunge=true to the destroy command
to do this, or use the expunge command). The recover command (also requires the
machine id) will bring a destroyed (but not expunged) instance back to life if
you've made a mistake.
Hope this helps.
Kind regards,
Simon Fiddaman
Innovation Engineer
LeaseWeb Technologies B.V.
T: +31 20 316 0235
M:
E: s.fidda...@tech.leaseweb.com
W: http://www.leaseweb.com
Luttenbergweg 8, 1101 EC Amsterdam, Netherlands
-Original Message-
From: Joe Y. [mailto:jyd...@gmail.com]
Sent: Thursday, December 18, 2014 1:15 PM
To: users@cloudstack.apache.org
Subject: Script to destroy vms
Can anyone point me to a script or way of destroying virtual machines via cli?
In cloud monkey I only see destroy by I'd but I'd like to be able to via
display name...thanks for the help!