[pve-devel] [RFC qemu-server] ha: use correct service id if VM is a template

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 2 16:50:43 CET 2016


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/API2/Qemu.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 66dc69a..d790d7c 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1700,6 +1700,9 @@ __PACKAGE__->register_method({
 
 		my $service = "vm:$vmid";
 
+		$service = "template:$vmid"
+		  if (PVE::QemuConfig->is_template($conf));
+
 		my $cmd = ['ha-manager', 'enable', $service];
 
 		print "Executing HA start for VM $vmid\n";
@@ -1797,6 +1800,9 @@ __PACKAGE__->register_method({
 
 		my $service = "vm:$vmid";
 
+		$service = "template:$vmid"
+		  if (PVE::QemuConfig->is_template($conf));
+
 		my $cmd = ['ha-manager', 'disable', $service];
 
 		print "Executing HA stop for VM $vmid\n";
@@ -2742,6 +2748,9 @@ __PACKAGE__->register_method({
 
 		my $service = "vm:$vmid";
 
+		$service = "template:$vmid"
+		  if (PVE::QemuConfig->is_template($conf));
+
 		my $cmd = ['ha-manager', 'migrate', $service, $target];
 
 		print "Executing HA migrate for VM $vmid to node $target\n";
-- 
2.1.4





More information about the pve-devel mailing list