mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-12 16:35:17 +00:00
Add live new/existing disk operation for instance
This commit is contained in:
parent
1db6bb4cce
commit
61703b3faf
2 changed files with 6 additions and 15 deletions
|
@ -84,11 +84,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
{% ifequal status 5 %}
|
|
||||||
<button type="submit" class="btn btn-lg btn-success pull-right" name="add_new_vol">{% trans "Add Volume" %}</button>
|
<button type="submit" class="btn btn-lg btn-success pull-right" name="add_new_vol">{% trans "Add Volume" %}</button>
|
||||||
{% else %}
|
|
||||||
<button class="btn btn-lg btn-success pull-right disabled">{% trans "Add Volume" %}</button>
|
|
||||||
{% endifequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -142,11 +138,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
{% ifequal status 5 %}
|
|
||||||
<button type="submit" class="btn btn-lg btn-success pull-right" name="add_existing_vol">{% trans "Add Volume" %}</button>
|
<button type="submit" class="btn btn-lg btn-success pull-right" name="add_existing_vol">{% trans "Add Volume" %}</button>
|
||||||
{% else %}
|
|
||||||
<button class="btn btn-lg btn-success pull-right disabled">{% trans "Add Volume" %}</button>
|
|
||||||
{% endifequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -488,12 +488,11 @@ class wvmInstance(wvmConnect):
|
||||||
<target dev='%s' bus='%s'/>
|
<target dev='%s' bus='%s'/>
|
||||||
</disk>
|
</disk>
|
||||||
""" % (source, target, targetbus)
|
""" % (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:
|
if self.get_status() == 5:
|
||||||
devices = tree.find('devices')
|
self.instance.attachDeviceFlags(xml_disk, VIR_DOMAIN_AFFECT_CONFIG)
|
||||||
elm_disk = ElementTree.fromstring(xml_disk)
|
|
||||||
devices.append(elm_disk)
|
|
||||||
xmldom = ElementTree.tostring(tree)
|
|
||||||
self._defineXML(xmldom)
|
|
||||||
|
|
||||||
def detach_disk(self, dev):
|
def detach_disk(self, dev):
|
||||||
tree = ElementTree.fromstring(self._XMLDesc(0))
|
tree = ElementTree.fromstring(self._XMLDesc(0))
|
||||||
|
|
Loading…
Reference in a new issue