VMware
1 2 3 4 Previous Next 55 Replies Last post: Dec 30, 2008 5:06 AM by solsie  

Backup vbscript for VMWare Server: Only ~1min downtime posted: Dec 6, 2007 7:22 PM

Click to view zgn667's profile Novice 16 posts since
Oct 26, 2007
I've been working on this script for the last week for my school's admission office. I'm no vbscript expert, but I know enough to get things to work. The script is able to achieve minimal downtime by using Microsoft's volume shadow copy service (the script will work only for Windows XP and Windows Server 2003; it may work for Vista as well, if you can find vshadow.exe for it), which you'll have to download (search vss sdk at http://www.microsoft.com/). This script is and adaptation of a script previously posted in this forum by saxa which can be found here: http://communities.vmware.com/thread/54782. Make sure to read all the comments in the beginning and follow any instructions. I haven't tested very thoroughly, so if you find problems, tell me and I can try to fix them. Enjoy! (The script is attached) Do not just run it; save it then right click edit it to read the comments in notepad.

-Zack Nicolaou
Attachments:
Click to view ktlevy's profile Lurker 5 posts since
Nov 28, 2007

I can't seem to get the script to run properly. Whenever I run it, I get the following error:


The Backup Script for VMware Server couldn't create an appropriate connection.
Please check if all of the VMWare Services are up and running.
Please keep in mind, you can run this script on the local host only.

I am running VMware 1.04 and have VMware tools installed on my virtual machine.

Any ideas?

Click to view Gigaguy's profile Novice 17 posts since
Dec 2, 2007
Where do I get the copyfiles.bat and callback.bat? Can I create them myself? Also, I keep getting the same error as ktlevy when trying to run the script. The script from the original post works fine.

Thanks.
Click to view Gigaguy's profile Novice 17 posts since
Dec 2, 2007

Ok, I had an error with CDO, so I just commented out all the "mailing" references. Now I am getting a VShadow error. The VM does actually shut down, but never restarts (im guessing because the script errors). The Vshadow error is "The backup script couldn't create a valume shadow or couldn't copy the files from the volume shadow". vshadow.exe is both in my path and the directory I am running the script from. And is enabled for the source drive (Where the VM's are).

Thanks.

Click to view Gigaguy's profile Novice 17 posts since
Dec 2, 2007

Ok, still having CDO mail issues, but I figured out the issue. My VM drive is E: not C:, the script line 657 is hard-coded to C:. Any idea on how to get email working? I checked google and done all the reinstall, and re-registering of dlls already.

Thanks, Great script !!!!!!

Click to view ktlevy's profile Lurker 5 posts since
Nov 28, 2007
I figured out what my problem was. I'm running Windows 2003 R2 Enterprise Edition 64-bit and things were not working properly because the default cscript.exe in c:\windows\system32 was the 64-bit version. Once I made the 32-bit version in c:\windows\syswow64 the default version, the script ran properly. I had also discovered the hardcoded C: issue and changed that to D:
Click to view walter81's profile Lurker 4 posts since
Dec 4, 2007

Hi

I'm trying to get this to work, but the Virtual Machine won't shut down. What could be the cause (and are there alternative ways to automaticall shut it off?). We use VMWare Server 1.04 (for as much as that matters)

thanks in advance for any help!

Click to view Gigaguy's profile Novice 17 posts since
Dec 2, 2007
Make sure you have VMTools installed on the Virtual Machine. Also, the suggestion above, to comment out line 64 "On Error Resume Next", will give you a more informative error.
Click to view walter81's profile Lurker 4 posts since
Dec 4, 2007

okay, now I get this output:

C:\scripts>cscript.exe vm-vss-backup.vbs "e:\Virtual Machines\PPS_SR_WSUS\Window
s Server 2003 Standard Edition.vmx"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

The Backup Script for VMware Server couldn't create a volume shadow or couldn't
copy the files from the volume shadow.

I did install the Volume Shadow client, and I added the path %programfiles%\....\release-server directory to the %path% variable And I've placed shadow.exe in the script directory.


VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities