[ClusterLabs] generic 'initscript' resource agent that passes arguments?

bergman at merctech.com bergman at merctech.com
Mon Aug 29 13:41:11 EDT 2016


I've got a number of scripts that are based on LSB compliant scripts,
but which also accept arguments & values. For example, a script to manage
multiple virtual machines has a command-line in the form:

	vbox_init --vmname $VMNAME [-d|--debug] [start|stop|status|restart]

I'd like to manage these services as cluster resources, ideally without
modifying the existing (tested, functioning) init scripts.

For example, I do not want to create individual vbox_init script with
hard-coded values for the virtual machine name (and I'd strongly prefer
not to do a hack using $0 to lookup the vm name, as in calling the scripts
"vbox_init.$NAME1" and "vbox_init.$NAME2", etc).

Similarly, I don't want to create individual resource agents with
hard-coded values.

Is there an existing varient on the /usr/share/cluster/script.sh resource
that enables passing arbitrary argument+value pairs and flags to the
actual init script? Continuing the above example, the new resource
("scriptArgs") would appear in cluster.conf something like:

                <resources>
                        <scriptArgs file="/usr/local/etc/init.d/vbox_init" name="vbox_init"/>
                </resources>

                <service max_restarts="2" name="fooBarVM" recovery="restart" restart_expire_time="180">
                        <ip ref="192.168.1.123"/>
                        <scriptArgs ref="vbox_init" args="--vmname fooBarVM">
                </service>

                <service max_restarts="2" name="snafuVM" recovery="restart" restart_expire_time="180">
                        <ip ref="192.168.1.222"/>
                        <scriptArgs ref="vbox_init" args="--vmname snafuVM --debug">
                </service>



I'm using CentOS6 and:
	cman-3.0.12.1-78.el6.x86_64
	luci-0.26.0-78.el6.centos.x86_64
	rgmanager-3.0.12.1-26.el6_8.3.x86_64
	ricci-0.16.2-86.el6.x86_64

Thanks,

Mark




More information about the Users mailing list