Build cluster applications on guest domains or control domains.
For details on how to build cluster applications on guest domains, see "Chapter 6 Building Cluster Applications."
In the cluster between control domain in Oracle VM Server for SPARC Environments, create one cluster application for one guest domain to monitor the state of the guest domain. Configuration of each cluster application that monitors the state of the guest domain must include at least one Cmdline resource, and one or more Gls resources and GDS resources.
This section explains how to build the cluster application that monitors the state of the guest domain.
For details on the cluster application, see "Chapter 6 Building Cluster Applications".
Cmdline resource for monitoring guest domain statuses
Starts, stops and monitors the corresponding guest domain.
GLS resource
Monitors the networks used by the corresponding guest domain via virtual in- and output from the control domain.
GDS resource
Starts, stops, and monitors the volumes used by the corresponding guest domain via virtual in- and output from the control domain.
See below for how to configure the cluster application that monitors the state of the guest domain in the cluster between the control domain:
Creation of the Cmdline resource
Setup of the cluster application
Set up Online, Offline and Check scripts so that the corresponding guest domain starts/stops in conjunction with userApplication.
Set the commands to start the corresponding guest domain to the Online script. Set the commands to stop the corresponding guest domain to the Offline script. In the Check script, set the commands to verify the corresponding guest domain's ability to start its OS.
Sample Scripts
This section presents sample scripts for Online (Start), Offline (Stop) and Check scripts.
Specify the target guest domain name for the argument of each script. Also if setting the script to the Cmdline resource, the target guest domain name is required to be the same name for each node.
Set a Cmdline resource with the scripts to userApplication. For details, refer to "6.7.1.1 Creating Cmdline Resourcesg Cmdline Resources".
Start script: starts the corresponding guest domains. Returns "0" when execution was successful, or any other value when failed.
#!/bin/sh # # Sample online script for a guest domain # Exit with 0: Success 1: Fail # # Copyright(c) 2008 FUJITSU LIMITED. All rights reserved. # LDOMSNAME=$1 LDM="/opt/SUNWldm/bin/ldm" $LDM bind-domain $LDOMSNAME $LDM start-domain $LDOMSNAME # Exits on "0" (success), only when logical domain is active $LDM list-domain $LDOMSNAME | tail -1 | awk '{print $2}' | grep "^active" && exit 0 exit 1
Stop script: stops the corresponding guest domains. Returns "0" when execution was successful, or any other value when failed.
#!/bin/sh # # Sample offline script for a guest domain # Exit with 0: Success 1: Fail # # Copyright(c) 2008 FUJITSU LIMITED. All rights reserved. # LDOMSNAME=$1 LDM="/opt/SUNWldm/bin/ldm" $LDM stop-domain $LDOMSNAME [ 0 -ne $? ] && $LDM stop-domain -f $LDOMSNAME $LDM unbind-domain $LDOMSNAME # Exits on "0" (success), only when logical domain is inactive $LDM list-domain $LDOMSNAME | tail -1 | awk '{print $2}' | grep "^inactive" && exit 0 exit 1
Check script: monitors "active" statuses of corresponding guest domains. Returns "0" when domain is active, or any other value otherwise.
#!/bin/sh # # Sample check script for a guest domain # Exit with 0: Online 1: Offline # # Copyright(c) 2008 FUJITSU LIMITED. All rights reserved. # LDOMSNAME=$1 LDM="/opt/SUNWldm/bin/ldm" # Exits on "0" (success), only when logical domain is active $LDM list-domain $LDOMSNAME | tail -1 | awk '{print $2}' | grep "^active" && exit 0 exit 1
Make the settings for Cmdline resource, Gds resource and Gls resource cluster applications.
For details on Gds and Gls resource settings, refer to "Creating Gds Resources" and "Creating Gls Resources" in "6.7.1 Setting Up Resources". For details on cluster application settings, refer to "6.7 Setting Up Cluster Applications".