View on GitHub

pyvmomi-community-samples

A place for community contributed samples for the pyVmomi library.

Welcome to the pyvmomi-community-samples project

This is a place for anyone to learn about working with the vSphere Management SDK's native python binding library pyVmomi. Samples here are contributed by developers like you and curated by your fellow developers. The quality and validity of the samples will vary, however, if you see a problem report it! If you can solve someone's problem, contribute a fix! If you need a new sample ask for one!

Getting Started

First, you'll need a functioning Python environment. This may differ by operating system and distribution.

  1. get Python
  2. get pip (Note: see the package manager section)
  3. get pyvmomi using pip

 $ pip install pyvmomi

Now you are ready to get and use the samples project:

 $ git clone https://github.com/vmware/pyvmomi-community-samples.git

If you can't use git for some reason, you can download the tar or zip file instead.

Reporting a problem or requesting a missing sample

Simply file a issue on at pyvmomi-community-samples/issues please start requests for new samples with the words: "New Sample:" to help our triage folks identify the sample request.

Contributing a sample

First read up on github forks so you know the basic terms for how to work with github. We are asking that you branch each new sample independently for sanity's sake. This lets you submit multiple samples at one time and lets us evaluate multiple samples independently.

  1. fork the repository
  2. clone your fork locally
  3. make a branch for your sample and check it out
  4. commit the branch to your repo
  5. make a pull request

Some notes on branching, editing code, then pushing the code back up to github...

NOTE: fork first

 $ git clone git@github.com:your_user_name/pyvmomi-community-samples.git
 $ cd pyvmomi-community-samples
 $ git branch your_sample_name
 $ git checkout your_sample_name
 $ vim samples/your_sample_name.py
 $ git add samples/your_sample_name.py
 $ git commit
 $ git push origin your_sample_name

Now you're ready to create a pull request to the official project.

Synchronizing your fork with the main project

See this guide for the best practice on how to do this.

  $ git checkout master
  $ git remote add vmware git@github.com:vmware/pyvmomi-community-samples.git
  $ git fetch vmware master
  $ git rebase vmware/master
  $ git push origin master