public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* resource-agents: master - rgmanager: Allow vm.sh use of libvirt XML file
@ 2009-06-22 17:59 Lon Hohberger
  0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-06-22 17:59 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=70f5c5dcda594aa29ad07cfe23bd3342e1e7c5c5
Commit:        70f5c5dcda594aa29ad07cfe23bd3342e1e7c5c5
Parent:        17bdcb693d3908e44ab8e9d9a66a2c436a4870b2
Author:        Federico Simoncelli <federico.simoncelli@gmail.com>
AuthorDate:    Mon Jun 22 09:22:43 2009 -0400
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Mon Jun 22 13:57:56 2009 -0400

rgmanager: Allow vm.sh use of libvirt XML file

This allows use of libvirt XML files to create transient
virtual machines instead of statically defined virtual
machines.  This allows putting libvirt XML files on, for
example, cluster file systems.

Signed-off-by: Federico Simoncelli <federico.simoncelli@gmail.com>
Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 rgmanager/src/resources/vm.sh |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 8285cd6..f0e474d 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -131,6 +131,15 @@ meta_data()
             <content type="integer" default="1"/>
         </parameter>
 
+	<parameter name="xmlfile">
+	    <longdesc lang="en">
+	    	Use xmlfile to create the vm (libvirt)
+	    </longdesc>
+	    <shortdesc lang="en">
+	    </shortdesc>
+            <content type="string"/>
+	</parameter>
+
 	<parameter name="migrate">
 	    <longdesc lang="en">
 	    	Migration type live or pause, default = live.
@@ -338,7 +347,13 @@ do_virsh_start()
 		return 1
 	fi
 
-	cmdline="virsh $(build_virsh_cmdline start)"
+	if [ -n "$OCF_RESKEY_xmlfile" -a -f "$OCF_RESKEY_xmlfile" ]; then
+		# TODO: try to use build_virsh_cmdline for the hypervisor_uri
+		cmdline="virsh create $OCF_RESKEY_xmlfile"
+	else
+		cmdline="virsh $(build_virsh_cmdline start)"
+	fi
+
 	ocf_log debug "$cmdline"
 
 	$cmdline


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-22 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-22 17:59 resource-agents: master - rgmanager: Allow vm.sh use of libvirt XML file Lon Hohberger

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 read-only IMAP folder(s) and NNTP newsgroup(s).