Installing and upgrading to HP Insight Software 6.0 on Windows Server 2003 R2 MSCS for high availability
43
If Err.Number <> 0 Then
ErrorCheck "Save cluDisk", Err.Description
Else
WScript.Echo "OK! - SIM Cluster Disk Resource '" _
& simDisk & "' is found."
Set oRes.Item(simdisk) = cluDisk
End If
' Generic Service Resources
' First define the services, then add the dependencies
Dim nDep, z, oReskey
For n = 0 to
UBound(arrSvcName)
'For each "row" of service
'This is a very long statement. Watch line wrap.
Set cluService = cluGroup.Resources.CreateItem(arrSvcName (n) (1),"Generic Service",0)
''End of long statement.
Set cluResProps = cluService.PrivateProperties
cluResProps.Item("ServiceName").Value = arrSvcName (n) (0)
cluResProps.SaveChanges
If Err.Number <> 0 Then
ErrorCheck "Creating Service Resource", Err.Description
Else
WScript.Echo "OK! - Service Resource '" _
& arrSvcName (n) (1) & "' created."
Set oRes.Item(arrSvcName (n) (1)) = cluService
End If
Next
On Error Goto 0
' Go through services array applying dependencies.
For n = 0 to
UBound(arrSvcName)
'For each "row" of service
nDep = UBound(arrSvcName(n)) +
1
'get the number of dependencies
Set CluService = oRes.Item(arrSvcName (n) (1))
If nDep > 2 Then
For z = 2 to nDep - 1
oReskey = arrSvcName (n) (z)
cluService.Dependencies.AddItem(oRes.Item(oReskey))
If Err.Number <> 0 Then
ErrorCheck "Create Resource Dep.", Err.Description
Else
WScript.Echo "OK! - Resource Dependency '" _
& arrSvcName(n) (1) & "' created."
End If
Next
End If
Next
' Bring CMS-HA Group online
On Error Goto 0
Dim ol
ol=cluGroup.Online(5)
If Err.Number <> 0 Then
ErrorCheck "cluGroup Online", Err.Description
Else
WScript.Echo "OK! - SIM Cluster Group Online on this node."
End If
' Cleanup; deref objects
Set cluResProps
=
Nothing
Set cluService = Nothing
Set cluDisk
=
Nothing
Set cluNetName = Nothing
Set
cluResIP
= Nothing
Set cluGroup = Nothing
Set objCluster
=
Nothing
]]>
</script>
</job>
</package>