Mar 312009
 

Welcome to part 2 of the “HowTo List Virtual Machines using Python and CIM“. In this part, I modified the original script so that you can pass the Virtual Machine name as well as run it with out the Virtual Machine name. In the first part of this HowTO I created the listVMsInfo.py script witch just listed all the Virtual Machines. So please enjoy the script and hopefully it will make your life just a bit easier.

python listVMsInfo.py -u "http://esxhost" -a "login passwd" -n "testVM"
VM Name 		 testVM
Operating System 	 Suse Linux Enterprise Server 10 (32-bit)
Host Name 		 None
IP Address 		 None
DataStore Used 		 [Esxtestvol] testVM.vmxRequested
State 	 Not ApplicableOperational
Status 	 Enabled
Enabled by Default 	 Enabled
Enabled State 		 Not Applicable

Download this script here!
Download


Warning: fopen(/home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/lib/standard.txt) [function.fopen]: failed to open stream: No such file or directory in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 104

Warning: fread(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 105

Warning: fclose(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 106
.