From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9817 invoked by alias); 22 Jun 2009 17:59:32 -0000 Received: (qmail 9810 invoked by alias); 22 Jun 2009 17:59:32 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: resource-agents: master - rgmanager: Allow vm.sh use of libvirt XML file To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: resource-agents.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 17bdcb693d3908e44ab8e9d9a66a2c436a4870b2 X-Git-Newrev: 70f5c5dcda594aa29ad07cfe23bd3342e1e7c5c5 From: Lon Hohberger Message-Id: <20090622175837.D38D812020D@lists.fedorahosted.org> Date: Mon, 22 Jun 2009 17:59:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00665.txt.bz2 Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=70f5c5dcda594aa29ad07cfe23bd3342e1e7c5c5 Commit: 70f5c5dcda594aa29ad07cfe23bd3342e1e7c5c5 Parent: 17bdcb693d3908e44ab8e9d9a66a2c436a4870b2 Author: Federico Simoncelli AuthorDate: Mon Jun 22 09:22:43 2009 -0400 Committer: Lon Hohberger 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 Signed-off-by: Lon Hohberger --- 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() + + + Use xmlfile to create the vm (libvirt) + + + + + + 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