Using HP Insight Software from a Highly Available Central Management Server with Microsoft Cluster Service

29
HA-VSE_script.wsf
The HA-VSE_script.wsf file contains the cluster resources creation script. It includes a job that
determines if prerequisite conditions for creating the HA-VSE cluster resources are satisfied, and a job
that creates the required HA-VSE cluster resources.
<?xml version="1.0"?>
<!--============================================================
; HA-VSE_script.wsf
; This is a Microsoft Windows Script Host file (.wsf)
; It consists of two job steps:
; 1) JOB:check - determines if the prerequisite conditions
; for creating the HA-VSE cluster resources
; are satisfied.
;
; 2) JOB:define - creates the HA-VSE cluster resource
; definitions
;
; Execution example:
; cscript HA-VSE_script.wsf //job:check
;
; © Copyright 2008 Hewlett-Packard Development Company, L.P.
=============================================================-->
<package id="Main">
<job id="check">
<!--==============================================================
; The following line references the MSCLUS type library, which
; makes the library-defined constants and enums available to the
; script. The reference is job-specific. Each job must include
; this line in order to use the type library definitions.
============================================================-->
<reference guid="{F2E606E0-2631-11D1-89F1-00A0C90D061E}"
version="1.0" />
<!--============================================================
; The following lines include the specified external file for
; this job.
============================================================-->
<script language="VBScript" src="HA-VSE_defines.vbs"/>
<script language="VBScript" src="HA-VSE_common.vbs"/>
<script language="VBScript">
<![CDATA[
Option Explicit
On Error Resume Next
DIM host
host = "" 'null defaults to "this host"
Dim cluGroup
Dim hRes, resKey
Dim hResInv
cluConnect host,objCluster
ErrorCheck "cluConnect", "Fail to connect to cluster on host: "_
& host & Err.Description
DIM cluNode
DIM n
On Error Goto 0
' Now check pre-req services availability on each node
WScript.Echo _
"Checking for required Windows services on cluster nodes..."
For Each cluNode in objCluster.Nodes
For n = 0 to UBOUND(arrSvcName,2)
verifySvc arrSvcName(0,n), cluNode.Name
ErrorCheck "verifySvc", "An error occured: " _
& Err.Description