| Author |
Message |
Butler
Guest
|
Posted:
Sat Jan 08, 2005 2:35 pm Post subject:
Generic Script Resource error |
|
|
I have been trying to use a generic script resource to control MS Virtual
Server 2005. I have been able to use sections of my script at the command
line to control VS but I am getting an error when running through the cluster
service. The Error ID when I try to bring the resource online is 5018
(0000139a). The cluster log file gives me the following errors:
00001160.00000e30::2005/01/08-08:26:15.740 INFO Generic Script <test>:
Loaded script engine 'VBScript' successfully.
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script <test>:
Script Error: Line=2, Character = 0
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script <test>:
Error: 2147943746 (0x80070542) - Description: <null> (Source: <null>)
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script <test>: Error
loading script 'c:\windows\vstest.vbs'. HRESULT: 0x80020009
My script contains:
Dim objVS, objVM, oExec
Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("vstest")
Sub Open( )
End Sub
Function Online( )
Resource.LogInformation "Entering Online"
Select Case objVM.State
Case "0" Set oExec = objVS.RegisterVirtualMachine("vstest.vmc", "I:\vstest")
Do While objVM.State = 0
WScript.Sleep 100
Loop
Set objVM = objVS.FindVirtualMachine("vstest")
If objVM.State = 1 Then
Set oExec = objVM.Startup()
Do While objVM.State = 3
WScript.Sleep 100
Loop
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
ElseIf objVM.State = 2 Then
Set oExec = objVM.Startup()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
If oExec.ExitCode <> 5 Then
Resource.LogInformation "Error performing startup function from saved
state"
Online = 1
End If
ElseIf oExec.Status = 6 Then
Set oExec = objVM.Resume()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
If objVM.State <> 5 Then
Resource.LogInformation "Error resuming from paused state"
Online = 1
End If
Else
Resource.LogInformation "Unknown error after registering Virtual Server"
Online = 1
End If
Case "1" Set oExec = objVM.Startup()
Do While objVM.State = 3
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
Case "2" Set oExec = objVM.Startup()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
Case "3" Resource.LogInformation "Virtual Server is already in the process
of turning on"
Do While objVM.State = 3
WScript.Sleep 100
Loop
Online = 0
Case "4" Resource.LogInformation "Virtual Server is already in the process
of Restoring"
Do While objVM.State = 4
WScript.Sleep 100
Loop
Online = 0
Case "5" Resource.LogInformation "Virtual Server is already running"
Online = 0
Case "6" Set oExec = objVM.Resume()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error resuming from paused state"
Online = 1
End If
Case "7" Resource.LogInformation "Virtual Server is in the process of
Saving"
Do While objVM.State = 7
WScript.Sleep 100
Loop
Online = 1
Case "8" Resource.LogInformation "Virtual Server is in the process of
turning off"
Do While objVM.State = 8
WScript.Sleep 100
Loop
Online = 1
Case Else Resource.LogInformation "Unknown state of Virtual Server"
Online = 1
End Select
End Function
Function Offline( )
Resource.LogInformation "Resource going offline by saving current state of
VS"
Set oExec = objVM.Save()
Do While objVM.State = 7
WScript.Sleep 100
Loop
Offline = 0
If objVM.State <> 1 Then
Resource.LogInformation "Error saving VS state"
Offline = 1
End If
End Function
Function LooksAlive( )
Resource.LogInformation "Entering LooksAlive"
LooksAlive = true
If objVM.State <> 5 Then
Resource.LogInformation "VM state does not look to be Running"
LooksAlive = false
End If
End Function
Function IsAlive( )
Resource.LogInformation "Entering IsAlive"
if objGuestOS.IsHeartbeating=True Then
IsAlive = true
Else
Resource.LogInformation "Heart is not beating"
IsAlive = false
End If
End Function
Function Close( )
Close = 0
End Function
Function Terminate( )
Terminate = 0
End Function
Any idea why the the "Set objVS = CreateObject("VirtualServer.Application")"
line is causing an error?
Thanks for any help you can give!
Chris Butler
chris.butler@rit.edu |
|
| Back to top |
|
 |
