Backup script issue, in Virtual Server 2005
ASP Developer Network - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com

Menu

ASPDeveloper.Net / VirtualServerFAQ.COM

Make sure you go to our home page for:

* Virtual Server 2005 FAQ
* ASP.Net 2.0 Information
* ASP.Net 2.0 Streaming Tutorials
* ASP.Net 2.0 HTML based Tutorials

Made possible by Business Internet Technology Shop (BitShop)



View :  Show duplicate posts
Virtual Server 2005

Recent Virtual Server 2005 posts

BUG? Configuration link incorrectly references Network Service
any help to download the hotfix 872952.
Virtual Server on the Internet
Using VPN on Virtual Machine
HELP!!! - Windows Delayed Write Failure
What"s the best way to "back up" a Virtual Machine OS?
Should the parent disk of a differencing disk be sysprep"d?
Setup for using HOST nic for network access
Should differencing disks be marked read-only?
processor for virtual machine
Help needed, might be routing problem.
Virtual Server 2005 R2 Internal NIC Throughput?
Virtual Machine From Differential Disk
How to get to my virtual machine (newbie question)
Deployment Question
VM shutdown script
Solaris10 -> Installation Problems
setting and .VMC
VPC Image with large scsi disk bluescreens in Virtual Server
Moving the virtual machine to a new box
Add Solution

Latest Topics

Table Of Contents


Post Reply |  This is Spam! | Mark as Spam

Backup script issue

Source: microsoft.public.virtualserver
Sent: 05/08/2006
From: "Nostromo99" <(email address - cut out)>
Message:

Hi, i'm trying to use a script that shuts down a VM, copies it and
starts it.
Part of the code is the following:

'State Turned off = 1 Saved = 2
Const Saved = 1

Const Running = 5
Const Stopped = 1
Const Saving = 7

'---current date dd-mm-yyyy
strToday = Day(Date) & "-" & Month(Date) & "-" & Year(Date)

'---Define Variables
strVMName = "VPRJSRV"

strVMFolder = "C:\VMACHINES\VPRJSRV"
strBackupFolder = """E:\Backup VMACHINES"""



strBackupFile = Chr(34) & strBackupFolder & "\" & _
strVMName & "_" & strToday & ".bkf" & Chr(34)
'---Chr(34) is used to include a quote in the string
strJobName = Chr(34) & strToday & " Full Backup" & Chr(34)
strDescription = Chr(34) & "Starting " & strToday &Chr(34)
strNTBackupCommand = "ntbackup backup " & strVMFolder & _
" /J " & strJobName & " /D " & _
strDescription & " /F " & strBackupFile

'---instantiate VServer Object
Set objVirtualServer = _
CreateObject("VirtualServer.Application")

'---instantiate VM Object
Set objVirtualMachine = _
objVirtualServer.FindVirtualMachine(strVMName)

'----turn off
Set objGuestOS = objVirtualMachine.GuestOS
objGuestOS.Shutdown()
strVMState = objVirtualMachine.state

'---wait for save state to finish
Do Until strVMState = Saved
WScript.Sleep(100000) ' 100 seconds delay
strVMState = objVirtualMachine.state
Loop

The problem appears on the line that sets objGuestOS. I get the message
that the variable is undefined. I have installed the VM additions on
the VM (VPRJSRV).
I don't understand why it can't set this variable...
The actual error message is "variable is undefined 'objGuestOS'...

Any suggestions?



Post Reply |  This is Spam! | Mark as Spam

Related Messages


Post Reply |  This is Spam! | Mark as Spam


Table Of Contents



Other groups

 
Virtual PC (Mac)(3592) Virtual PC(12844) Virtual PC (French)(496)
Virtual Server 2005(6245)
Search
in:
Our Sponsors
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
rss Wiki rss Blogs rss Articles rss Image galleries rss File galleries rss Forums rss Maps rss Directories
ASP Developer Network (since 1996) - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com
Copyright © 1997-2005 by BitShop, Inc. All Rights Reserved.
No content may be reproduced in any form without written permission from BitShop, Inc.
We will be honored to assist with reproduction rights on our material if you contact us.
We also can provide print articles for your magazine, private training seminars at your site, and conference presentations.

Thank you for visiting. Please bookmark our site if you found it useful!
If you wish to make a donation it will help further the development of these free resources: