VMWare for the win

vmware

vmware


I always push VMWare because I use it a *LOT* and believe it to be a superior product. My friend Dann was no exception. When it came time for him to get a new server I suggested he could do several virtual machines on one good physical box and save his resources.

He did the same type of install on his server that I did, and that was to install CentOS 5.3 as a base and put VMWare Server 2 on it to handle his virtual infrastructure. Now for me, this has been bulletproof. Dann has had a couple minor instances where his VMs lost their registration after a power failure and he had some issue connecting to the web interface to fix it.

Anyway, the reason for this post is that there have been a couple instances where managing VMWare Server 2 from the command line have been a big help. It’s not readily apparent that you *can* manage it via the command line and the information was hard to come by, so I thought putting it here for my future reference was probably a good idea.

The command you mostly need to be concerned with is “vmrun”. The tricky part is the switches afterward. Some examples:

List Running VMs:
vmrun -T server -h https://localhost:8333/sdk -u root -p rootpassword list
List Registered VMs:
vmrun -T server -h https://localhost:8333/sdk -u root -p rootpassword listRegisteredVM
Start a VM:
vmrun -T server -h https://localhost:8333/sdk -u root -p rootpassword start "[standard] ogopogo/ogopogo.vmx"
Stop a VM:
vmrun -T server -h https://localhost:8333/sdk -u root -p rootpassword stop "[standard] ogopogo/ogopogo.vmx"

The biggest issue is just getting the syntax correct in as far as the name and location of the VM. My suggestion would be to list them, and then copy that output and enclose in quotes for your start and stop commands. In particular, vmware seems to use [standard] as it’s default volume name reference, so, as is listed above, my machine Ogopogo is listed and referenced at “[standard] ogopogo/ogopogo.vmx” or vmrun will just error out.

Hope this helps!

Be Sociable, Share!

Leave a Reply

You must be logged in to post a comment.