MCPcopy
hub / github.com/retspen/webvirtcloud / resize

Method resize

vrtManager/instance.py:526–545  ·  view source on GitHub ↗

Function change ram and cpu on vds.

(self, cur_memory, memory, cur_vcpu, vcpu)

Source from the content-addressed store, hash-verified

524 "/domain/devices/graphics/@keymap") or ''
525
526 def resize(self, cur_memory, memory, cur_vcpu, vcpu):
527 """
528 Function change ram and cpu on vds.
529 """
530 memory = int(memory) * 1024
531 cur_memory = int(cur_memory) * 1024
532
533 xml = self._XMLDesc(VIR_DOMAIN_XML_SECURE)
534 tree = ElementTree.fromstring(xml)
535
536 set_mem = tree.find('memory')
537 set_mem.text = str(memory)
538 set_cur_mem = tree.find('currentMemory')
539 set_cur_mem.text = str(cur_memory)
540 set_vcpu = tree.find('vcpu')
541 set_vcpu.text = vcpu
542 set_vcpu.set('current', cur_vcpu)
543
544 new_xml = ElementTree.tostring(tree)
545 self._defineXML(new_xml)
546
547 def get_iso_media(self):
548 iso = []

Callers 9

bootstrap.min.jsFile · 0.80
ext-textarea.jsFile · 0.80
Chart.min.jsFile · 0.80
DisplayFunction · 0.80
RFBFunction · 0.80
onResizeFunction · 0.80
bindEventsFunction · 0.80
setupCanvasesFunction · 0.80
instanceFunction · 0.80

Calls 2

_XMLDescMethod · 0.95
_defineXMLMethod · 0.95

Tested by

no test coverage detected