During one of my engagements as a Professional Services Consultant I needed to upgrade a vSphere 5.1 environment to vSphere 6.
Not really exciting when you have enough hosts available to play with. But one of the things that I stumbled into is that I wanted to have a list of all the VM’s that are hosted within the vSphere environment.
One of the ways to do this is to browse trough the web-client and select the Data Center (or vCenter Server) object and look / export / copy-paste the VM’s from the related objects VM tab.
As being a CLI guy for a few years I expected that the vCenter Server or the ESX hosts had this functionality build in… well I was wrong. So after using Google over and over again I discovered that I needed to do this either trough Python or trough Power-shell.
In this post I am going to explain you the Python way. This is really going to a “beginners” guide as I needed to start from the beginning as well.
Below you will find the steps that I had to take (as an absolute vSphere + python beginner) to gather a list of VM’s with python.
- Install OSX on a separate VM (using Fusion)
- Verify the default python version that came with Yosemite
- Install pip
- Use pip to install pyvmomi
- Verify version pyvmomi
- Create a new user in vCenter to make python calls to vCenter Server
- Execute one of the sample Python scripts in the sample directory (getallvms.py)
- Alter the getallvms.py script to only show virtual machine names
- Execute getallvms.py again
- Try another script that provides information about VM’s
Install OSX on a separate VM 〈using Fusion〉
When you are playing around with scripts it is better to not do this form your “production” environment but form a “development” environment because you can break things or ending up installing unnecessary add-ons.
As I am using a Mac I decided to install a new copy of OS X trough VMware Fusion. The procedure for this can he found here. I installed Yosemite.
Verify the default python version that came with Yosemite
The OS X installation came with a pre-installed version of Python. To verify this version we need to issue the following command:
Iwans-Mac:~ iwanhoogendoorn$ python --version Python 2.7.10In my case version 2.7.10 was pre-installed.
Install pip
Now we need to install pip. Pip is a package management system used to install and manage software packages written in Python. We need this to install pyvmomi.
Iwans-Mac:~ iwanhoogendoorn$ sudo easy_install pipUse pip to install pyvmomi
We are using pip to install pyvmomi.
Iwans-Mac:~ iwanhoogendoorn$ sudo pip install pyvmomiVerify version pyvmomi
Because its pyvmomi and Python are very picky with version compatibility it is good to know what version pyvmomi was installed.
Iwans-Mac:~ iwanhoogendoorn$ /usr/local/bin/pip show pyvmomi---Metadata-Version: 1.1Name: pyvmomiVersion: 6.0.0.2016.4Summary: VMware vSphere Python SDKHome-page: https://github.com/vmware/pyvmomiAuthor: VMware, Inc.Author-email: jhu@vmware.comLicense: License :: OSI Approved :: Apache Software LicenseLocation: /Library/Python/2.7/site-packagesRequires: requests, sixClassifiers: Development Status :: 5 - Production/Stable License :: OSI Approved :: Apache Software License Intended Audience :: Information Technology Intended Audience :: System Administrators Intended Audience :: Developers Environment :: No Input/Output (Daemon) Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.2 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Topic :: Software Development :: Libraries :: Python Modules Topic :: System :: Distributed Computing Operating System :: Microsoft :: Windows Operating System :: POSIX Operating System :: Unix Operating System :: MacOSGet pyvmomi repo from github
The pyvmomi repo consists of sample scripts that can be used to test out stuff. We need to download / clone this repo to our own computer.
Iwans-Mac:~ iwanhoogendoorn$ git clone https://github.com/vmware/pyvmomi.git
Iwans-Mac:Downloads iwanhoogendoorn$ lspyvmomi
Iwans-Mac:Downloads iwanhoogendoorn$ cd pyvmomi
Iwans-Mac:pyvmomi iwanhoogendoorn$ ls -ltotal 96-rw-r--r-- 1 iwanhoogendoorn staff 11510 Jun 8 23:51 LICENSE.txt-rw-r--r-- 1 iwanhoogendoorn staff 117 Jun 8 23:51 MANIFEST.in-rw-r--r-- 1 iwanhoogendoorn staff 238 Jun 8 23:51 NOTICE.txt-rw-r--r-- 1 iwanhoogendoorn staff 4513 Jun 8 23:51 README.rstdrwxr-xr-x 5 iwanhoogendoorn staff 170 Jun 8 23:51 docsdrwxr-xr-x 5 iwanhoogendoorn staff 170 Jun 8 23:51 pyVimdrwxr-xr-x 18 iwanhoogendoorn staff 612 Jun 8 23:51 pyVmomi-rw-r--r-- 1 iwanhoogendoorn staff 27 Jun 8 23:51 requirements.txtdrwxr-xr-x 4 iwanhoogendoorn staff 136 Jun 8 23:51 sample-rw-r--r-- 1 iwanhoogendoorn staff 75 Jun 8 23:51 setup.cfg-rw-r--r-- 1 iwanhoogendoorn staff 2451 Jun 8 23:51 setup.py-rw-r--r-- 1 iwanhoogendoorn staff 24 Jun 8 23:51 test-requirements.txtdrwxr-xr-x 11 iwanhoogendoorn staff 374 Jun 8 23:51 tests-rw-r--r-- 1 iwanhoogendoorn staff 108 Jun 8 23:51 tox.iniCreate a new user in vCenter to make python calls to vCenter Server
When we are executing scripts agains vCenter Server it is the best practice to have a special account for this purpose. Therefore we need to create a new account in vCenter and assign this account to the correct role (preferably Administrators). I have use the following:
UN = pyvmomi-user
PW = VMware 1!
Execute one of the sample Python scripts in the sample directory 〈getallvms py〉
Our first script that we are testing our is the getallvms.py script that is located in the sample folder.
Iwans-Mac:pyvmomi iwanhoogendoorn$ cd sample
Iwans-Mac:sample iwanhoogendoorn$ ls -ltotal 24-rwxr-xr-x 1 iwanhoogendoorn staff 3853 Jun 8 23:51 getallvms.py-rwxr-xr-x 1 iwanhoogendoorn staff 5335 Jun 8 23:51 poweronvm.py
Iwans-Mac:sample iwanhoogendoorn$ python getallvms.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1!Name : vEOS-S14Path : [NFS-VIRTUALIZATION] vEOS-S14/vEOS-S14.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : vEOS-S12Path : [NFS-VIRTUALIZATION] vEOS-S12/vEOS-S12.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : dediPath : [datastore1] NL-RTD01-DEDI01/NL-RTD01-DEDI01.vmxGuest : Ubuntu Linux (64-bit)State : poweredOnIP : 10.11.11.111
Name : dc1-pod12-esx-m-02Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-m-02/dc1-pod12-esx-m-02.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod12-esx-m-01Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-m-01/dc1-pod12-esx-m-01.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod12-esx-m-03Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-m-03/dc1-pod12-esx-m-03.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod12-esx-b-02Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-b-02/dc1-pod12-esx-b-02.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod13-control-01Path : [NFS-VIRTUALIZATION] dc1-pod13-control/dc1-pod13-control.vmxGuest : Microsoft Windows Server 2012 (64-bit)State : poweredOnIP : 2002:c00d:dc0a::c00d:dc0a
Name : dc1-pod12-control-01Path : [NFS-VIRTUALIZATION] dc1-pod12-control-01/dc1-pod12-control-01.vmxGuest : Microsoft Windows Server 2012 (64-bit)State : poweredOnIP : 2002:c00c:dc0a::c00c:dc0a
Name : dc1-pod12-esx-a-02Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-a-02/dc1-pod12-esx-a-02.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod11-esx-m-04Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-m-04/dc1-pod11-esx-m-04.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod11-esx-m-03Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-m-03/dc1-pod11-esx-m-03.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod12-esx-b-01Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-b-01/dc1-pod12-esx-b-01.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod11-esx-m-02Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-m-02/dc1-pod11-esx-m-02.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod11-esx-b-02Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-b-02/dc1-pod11-esx-b-02.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod11-esx-a-01Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-a-01/dc1-pod11-esx-a-01.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod12-esx-a-01Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-a-01/dc1-pod12-esx-a-01.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod11-esx-a-03Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-a-03/dc1-pod11-esx-a-03.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : vEOS-L142Path : [NFS-VIRTUALIZATION] vEOS-L142/vEOS-L142.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : dc1-pod11-esx-b-03Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-b-03/dc1-pod11-esx-b-03.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : vEOS-S13Path : [NFS-VIRTUALIZATION] vEOS-S13/vEOS-S13.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : CSR-1000V-R1Path : [NFS-VIRTUALIZATION] CSR-1000V-R1/CSR-1000V-R1.vmxGuest : Other 2.6.x Linux (64-bit)State : poweredOn
Name : vEOS-L141Path : [NFS-VIRTUALIZATION] vEOS-L141/vEOS-L141.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : vEOS-L132Path : [NFS-VIRTUALIZATION] vEOS-L132/vEOS-L132.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : vEOS-L131Path : [NFS-VIRTUALIZATION] vEOS-L131/vEOS-L131.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : dc1-pod11-esx-m-01Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-m-01/dc1-pod11-esx-m-01.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : vEOS-L121Path : [NFS-VIRTUALIZATION] vEOS-L121/vEOS-L121.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : vEOS-L112Path : [NFS-VIRTUALIZATION] vEOS-L112/vEOS-L112.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : vEOS-S11Path : [NFS-VIRTUALIZATION] vEOS-S11/vEOS-S11.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : dc1-pod11-esx-b-01Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-b-01/dc1-pod11-esx-b-01.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : vEOS-L111Path : [NFS-VIRTUALIZATION] vEOS-L111/vEOS-L111.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : dc1-pod11-control-01Path : [NFS-VIRTUALIZATION] dc1-pod11-control-01/dc1-pod11-control-01.vmxGuest : Microsoft Windows Server 2012 (64-bit)State : poweredOnIP : 2002:c00b:dc0a::c00b:dc0a
Name : vEOS-L122Path : [NFS-VIRTUALIZATION] vEOS-L122/vEOS-L122.vmxGuest : Other 2.6.x Linux (32-bit)State : poweredOn
Name : win-01Path : [datastore1-esx-01] win-server/win-server.vmxGuest : Microsoft Windows Server 2012 (64-bit)State : poweredOnIP : 10.11.11.50
Name : dc1-pod11-esx-a-02Path : [NFS-VIRTUALIZATION] dc1-pod11-esx-a-02/dc1-pod11-esx-a-02.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : dc1-pod12-esx-b-03Path : [NFS-VIRTUALIZATION] dc1-pod12-esx-b-03/dc1-pod12-esx-b-03.vmxGuest : VMware ESXi 6.0State : poweredOff
Name : vcsa-01Path : [datastore1-esx-01] vcsa/vcsa.vmxGuest : SUSE Linux Enterprise 11 (64-bit)Annotation : VMware vCenter Server ApplianceState : poweredOnIP : 10.11.11.215As you can see we have gathered a list of all the VM’s and we are using a ready-to-use script that was in the sample directory. The information that we see is Name, Path , Guest and State!
Alter the getallvms py script to only show virtual machine names
But what if we only want to VM names? Then we can alter the script a little. First we copy the script so we have a second script that we can alter and leave our original script unharmed.
Iwans-Mac:sample iwanhoogendoorn$ cp getallvms.py getallvms-only.py
Iwans-Mac:sample iwanhoogendoorn$ lsgetallvms-only.py getallvms.py poweronvm.pyThen alter the script:
Iwans-Mac:sample iwanhoogendoorn$ nano getallvms-only.py summary = vm.summary print("Name : ", summary.config.name) print("Path : ", summary.config.vmPathName) print("Guest : ", summary.config.guestFullName) annotation = summary.config.annotation if annotation != None and annotation != "": print("Annotation : ", annotation) print("State : ", summary.runtime.powerState) if summary.guest != None: ip = summary.guest.ipAddress if ip != None and ip != "": print("IP : ", ip) if summary.runtime.question != None: print("Question : ", summary.runtime.question.text) print("") summary = vm.summary print("Name : ", summary.config.name)# print("Path : ", summary.config.vmPathName)# print("Guest : ", summary.config.guestFullName)# annotation = summary.config.annotation# if annotation != None and annotation != "":# print("Annotation : ", annotation)# print("State : ", summary.runtime.powerState)# if summary.guest != None:# ip = summary.guest.ipAddress# if ip != None and ip != "":# print("IP : ", ip)# if summary.runtime.question != None:# print("Question : ", summary.runtime.question.text) print("")Execute getallvms py again
Iwans-Mac:sample iwanhoogendoorn$ python getallvms-only.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1!Name : vEOS-S14
Name : vEOS-S12
Name : dedi
Name : dc1-pod12-esx-m-02
Name : dc1-pod12-esx-m-01
Name : dc1-pod12-esx-m-03
Name : dc1-pod12-esx-b-02
Name : dc1-pod13-control-01
Name : dc1-pod12-control-01
Name : dc1-pod12-esx-a-02
Name : dc1-pod11-esx-m-04
Name : dc1-pod11-esx-m-03
Name : dc1-pod12-esx-b-01
Name : dc1-pod11-esx-m-02
Name : dc1-pod11-esx-b-02
Name : dc1-pod11-esx-a-01
Name : dc1-pod12-esx-a-01
Name : dc1-pod11-esx-a-03
Name : vEOS-L142
Name : dc1-pod11-esx-b-03
Name : vEOS-S13
Name : CSR-1000V-R1
Name : vEOS-L141
Name : vEOS-L132
Name : vEOS-L131
Name : dc1-pod11-esx-m-01
Name : vEOS-L121
Name : vEOS-L112
Name : vEOS-S11
Name : dc1-pod11-esx-b-01
Name : vEOS-L111
Name : dc1-pod11-control-01
Name : vEOS-L122
Name : win-01
Name : dc1-pod11-esx-a-02
Name : dc1-pod12-esx-b-03
Name : vcsa-01We have now “hacked” into the script, but there are also some other scripts available on the internet that we can try.
Try another script that provides information about VMs 〈py-vminfo py〉
After searching for some scripts that can provide me information about specific VM’s I came across this script (py-vminfo.py).
When executing the script I got an error:
Iwans-Mac:python-vmstats-master iwanhoogendoorn$ python py-vminfo.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1! -m CSR-1000V-R1Could not connect to the specified host using specified username and passwordI was pretty sure that I was using the correct username and password… After asking around and contacting the creator of the script we both discovered that this had to do with the way the script was trying to connect to the vCenter Server.
I have crosschecked the “getallvms-only.py” script that WAS WORKING for me and the “py-vminfo.py” script that WAS NOT WORKING and I discovered some change in the “SmartConnect” part.
Newer versions of vSphere have required certificate verification and a warning was always thrown up… It looks like perhaps this warning turned into a hard STOP unless you provided some sort of SSL override to say “It’s OK I know this cert is self sign - for example - but carry on” This is now taken care of the new SSL code part that I added in the script.
More information regarding this can be found here.
I altered the script a bit with some new parts.
try: si = SmartConnect(host=args.host, user=args.user, pwd=password, port=int(args.port),#import ssl -->added# try: context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) --> added context.verify_mode = ssl.CERT_NONE --> added si = SmartConnect(host=args.host, user=args.user, pwd=password, port=int(args.port), sslContext=context) --> addedAfter I added in the new parts I tested the script again,
Iwans-Mac:sample iwanhoogendoorn$ python py-vminfo-2.py -s vcsa-01.home.local -u pyvmomi-user@sso-iwan.local -p VMware1! -m CSR-1000V-R1
NOTE: Any VM statistics are averages of the last 15 minutes
Server Name : CSR-1000V-R1Description :Guest : Other 2.6.x Linux (64-bit)Snapshot Status : No SnapshotsVM .vmx Path : [NFS-VIRTUALIZATION] CSR-1000V-R1/CSR-1000V-R1.vmxVirtual Disks : Hard disk 1 | 8.0GB | Thin: True | [NFS-VIRTUALIZATION] CSR-1000V-R1/CSR-1000V-R1.vmdkVirtual NIC(s) : Network adapter 1 | vSwitch0 - VLAN20 | 00:50:56:b5:6b:07 Network adapter 2 | CSR-1000-R1-Eth2 | 00:50:56:b5:9f:b2 Network adapter 3 | CSR-1000-R1-Eth3 | 00:50:56:b5:bd:64 Network adapter 4 | CSR-1000-R1-Eth4 | 00:50:56:b5:55:f5 Network adapter 5 | CSR-1000-R1-Eth5 | 00:50:56:b5:b4:f3 Network adapter 6 | VM Network | 00:50:56:b5:0b:7c Network adapter 7 | VM Network | 00:50:56:b5:9b:7e Network adapter 8 | VM Network | 00:50:56:b5:3c:5e Network adapter 9 | VM Network | 00:50:56:b5:de:b2 Network adapter 10 | VLAN11 | 00:50:56:b5:43:9c[VM] Limits : CPU: None, Memory: None[VM] Reservations : CPU: None, Memory: None[VM] Number of vCPUs : 1[VM] CPU Ready : Average 0.0 %, Maximum 0.1 %[VM] CPU (%) : 4 %[VM] Memory : 4096 MB (4.0 GB)[VM] Memory Shared : 0 %, 4 MB[VM] Memory Balloon : 0 %, 0 MB[VM] Memory Swapped : 0 %, 0 MB[VM] Memory Active : 7 %, 276 MB[VM] Datastore Average IO : Read: 0 IOPS, Write: 0 IOPS[VM] Datastore Average Latency : Read: 0 ms, Write: 2 ms[VM] Overall Network Usage : Transmitted 0.000 Mbps, Received 0.000 Mbps[Host] Name : esx-03.home.local[Host] CPU Detail : Processor Sockets: 2, Cores per Socket 12[Host] CPU Type : Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz[Host] CPU Usage : Used: 4037 Mhz, Total: 52680 Mhz[Host] Memory Usage : Used: 52 GB, Total: 256 GBAs a bonus another script to test with 〈vminfo_quick py〉
After searching for more scripts to retrieve information about VM’s a also came across this script(vminfo_quick.py).
I got an error after I executed the script.
Iwans-Mac:sample iwanhoogendoorn$ python vminfo_quick.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1!Traceback (most recent call last): File "vminfo_quick.py", line 19, in <module> from tools import cliImportError: No module named toolsApparently the script is referring to a module “tools”. In the initial git clone that I used it did not contain a “tools” directory where “cli” is in as well. So I needed to clone / download this “tools” folder as well and place it in the sample directory.
I used “Github downloader” to download complete github folders.
Iwans-Mac:Downloads iwanhoogendoorn$ chmod 777 github-downloader.sh
Iwans-Mac:Downloads iwanhoogendoorn$ ./github-downloader.sh https://github.com/vmware/pyvmomi-community-samples/tree/master/samples/toolsExporting https://github.com/vmware/pyvmomi-community-samples/trunk/samples/toolsError validating server certificate for 'https://github.com:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually!Certificate information: - Hostname: github.com - Valid: from Thu, 10 Mar 2016 00:00:00 GMT until Thu, 17 May 2018 12:00:00 GMT - Issuer: www.digicert.com, DigiCert Inc, US - Fingerprint: d7:9f:07:61:10:b3:92:93:e3:49:ac:89:84:5b:03:80:c1:9e:2f:8b(R)eject, accept (t)emporarily or accept (p)ermanently? tA toolsA tools/README.mdA tools/__init__.pyA tools/alarm.pyA tools/cli.pyA tools/cluster.pyA tools/datacenter.pyA tools/interactive_wrapper.pyA tools/pchelper.pyA tools/serviceutil.pyA tools/tasks.pyA tools/vm.pyExported revision 239.I moved the tools folder into the sample folder and run the script again …
Iwans-Mac:sample iwanhoogendoorn$ python vminfo_quick.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1!Unable to connect to host with supplied info.I received another error, and I suspected that this had something to do with the SSL self signed certificate handeling so I started altering the script.
service_instance = connect.SmartConnect(host=args.host, user=args.user, pwd=args.password, port=int(args.port))#import ssl --> added# context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) --> added context.verify_mode = ssl.CERT_NONE --> added service_instance = connect.SmartConnect(host=args.host, user=args.user, pwd=args.password, port=int(args.port), sslContext=context) --> addedI tested the script again.
Iwans-Mac:sample iwanhoogendoorn$ python vminfo_quick.py -s 10.11.11.215 -u pyvmomi-user@sso-iwan.local -p VMware1!----Name: vEOS-S12BIOS UUID: 423550f0-eedf-9c20-93b1-be087fdc6e93CPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod12-esx-m-03BIOS UUID: 42353833-4bd4-6217-47c0-ff1222dbd652CPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod12-esx-m-02BIOS UUID: 42355f0a-d036-b3a4-948e-7747d8ab439aCPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod12-esx-m-01BIOS UUID: 4235c8ec-09d2-dc6e-43ea-3a0d4e2b0628CPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: vEOS-S11BIOS UUID: 4235ae48-650f-dd52-19b3-14883d2206cfCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: vEOS-S13BIOS UUID: 4235e6e3-b135-b0d9-8074-81493a2bd2feCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod12-esx-b-03BIOS UUID: 4235c697-82fb-fdbc-984e-9d174cc54a3fCPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod12-esx-a-02BIOS UUID: 4235dc67-3d20-4ac5-307e-9eca0d7e187cCPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod13-control-01BIOS UUID: 4235b786-5675-ffa9-4101-a912f967f879CPUs: 2MemoryMB: 2048Guest PowerState: runningGuest Full Name: Microsoft Windows Server 2012 (64-bit)Guest Container Type: windows8Server64GuestContainer Version: vmx-11----Name: dc1-pod12-esx-b-01BIOS UUID: 4235800b-7cb9-ef23-1afd-2cfbed4f42baCPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-m-04BIOS UUID: 4235b78e-e0c4-285f-3775-2ef82138aa49CPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-m-02BIOS UUID: 4235c58e-3b1e-73a3-6fb5-5f1021b401d6CPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-b-03BIOS UUID: 423528f7-43ff-e219-9f33-98cabf1f908eCPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-m-03BIOS UUID: 4235e1ea-80db-e693-b75f-a5aaa6a73d9aCPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: vEOS-S14BIOS UUID: 42356933-b536-c3fa-0af7-0d7823c8139fCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod11-esx-a-03BIOS UUID: 4235a69d-242e-0f34-e130-c48fcdb38ed3CPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-b-02BIOS UUID: 42353056-8f5d-e70d-a981-09f3f28602abCPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod12-esx-b-02BIOS UUID: 4235d9f9-2426-cd40-1204-9819aa716fd7CPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-a-01BIOS UUID: 4235b038-f95b-d4cd-0b93-a1975d993490CPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-a-02BIOS UUID: 42358577-ad92-938b-5c3c-232eeef39d98CPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: CSR-1000V-R1BIOS UUID: 4235422e-73c9-ece8-28ab-eba4591a059cCPUs: 1MemoryMB: 4096Guest PowerState: runningGuest Full Name: Other 2.6.x Linux (64-bit)Guest Container Type: other26xLinux64GuestContainer Version: vmx-10----Name: vEOS-L132BIOS UUID: 42350af5-1cbf-c21e-b505-ff6fcc029d8bCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: vEOS-L142BIOS UUID: 42355808-ecff-dc04-aaa1-fff3a4eb0b82CPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: vEOS-L141BIOS UUID: 4235cc90-773d-0b24-8441-9f6211f4419bCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: vEOS-L131BIOS UUID: 4235750e-80b5-2ae0-1ce5-e28139cc093bCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod12-esx-a-01BIOS UUID: 4235b5d8-1cbf-3199-6b9e-8a1f9e59eb54CPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: dc1-pod11-esx-b-01BIOS UUID: 42353446-5b82-c44b-4111-f589540a0fc2CPUs: 2MemoryMB: 8192Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: vEOS-L122BIOS UUID: 4235cb47-a3a9-a097-718a-865beea06fcaCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod12-control-01BIOS UUID: 42351bd7-ec64-35c5-4b70-cdb69c914b12CPUs: 2MemoryMB: 2048Guest PowerState: runningGuest Full Name: Microsoft Windows Server 2012 (64-bit)Guest Container Type: windows8Server64GuestContainer Version: vmx-11----Name: dediBIOS UUID: 4207659f-ad6f-7720-bb2d-5a82795981e6CPUs: 8MemoryMB: 16384Guest PowerState: runningGuest Full Name: Ubuntu Linux (64-bit)Guest Container Type: ubuntu64GuestContainer Version: vmx-11----Name: vEOS-L121BIOS UUID: 4235cd21-525f-d609-e768-c1f7f7ee649fCPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod11-esx-m-01BIOS UUID: 4235fe19-fe92-028c-b25f-0a7e1fb7a8c0CPUs: 4MemoryMB: 16384Guest PowerState: notRunningGuest Full Name: VMware ESXi 6.0Guest Container Type: vmkernel6GuestContainer Version: vmx-11----Name: vEOS-L112BIOS UUID: 42356240-4cfe-84a6-2704-78769eee0f60CPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: dc1-pod11-control-01BIOS UUID: 423585f2-73a0-c872-8522-4be2c1dfae47CPUs: 2MemoryMB: 2048Guest PowerState: runningGuest Full Name: Microsoft Windows Server 2012 (64-bit)Guest Container Type: windows8Server64GuestContainer Version: vmx-11----Name: vEOS-L111BIOS UUID: 4235137a-a2a8-8409-feb8-2b0101dd18f7CPUs: 1MemoryMB: 2048Guest PowerState: notRunningGuest Full Name: Other 2.6.x Linux (32-bit)Guest Container Type: other26xLinuxGuestContainer Version: vmx-11----Name: win-01BIOS UUID: 42356ad0-c9bf-7116-0258-466c0f148ba4CPUs: 4MemoryMB: 8192Guest PowerState: runningGuest Full Name: Microsoft Windows Server 2012 (64-bit)Guest Container Type: windows8Server64GuestContainer Version: vmx-11----Name: vcsa-01BIOS UUID: 564d54fd-ce15-384b-74e9-f1593639618eCPUs: 4MemoryMB: 16384Guest PowerState: runningGuest Full Name: SUSE Linux Enterprise 11 (64-bit)Guest Container Type: sles11_64GuestContainer Version: vmx-08
Found 37 VirtualMachines.Completion time: 0.075805 seconds.Originally published on the old wiki at /index.php/Getting_started_with_vSphere_and_python_scripting_(pyVmomi).