Mike Rosado [MSFT]
Guest
|
Posted:
Sat Jan 08, 2005 9:25 pm Post subject:
Re: Generic Script Resource error |
|
|
Hi Chris,
I'm by no means an expert in this subject matter VBS Scripts, but I'll try
to assist you to the best of my ability.
The Event ID 5018 (0000139a) basically means the following:
ERROR_RESMON_ONLINE_FAILED
# The cluster resource could not be brought online by the
# resource monitor.
Then the following error 0x80020009 means an "Exception occurred".
"Error loading script 'c:\windows\vstest.vbs'. HRESULT: 0x80020009"
Not sure why the line "Set objVS =
CreateObject("VirtualServer.Application")" is causing an error. But I'm
sure if you post the original message below to the
"microsoft.public.scripting.vbscript" newsgroup, that someone there might
have experienced the same behavior as you or may be able to give you better
guidance as to how to proceed.
--
Hope this helps,
Mike Rosado
Windows 2000 MCSE + MCDBA
Microsoft Enterprise Platform Support
Windows NT/2000/2003 Cluster Technologies
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
<http://www.microsoft.com/info/cpyright.htm>
-----Original Message-----
"Butler" <Butler@discussions.microsoft.com> wrote in message
news:672020B1-04B4-4011-B8B6-4986AFD297C5@microsoft.com...
| Quote: | I have been trying to use a generic script resource to control MS Virtual
Server 2005. I have been able to use sections of my script at the command
line to control VS but I am getting an error when running through the
cluster
service. The Error ID when I try to bring the resource online is 5018
(0000139a). The cluster log file gives me the following errors:
00001160.00000e30::2005/01/08-08:26:15.740 INFO Generic Script <test>:
Loaded script engine 'VBScript' successfully.
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script <test>:
Script Error: Line=2, Character = 0
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script <test>:
Error: 2147943746 (0x80070542) - Description: <null> (Source: <null>)
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script <test>:
Error
loading script 'c:\windows\vstest.vbs'. HRESULT: 0x80020009
My script contains:
Dim objVS, objVM, oExec
Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("vstest")
Sub Open( )
End Sub
Function Online( )
Resource.LogInformation "Entering Online"
Select Case objVM.State
Case "0" Set oExec = objVS.RegisterVirtualMachine("vstest.vmc",
"I:\vstest")
Do While objVM.State = 0
WScript.Sleep 100
Loop
Set objVM = objVS.FindVirtualMachine("vstest")
If objVM.State = 1 Then
Set oExec = objVM.Startup()
Do While objVM.State = 3
WScript.Sleep 100
Loop
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
ElseIf objVM.State = 2 Then
Set oExec = objVM.Startup()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
If oExec.ExitCode <> 5 Then
Resource.LogInformation "Error performing startup function from saved
state"
Online = 1
End If
ElseIf oExec.Status = 6 Then
Set oExec = objVM.Resume()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
If objVM.State <> 5 Then
Resource.LogInformation "Error resuming from paused state"
Online = 1
End If
Else
Resource.LogInformation "Unknown error after registering Virtual Server"
Online = 1
End If
Case "1" Set oExec = objVM.Startup()
Do While objVM.State = 3
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
Case "2" Set oExec = objVM.Startup()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
Case "3" Resource.LogInformation "Virtual Server is already in the process
of turning on"
Do While objVM.State = 3
WScript.Sleep 100
Loop
Online = 0
Case "4" Resource.LogInformation "Virtual Server is already in the process
of Restoring"
Do While objVM.State = 4
WScript.Sleep 100
Loop
Online = 0
Case "5" Resource.LogInformation "Virtual Server is already running"
Online = 0
Case "6" Set oExec = objVM.Resume()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error resuming from paused state"
Online = 1
End If
Case "7" Resource.LogInformation "Virtual Server is in the process of
Saving"
Do While objVM.State = 7
WScript.Sleep 100
Loop
Online = 1
Case "8" Resource.LogInformation "Virtual Server is in the process of
turning off"
Do While objVM.State = 8
WScript.Sleep 100
Loop
Online = 1
Case Else Resource.LogInformation "Unknown state of Virtual Server"
Online = 1
End Select
End Function
Function Offline( )
Resource.LogInformation "Resource going offline by saving current state of
VS"
Set oExec = objVM.Save()
Do While objVM.State = 7
WScript.Sleep 100
Loop
Offline = 0
If objVM.State <> 1 Then
Resource.LogInformation "Error saving VS state"
Offline = 1
End If
End Function
Function LooksAlive( )
Resource.LogInformation "Entering LooksAlive"
LooksAlive = true
If objVM.State <> 5 Then
Resource.LogInformation "VM state does not look to be Running"
LooksAlive = false
End If
End Function
Function IsAlive( )
Resource.LogInformation "Entering IsAlive"
if objGuestOS.IsHeartbeating=True Then
IsAlive = true
Else
Resource.LogInformation "Heart is not beating"
IsAlive = false
End If
End Function
Function Close( )
Close = 0
End Function
Function Terminate( )
Terminate = 0
End Function
Any idea why the the "Set objVS =
CreateObject("VirtualServer.Application")"
line is causing an error?
Thanks for any help you can give!
Chris Butler
chris.butler@rit.edu |
|
|
| Back to top |
|
 |
