VMware Communities > VMTN > Archives > Desktop and Server Archives > VMware Server Archives > Discussions
This thread is archived
9 Replies Last post: Jul 19, 2004 6:11 AM by epping

GSX Server V3 - virtual machine backups

May 11, 2004 6:34 AM

Click to view forearms's profile Novice forearms 28 posts since
May 11, 2004
Hello,

Configuration
GSX Server v3.0
4-way Proliant 8000 (P3-Xeon 550mhz)
4 gigs of memory
local and SAN attached storage.

At this present time I have 7 virtual windows 2000 professional desktops running on off this platform. Mostly we used it to consolidate our desktop pc's that run various lotus notes clients.

My question is related to backing up these virtual machines. I am able to have downtime (at least for the virtual workstations) because of the nature of how Lotus Notes replicates its databases.

I would like to know if anybody has created any scripts or bat files that can be run on the HOST GSX server. Specifically I would like to shutdown or powerdown the "guest operating systems" then copy the vmdk files off to another volume on the HOST GSX server. After the copy is complete have the same script restart the "virtual workstation". I can then use a regular backup application to backup the "copy" of the vmdk files that exist on the other volume of the HOST GSX server.

Does something like this sound feasible? In the near future we will be adding some additional "virtual WIN2K server" sessions as well. I believe at that point I will have to look to get "backup agents" for the virtual server.

thanks for your time

Forearms
Re: GSX Server V3 - virtual machine backups May 11, 2004 11:17 AM
Click to view AlexC's profile Lurker AlexC 8 posts since
May 10, 2004
Hi!

