From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/rgmanager/src/resources xenvm.sh
Date: 16 Oct 2006 20:59:53 -0000 [thread overview]
Message-ID: <20061016205953.23594.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2006-10-16 20:59:53
Modified files:
rgmanager/src/resources: xenvm.sh
Log message:
Updated xenvm resource agent
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/xenvm.sh.diff?cvsroot=cluster&r1=1.3&r2=1.4
--- cluster/rgmanager/src/resources/xenvm.sh 2006/07/19 18:43:32 1.3
+++ cluster/rgmanager/src/resources/xenvm.sh 2006/10/16 20:59:53 1.4
@@ -102,9 +102,9 @@
<content type="integer"/>
</parameter>
- <parameter name="bootloader" required="1">
+ <parameter name="bootloader">
<longdesc lang="en">
- Root disk for the Xen VM (as presented to the VM)
+ Boot loader that can start the Xen VM from physical image
</longdesc>
<shortdesc lang="en">
Boot loader that can start the Xen VM from physical image
@@ -112,6 +112,18 @@
<content type="string"/>
</parameter>
+ <parameter name="path">
+ <longdesc lang="en">
+ Path specification 'xm create' will search for the specified
+ VM configuration file
+ </longdesc>
+ <shortdesc lang="en">
+ Path to Xen configuration files
+ </shortdesc>
+ <content type="string"/>
+ </parameter>
+
+
<parameter name="rootdisk_physical" unique="1">
<longdesc lang="en">
root disk for the Xen VM. (physical, on the host)
@@ -168,7 +180,7 @@
<actions>
<action name="start" timeout="20"/>
- <action name="stop" timeout="240"/>
+ <action name="stop" timeout="120"/>
<!-- No-ops. Groups are abstract resource types. -->
<action name="status" timeout="10" interval="30m"/>
@@ -196,28 +208,6 @@
}
-#
-# Find a list of possible IP addresses to try.
-#
-xen_host_ips()
-{
- declare xen_ips=$(ip -f inet -o addr list | grep 'xen-br[0-9]\+[^:]' | awk '{print $4}')
- declare tmp1=""
- declare i
-
- for i in $xen_ips; do
- i=${i/\/*/}
- if [ -z "$tmp1" ]; then
- tmp1="$i"
- else
- tmp1="$i,$tmp1"
- fi
- done
-
- echo $tmp1
-}
-
-
build_xen_cmdline()
{
#
@@ -228,7 +218,6 @@
declare cmdline="restart=\"never\""
declare varp val temp
-
#
# Transliterate the OCF_RESKEY_* to something the xm
# command can recognize.
@@ -261,12 +250,21 @@
;;
rootdisk_virtual)
;;
+ name) # Do nothing with name; add it later
+ ;;
+ path)
+ cmdline="$cmdline --path=\"$val\""
+ ;;
*)
cmdline="$cmdline $varp=\"$val\""
;;
esac
done
+ if [ -n "$OCF_RESKEY_name" ]; then
+ cmdline="$OCF_RESKEY_name $cmdline"
+ fi
+
echo $cmdline
}
@@ -282,13 +280,9 @@
#
declare cmdline
- if [ -f "/etc/xen/xmdefconfig" ]; then
- cmdline="`build_xen_cmdline`"
- else
- cmdline="`build_xen_cmdline` /dev/null"
- fi
+ cmdline="`build_xen_cmdline`"
- echo $cmdline
+ echo "# Xen Command Line: $cmdline"
eval xm create $cmdline
return $?
@@ -301,7 +295,7 @@
#
stop()
{
- declare -i timeout=120
+ declare -i timeout=60
declare -i ret=1
declare st
@@ -309,7 +303,7 @@
echo xm $op $OCF_RESKEY_name ...
xm $op $OCF_RESKEY_name
- timeout=120
+ timeout=60
while [ $timeout -gt 0 ]; do
sleep 5
((timeout -= 5))
@@ -362,45 +356,11 @@
verify_all()
{
declare errors=0
- declare tmp1, tmp2
-
- if [ -z "$OCF_RESKEY_kernel" ]; then
- echo "Required parameter OCF_RESKEY_kernel is not present"
- ((errors++))
- elif ! [ -f "$OCF_RESKEY_kernel" ]; then
- echo "$OCF_RESKEY_kernel (OCF_RESKEY_kernel) is not valid"
- ((errors++))
- fi
-
- tmp1=`echo $OCF_RESKEY_swapdisk | cut -f1 -d,`
- tmp2=`echo $OCF_RESKEY_swapdisk | cut -f2 -d,`
-
- if [ -z "$tmp2" ]; then
- echo "Swapdisk option malformed"
- ((errors++))
- fi
-
- if ! [ -b "$tmp1" ]; then
- echo "Specified swapdisk device $tmp1 is not a block device"
- ((errors++))
- fi
- if [ -z "$OCF_RESKEY_rootdisk" ]; then
- echo "Required parameter OCF_RESKEY_rootdisk is not present"
+ if [ -n "$OCF_RESKEY_bootloader" ] && \
+ ! [ -x "$OCF_RESKEY_bootloader" ]; then
+ echo "$OCF_RESKEY_bootloader is not executable"
((errors++))
- else
- tmp1=`echo $OCF_RESKEY_rootdisk | cut -f1 -d,`
- tmp2=`echo $OCF_RESKEY_rootdisk | cut -f2 -d,`
-
- if [ -z "$tmp2" ]; then
- echo "Rootdisk option malformed"
- ((errors++))
- fi
-
- if ! [ -b "$tmp1" ]; then
- echo "Specified rootdisk device $tmp1 is not a block device"
- ((errors++))
- fi
fi
}
reply other threads:[~2006-10-16 20:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061016205953.23594.qmail@sourceware.org \
--to=lhh@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).