--------General Backup Information for virtual machines:-----------
The best way to back-up Virtual machines that require 24x7 uptime is to load a back-up agent in the virtual machine that will connect directly through your network to your back-up servers. This will allow you to completely back-up individual files on your virtual machines and recover files individually.
Your entire VMware server can also be backed up by shutting down all virtual machines and then backing up the VMware server and all virtual machine directories. This will give you a complete back-up set for your VMware Server environment from that point in time. However, restoring a virtual machine directory from such a backup will bring you back to that point in time and individual files in the virtual machine would not be restorable.
Another method involves backing up virtual machines by suspending and resuming a virtual machine. Suspending a virtual machine will put in a state in which backup software can gain exclusive access to the virtual machine files to complete its task. This can be done with a batch file with a line similar to the one below
vmware-cmd c:\vms\win2k\win2k.vmx suspend or vmware-cmd c:\vms\win2k\win2k.vmx stop
The backup of this virtual machine's directory would now be safe for a clean backup. After the backup job for the virtual machine is completed you would need to run a resume batch job to restart the virtual machine using a line as such
vmware-cmd c:\vms\win2k\win2k.vmx start
This line would resume your virtual machine into an active, operational state. Virtual machines backed up while they are shutdown may be restored to other servers besides the VMware server they were originally were housed. These commands may be used in pre/post job scripts that are normally available via the backup software being used. Veritas Backup Exec should have the capability to run pre/post batch jobs with scheduled backups.
Virtual machine directories should not be backed up on the VMware server host if they are in a running state. They should be either suspended or shutdown before proceeding to backup a virtual machine directory. This can cause virtual machines to hang and be unreachable. Open file agents loaded on the VMware server do not always work reliably when backing up open virtual disks that will be gigabytes in size.
Please test and document any backup schemes in advance before implementing them. This will help insure successful backup and restores may be completed by yourself and others and that the scheme fits your needs.
Batch file example:
The startup batch file should look the following example:
C:
cd "\Program Files\VMware\VMware Server"
call vmware-cmd <config file> start
NOTE: You may need to include the full path to vmware-cmd in your
batch file, if vmware-cmd is not part of the %PATH% environment variable.
Where <config file> is the path to the virtual machine .vmx file.
Example: c:\..\..\win2kpro.vmx
If your path contains a space, but the path in ""
Example "C:\Virtual Machines\xyz.vmx"
The shutdown batch file should look the following example:
C:
cd "\Program Files\VMware\VMware Server"
call vmware-cmd <config file> stop trysoft
NOTE: You may need to include the full path to vmware-cmd in your
batch file, if vmware-cmd is not part of the %PATH% environment variable.
Where <config file> is the path to the virtual machine .vmx file.
Example: c:\..\..\win2kpro.vmx
The suspend batch file should look the following example:
C:
cd "\Program Files\VMware\VMware Server"
call vmware-cmd <config file> suspend
NOTE: You may need to include the full path to vmware-cmd in your
batch file, if vmware-cmd is not part of the %PATH% environment variable.
Where <config file> is the path to the virtual machine .vmx file.
Example: c:\..\..\win2kpro.vmx
More information for scripting and the use of the vmware-cmd file may be viewed in the following PDF file in Appendix A:
http://www.vmware.com/support/developer/scripting-API/doc/Scripting_API.pdf