VMware control from Python

.!.

Peach 2.0 development is blazing along, at some point I needed a python module to control a vmware server to allow for automatic start, stop and reverting.  I figured I’d release this useful bit of code as a python module.

Available here

from vix import Vix
import time

vm = Vix()

print "Connecting"
vm.Connect()

print "Opening vm"
vm.Open("E:\\VMs\\Windows XP\\Windows XP Professional.vmx")

#print "Powering On vm"
#vm.PowerOn()
#print "Waiting a bit..."
#time.sleep(10)
#print "Powering off vm"
#vm.PowerOff()

print "Reverting to snapshot 0"
vm.GetRootSnapshot()
vm.RevertToSnapshot()

print "Sleeping"
time.sleep(10)

print "Disconnecting"
vm.Disconnect()

~ by meddington on January 30, 1999.

2 Responses to “VMware control from Python”

  1. Any chance you have the source code available?

  2. Yes, if you follow the provided link you will find the source available.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.