Alfred's New Ramblings

Administrating VMware Server’s Guest OS using scripts

Sometimes you need to control the guest OS or the virtuals by script. Good example is stopping all the guests or virtuals to take a backup. For VMware server, this is controlled by using Perl script via vmware-cmd.

The pre-requisite is the installation of VMTools. Yes, it will work even if vmhgfs and vmxnet are not available.

To stop a guest OS

call vmware-cmd “d:\virtual machines\red hat1\red hat1.vmx” stop
ntbackup backup “d:\virtual machiens\red hat1\” .. .. .. ..

To start a guest OS

call vmware-cmd “d:\virtual machines\red hat1\red hat1.vmx” start

Put the above into a batch file and use a scheduled task to control the timing and it is done! It is possible to take a snapshot but that can be quite slow.

On the backup server using Veritas or Arcserve, use the Pre/Post option to stop and start the guest OS. A separate job is necessary as the backup job start time and the actual backup time may differ too much.

There is an entry on Petri, but the program to call is wrong. The correct article is here

Leave a Reply

Your email address will not be published. Required fields are marked *