WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / vSphere / Early Xmas gift from VMware - pyVmomi (vSphere SDK for Python)

Early Xmas gift from VMware - pyVmomi (vSphere SDK for Python)

12.17.2013 by William Lam // 13 Comments

For vSphere customers and partners who use the Python programming/scripting language, Christmas may have just arrived early. I just found today, VMware has published an initial release of their vSphere SDK for Python called pyVmomi on Github this past weekend. A Python-based SDK has always been a very popular feature request among customers and partners that I have spoken with in the past. It looks like VMware Engineering has heard you loud and clear and have been working hard to get this released.

pyVmomi Github Repository:
https://github.com/vmware/pyvmomi

pyVmomi Pypi package:
https://pypi.python.org/pypi/pyvmomi

One of the nice things about releasing pyVmomi on Github versus trying to package it with a particular vSphere release is that the larger VMware community can contribute to the project as well as more frequent updates from VMware. This has also been quite successful for another popular VMware SDK called rbvmomi (vSphere SDK for Ruby) which is seeing a huge uptick with RVC (Ruby vSphere Console) which is built on top of rbvmomi and is a great tool for managing and troubleshooting VMware VSAN.

In this first release, you will notice there is a limited amount documentation and samples exercising the various capabilities of vSphere and you will see further enhancements in these areas with future updates. If there are specific things you would like to see or samples that you think would be useful to have or that you have built, feel free to file an issue or send pull requests to the pyVmomi Github.

If you wish to quickly get started, you can install pyVmomi using a variety of methods including pip, easy_install and pypi package. Below are the steps I took to install pyVmomi on my Mac OS X system using pip and git.

Step 1 - Install pyVmomi using pip by running the following command:

sudo pip install pyvmomi

Step 2 - Clone the pyVmomi Github repo to your system using Git by running the following command:

git clone https://github.com/vmware/pyvmomi.git

After the above command, you will have a folder called pyVmomi which contains the source code as well as the two sample scripts. You can contribute back if you create additional samples or enhancements to pyVmomi by simply sending a pull requests.

Try the getallvms.py sample run the following command:

python sample/getallvms.py --host mini.primp-industries.com --password [PASS]

To try the poweronvm.py sample run the following command:

python sample/poweronvm.py --host mini.primp-industries.com --password [PASS] --vmname [VM]

 
Hopefully we will see many more samples from VMware as well as from our customers who will be using the new SDK. If there is anything that is missing or things you would like to see, feel free to file an issue on pyVmomi Github repository.

More from my site

  • Using the vSphere API to remotely generate ESXi performance support bundles
  • How to run a script from a vCenter Alarm action in the VCSA?
  • Getting started with the new VSAN 6.2 Management API
  • pyvmomi (vSphere SDK for Python) 5.5.0-2014.1 released!
  • How do you "log a reason" using PowerCLI when rebooting or shutting down ESXi host?

Categories // vSphere Tags // ESXi, pypi, python, pyVmomi, sdk, vSphere API

Comments

  1. *protectedRamzan Ali says

    01/18/2014 at 12:08 pm

    what awesome gifts these would make!! Thanks so much to create suggestions to, you're so creative! I'll be trying this out at some part 🙂

    Reply
  2. *protectedJosh Coen says

    02/25/2014 at 1:39 am

    Worked perfectly. Thanks for the walk-through.

    -Josh

    Reply
  3. *protectedmd says

    03/07/2014 at 4:16 am

    Every few months I google around for 'python vmware' hoping to see something new, this has made me very happy

    Reply
  4. *protectedcz says

    04/16/2014 at 8:49 am

    Guess typo: After the above command, you will not have a folder called pyVmomi which contains - should be you WILL have a folder...

    Reply
    • William Lam says

      04/17/2014 at 3:40 pm

      Thanks. I've fixed the typo

      Reply
  5. *protectedReuben says

    09/17/2014 at 5:50 pm

    Please help me for this issue https://communities.vmware.com/thread/490122

    Reply
  6. *protectedRaj says

    01/12/2016 at 9:30 am

    Does pyvmomi support all VASA2.0 calls? If yes, what is plan for VASA3.0 support?.

    Reply
  7. *protectedSreemannarayana Raju says

    02/23/2016 at 1:52 am

    Is there a way to modify the ethernet adapter settings of the ESXI host using pyvmomi ??

    Reply
  8. *protectedvivek kumawat says

    07/19/2017 at 3:29 am

    Is there any way to ssh to a VMware machine through a python script? and that python script we are running on a linux machine.

    Reply

Trackbacks

  1. Having some fun with the Marvel Comics API & vSphere SDK for Python | virtuallyGhetto says:
    03/03/2014 at 2:54 pm

    […] decided to create a sample vSphere SDK for Python (also known as pyvmomi) script that would allow a user to specify a number of random Marvel […]

    Reply
  2. VMware VSAN APIs | virtuallyGhetto says:
    03/20/2014 at 2:48 pm

    […] some sample scripts leveraging some of these API methods. In the meantime, you can check out these RVC (vSphere SDK for Ruby) modules leveraging both VSAN and SPBM APIs here and […]

    Reply
  3. Finding orphaned Virtual Machines – The Python Way » ValCo Labs says:
    05/16/2014 at 2:34 am

    […] about how to install pyVmomi (used to access the vSphere API via Python). You can find the article here. Ok, now I have pyVmomi installed on my system, now what? There are a few sample scripts for how to […]

    Reply
  4. Strategies For Xmas Toys For 30 Year Old Across The USA | M80 Marketing says:
    11/29/2014 at 3:05 pm

    […] (http://funlittlegifts.Co.Uk/) look into our webpage. […]

    Reply

Leave a Reply to czCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025