Source

psphere /

Filename Size Date modified Message
.settings
doc
examples
psphere
resources
scripts
112 B
282 B
578 B
11.1 KB
181 B
1.6 KB
15 B
47 B
702 B

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.