Chris Butler
Guest
|
Posted:
Sun Jan 09, 2005 4:36 am Post subject:
Re: Generic Script Resource error |
|
|
Thanks Mike for the advice. I will post my script to the other
newsgroup to see if I can do anything differently. I found that I can
run my script from the command line and it properly controls the
Virtual Servers. I'm wondering if the script can't find the Virtual
Server API when running through the cluster service as a generic
script. Can I customize the environment that the generic script
resource runs in? I believe that the script is being run as the
service account in session 0. Is that process isolated in some way
where it can't find the additional API's registered in Windows? Is
there any technical documentation about the environment that the
generic script resource runs in?
Thanks,
Chris butler
Mike Rosado [MSFT] wrote:
| Quote: | Hi Chris,
I'm by no means an expert in this subject matter VBS Scripts, but
I'll try
to assist you to the best of my ability.
The Event ID 5018 (0000139a) basically means the following:
ERROR_RESMON_ONLINE_FAILED
# The cluster resource could not be brought online by the
# resource monitor.
Then the following error 0x80020009 means an "Exception occurred".
"Error loading script 'c:\windows\vstest.vbs'. HRESULT: 0x80020009"
Not sure why the line "Set objVS =
CreateObject("VirtualServer.Application")" is causing an error. But
I'm
sure if you post the original message below to the
"microsoft.public.scripting.vbscript" newsgroup, that someone there
might
have experienced the same behavior as you or may be able to give you
better
guidance as to how to proceed.
--
Hope this helps,
Mike Rosado
Windows 2000 MCSE + MCDBA
Microsoft Enterprise Platform Support
Windows NT/2000/2003 Cluster Technologies
====================================================
When responding to posts, please "Reply to Group" via your newsreader
so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
http://www.microsoft.com/info/cpyright.htm
-----Original Message-----
"Butler" <Butler@discussions.microsoft.com> wrote in message
news:672020B1-04B4-4011-B8B6-4986AFD297C5@microsoft.com...
I have been trying to use a generic script resource to control MS
Virtual
Server 2005. I have been able to use sections of my script at the
command
line to control VS but I am getting an error when running through
the
cluster
service. The Error ID when I try to bring the resource online is
5018
(0000139a). The cluster log file gives me the following errors:
00001160.00000e30::2005/01/08-08:26:15.740 INFO Generic Script
test>:
Loaded script engine 'VBScript' successfully.
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script
test>:
Script Error: Line=2, Character = 0
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script
test>:
Error: 2147943746 (0x80070542) - Description: <null> (Source:
null>)
00001160.00000e30::2005/01/08-08:26:15.787 ERR Generic Script
test>:
Error
loading script 'c:\windows\vstest.vbs'. HRESULT: 0x80020009
My script contains:
Dim objVS, objVM, oExec
Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("vstest")
Sub Open( )
End Sub
Function Online( )
Resource.LogInformation "Entering Online"
Select Case objVM.State
Case "0" Set oExec = objVS.RegisterVirtualMachine("vstest.vmc",
"I:\vstest")
Do While objVM.State = 0
WScript.Sleep 100
Loop
Set objVM = objVS.FindVirtualMachine("vstest")
If objVM.State = 1 Then
Set oExec = objVM.Startup()
Do While objVM.State = 3
WScript.Sleep 100
Loop
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
ElseIf objVM.State = 2 Then
Set oExec = objVM.Startup()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
If oExec.ExitCode <> 5 Then
Resource.LogInformation "Error performing startup function from
saved
state"
Online = 1
End If
ElseIf oExec.Status = 6 Then
Set oExec = objVM.Resume()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
If objVM.State <> 5 Then
Resource.LogInformation "Error resuming from paused state"
Online = 1
End If
Else
Resource.LogInformation "Unknown error after registering Virtual
Server"
Online = 1
End If
Case "1" Set oExec = objVM.Startup()
Do While objVM.State = 3
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
Case "2" Set oExec = objVM.Startup()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error performing startup function"
Online = 1
End If
Case "3" Resource.LogInformation "Virtual Server is already in the
process
of turning on"
Do While objVM.State = 3
WScript.Sleep 100
Loop
Online = 0
Case "4" Resource.LogInformation "Virtual Server is already in the
process
of Restoring"
Do While objVM.State = 4
WScript.Sleep 100
Loop
Online = 0
Case "5" Resource.LogInformation "Virtual Server is already
running"
Online = 0
Case "6" Set oExec = objVM.Resume()
Do While objVM.State <> 5
WScript.Sleep 100
Loop
Online = 0
If objVM.State <> 5 Then
Resource.LogInformation "Error resuming from paused state"
Online = 1
End If
Case "7" Resource.LogInformation "Virtual Server is in the process
of
Saving"
Do While objVM.State = 7
WScript.Sleep 100
Loop
Online = 1
Case "8" Resource.LogInformation "Virtual Server is in the process
of
turning off"
Do While objVM.State = 8
WScript.Sleep 100
Loop
Online = 1
Case Else Resource.LogInformation "Unknown state of Virtual Server"
Online = 1
End Select
End Function
Function Offline( )
Resource.LogInformation "Resource going offline by saving current
state of
VS"
Set oExec = objVM.Save()
Do While objVM.State = 7
WScript.Sleep 100
Loop
Offline = 0
If objVM.State <> 1 Then
Resource.LogInformation "Error saving VS state"
Offline = 1
End If
End Function
Function LooksAlive( )
Resource.LogInformation "Entering LooksAlive"
LooksAlive = true
If objVM.State <> 5 Then
Resource.LogInformation "VM state does not look to be Running"
LooksAlive = false
End If
End Function
Function IsAlive( )
Resource.LogInformation "Entering IsAlive"
if objGuestOS.IsHeartbeating=True Then
IsAlive = true
Else
Resource.LogInformation "Heart is not beating"
IsAlive = false
End If
End Function
Function Close( )
Close = 0
End Function
Function Terminate( )
Terminate = 0
End Function
Any idea why the the "Set objVS =
CreateObject("VirtualServer.Application")"
line is causing an error?
Thanks for any help you can give!
Chris Butler
chris.butler@rit.edu |
|
|
| Back to top |
|
 |
|
|
|
|