You can try this (text from http://www.vmware.com/support/gsx3/doc/):

Using a Backup Agent Running on the Host Operating System:

Another backup method uses a backup agent running on the GSX Server host. You
back up a virtual machine by suspending and resuming it with batch files containing
vmware-cmd commands. Suspending a virtual machine puts it in a state in which
the host backup software can gain exclusive access to the virtual machine files to
complete its task.
Your suspend batch file should contain the following line:
vmware-cmd <path_to_config>\<config>.vmx suspend
Once the virtual machine is suspended, you can safely back up this virtual machine's
directory using a backup agent installed on the GSX Server host.
After the backup job completes, you would run a resume batch job to restart the
virtual machine. The batch file should contain the following line:
vmware-cmd <path_to_config>\<config>.vmx start
C HA P T E R 4 Managing Virtual Machines and the VMware GSX Server Host
121
This resumes the virtual machine into an active, running state.
If you want to restore a virtual machine to a server other than the GSX Server host
where it was originally located, shut down the virtual machine. Instead of using the
suspend batch file, use one that powers off the virtual machine.
vmware-cmd <path_to_config>\<config>.vmx stop
The suspend, stop and resume commands can be used in pre- and post-job scripts
that are normally available via the backup software being used. Backup software such
as Veritas Backup Exec has the capability to run pre- and post-batch jobs with
scheduled backups.

Regards,

Alex.
Re: GSX Server V3 - virtual machine backups May 12, 2004 5:22 AM
in response to: AlexC
Click to view forearms's profile Novice forearms 28 posts since
May 11, 2004
thanks for your reply. The benefit from my perspective is I don't have to manage the backups for the HOST server as much. Currently with seven virtual sessions i would have to have seven different backup jobs to do pre/post commands as you suggested. I would not want all seven sessions "suspended" at one time. That is why I asked about scripting the shutdown of the virtual sessions.

Another thing that I have noticed is that while you can "suspend" a virtual, it looks like when you "resume" the virtual (usign DHCP) don't get an IP back without doing a ipconfig /renew. So for me I think the "stop" is better than "suspend"

One final thought. If I could get this answered my scripts should work fine. The bat/cmd that I created appears to fail directly after I use the vmware-cmd. Meaning after the command completes succesfully it closes out the command shell and does not continue with the next few lines of the script.

Any ideas on why vmware-cmd acts in this way?

thanks again
Forearms
Re: GSX Server V3 - virtual machine backups May 12, 2004 5:30 AM
in response to: forearms
Click to view forearms's profile Novice forearms 28 posts since
May 11, 2004
here is a copy of my script so you have a better understanding what the previous statement was referring too.

After the vmware-cmd command runs the command shell closes and never types "Done with suspending virtual session - press any key to continue"

START SCRIPT
d:
cd "backups\WIN2K Server-vmware-v3"
del *.* /q
"c:\Program Files\VMware\VMware GSX Server\vmware-cmd" -v "d:\WIN2K Server-vmware-v3\win2000Serv.vmx" stop trysoft
echo Done with suspending virtual session - press any key to continue
echo with the backup process
pause
copy "d:\WIN2K Server-vmware-v3\*.*" "d:\backups\WIN2K Server-vmware-v3\"
echo all done with backup - press any key to restart virtual session
pause
"c:\Program Files\VMware\VMware GSX Server\vmware-cmd" -v "d:\WIN2K Server-vmware-v3\win2000Serv.vmx" start
echo all done restarting - press any key to close this window
pause
END SCRIPT
Re: GSX Server V3 - virtual machine backups May 12, 2004 9:44 AM
in response to: forearms
Click to view forearms's profile Novice forearms 28 posts since
May 11, 2004
well I figured out a way to get my script to work properly.

If I call a seperate bat/cmd file for the vmware-cmd command that I want to run it works fine

something within the nature of how the vmware-cmd works kills the command shell, however if you call it in it's own command shell your main bat file will still function. You just have to make sure that anytime you want to manipulate virtual machines with the vmware-cmd that you do so within it's own bat file.

here is an example

START SCRIPT
@echo off
d:
cd backups
del "d:\backups\WIN2K Server-vmware-v3\*.*" /q
del "d:\backups\WIN2K-test-for-vmware-v3\*.*" /q
call c:\stop.bat
echo Done with stopping virtual server - now backing up virtual server
copy "d:\WIN2K Server-vmware-v3\*.*" "d:\backups\WIN2K Server-vmware-v3\"
echo backup complete, now restarting virtual server
call c:\start.bat
call c:\stop2.bat
echo Done with stopping virtual desktop - now backing up virtual workstation
copy "d:\WIN2K-test-for-vmware-v3\*.*" "d:\backups\WIN2K-test-for-vmware-v3\"
echo backup complete, now restarting virtual workstation
call c:\start2.bat
END SCRIPT

START SCRIPT
@echo off
"c:\Program Files\VMware\VMware GSX Server\vmware-cmd" -v "d:\WIN2K Server-vmware-v3\win2000Serv.vmx" stop trysoft
END SCRIPT

START SCRIPT
@echo off
"c:\Program Files\VMware\VMware GSX Server\vmware-cmd" -v "d:\WIN2K Server-vmware-v3\win2000Serv.vmx" start
END SCRIPT

thanks for your help
Forearms
Re: GSX Server V3 - virtual machine backups May 13, 2004 6:35 AM
in response to: forearms
Click to view mntc's profile Lurker mntc 1 posts since
May 13, 2004
Hi guys, my problem is that i can't turn off my virtual machines!! How can I perform backups?
Can VMware VirtualCenter help me? or I have another solution?

Thanks
Re: GSX Server V3 - virtual machine backups Jul 16, 2004 6:26 AM
in response to: mntc
Click to view toddk's profile Lurker toddk 3 posts since
May 4, 2004
Look into an Open File Backup solution. Something like St. Bernard......
Re: GSX Server V3 - virtual machine backups Jul 16, 2004 8:18 PM
in response to: toddk
Click to view KevinG's profile Guru KevinG 16,898 posts since
Jan 8, 2004
VMware Moderator
Hi Forearms,

If you add "call" before each vmware-cmd command, you would not need separate batch files.

Example:

call vmware-cmd <path_to_vmx_file> suspend
Re: GSX Server V3 - virtual machine backups Jul 16, 2004 9:47 PM
in response to: toddk
Click to view kharbin's profile Master kharbin 1,346 posts since
Nov 7, 2003
Open file backups won't work with VMware since the disk file would be backed up in an inconsistant state. When restored, It would not turn on. Thats why ESX has REDO logs, to get around this problem.

I suspend and copy mine. works well.
Re: GSX Server V3 - virtual machine backups Jul 19, 2004 6:11 AM
in response to: kharbin
Click to view epping's profile Expert epping 794 posts since
Oct 9, 2003
Hi if your host is win 2003 have u looked into using volume shadow service. it allows u to take hot backups without having to shut down the guests. the latest versions of veritas backup exec and netbackup can use this technology.
Actions