diff --git a/instances/templates/add_instance_volume.html b/instances/templates/add_instance_volume.html index 6b0fed3..9ae808a 100644 --- a/instances/templates/add_instance_volume.html +++ b/instances/templates/add_instance_volume.html @@ -84,11 +84,7 @@ @@ -142,11 +138,7 @@ diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 71e0fd2..1470f5a 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -488,12 +488,11 @@ class wvmInstance(wvmConnect): """ % (source, target, targetbus) + if self.get_status() == 1: + self.instance.attachDeviceFlags(xml_disk, VIR_DOMAIN_AFFECT_LIVE) + self.instance.attachDeviceFlags(xml_disk, VIR_DOMAIN_AFFECT_CONFIG) if self.get_status() == 5: - devices = tree.find('devices') - elm_disk = ElementTree.fromstring(xml_disk) - devices.append(elm_disk) - xmldom = ElementTree.tostring(tree) - self._defineXML(xmldom) + self.instance.attachDeviceFlags(xml_disk, VIR_DOMAIN_AFFECT_CONFIG) def detach_disk(self, dev): tree = ElementTree.fromstring(self._XMLDesc(0))