VMware server control scripts
VMware’s free VMware Server product ships with several command line utilities for controlling the server; the vmware-cmd program, in particular, offers control over starting, stopping, registering, and what not on virtual machines. vmware-cmd is a little clunky to use, though, because it requires an absolute path to the virtual machine’s vmx file. And it only works against one virtual machine at a time.
So I made some Ruby scripts to make vmware-cmd a little easier for me to use. Here’s what I’ve got so far:- list: lists what virtual machines are running
- register: registers a virtual machine
- reset: resets a virtual machine
- start: starts a virtual machine
- stop: stops a virtual machine
- unregister: unregisters a virtual machine
- what_is_registered: lists the virtual machine registered on this server
- what_is_not_registered: lists the virtual machines in the virtual machine directory that are not registered
The register, reset, start, stop, and unregister commands all take a list of virtual machines to act against. For example: “register piggy” will register the piggy virtual machine “stop beaker piggy tortoise” will stop the beaker, piggy, and tortoise virtual machines
To use these scripts, you need:- VMware server installed and running on Linux. I doubt the scripts will work on Windows.
- Ruby installed and on your path
- Edit the vmx_control.rb file and change the VmLocation constant, at the top, to contain the location your virtual machines are installed in.
These scripts are unsupported. They are made to work best with my workflow, so if my workflow does not match yours, then modify the scripts however you’d like to make them work best for you.
Download link: vmx_controltar.gz
Leave a Reply