Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

Moved

psphere has moved to GitHub. Apologies to anyone who has open branches, but the inertia behind Git and GitHub is just too great!

Find us at https://github.com/jkinred/psphere

Introduction

psphere is a Python interface for the VMware vSphere Web Services SDK, a powerful API for programatically managing your VMware infrastructure.

psphere allows the creation of standalone Python scripts as well as integration into larger Python applications (e.g. Django) to perform any operation in your virtual infrastructure:

  • Provision, clone and snapshot virtual machines
  • Query and configure clusters, host systems and datastores
  • Programatically configure ESXi hosts (i.e. for automation)

Usage

>>> from psphere.client import Client
>>> client = Client("your.esxserver.com", "Administrator", "strongpass")
>>> servertime = client.si.CurrentTime()
>>> print(servertime)
2010-09-04 18:35:12.062575
>>> client.logout()

The aim of psphere is to implement a Pythonic API covering the entire VMware vSphere Web Services SDK. While many operations using the SDK are straight-forward, there is definitely scope to provide convenient access to common operations on virtual machines and other managed objects. This convenient access is within the realm of higher level library written on top of psphere. A project of this nature has always been my intention and remains high on my wish/TODO list!

Installation

psphere is best installed using the official package:

# pip install -U psphere

This will fetch the latest stable release of psphere and it's dependencies from PyPI.

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.