Loading cloudcontrol/node/hypervisor/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ class Handler(HostHandler): # we must refresh those tags only when domains tags are registered to # have the calculated values for tag in ('cpualloc', 'cpurunning', 'memalloc', 'memrunning', 'memremaining'): for tag in ('cpualloc', 'cpurunning', 'cpuremaining', 'memalloc', 'memrunning', 'memremaining'): self.tag_db['__main__'][tag].update_value() # register libvirt handlers Loading cloudcontrol/node/hypervisor/tags.py +8 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,14 @@ def cpualloc(handl): handl.hypervisor.domains.itervalues() if vm.tag_db['__main__']['cpu'].value) @_check_virt_connected def cpuremaining(handl): """Allocatable CPU remaining on the hypervisor.""" cpu = int(handl.tag_db['__main__']['cpu'].value) cpualloc = int(handl.tag_db['__main__']['cpualloc'].value) return cpu - cpualloc @_check_virt_connected def memrunning(handl): """Memory used by running VMs on the hypervisor.""" Loading Loading
cloudcontrol/node/hypervisor/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ class Handler(HostHandler): # we must refresh those tags only when domains tags are registered to # have the calculated values for tag in ('cpualloc', 'cpurunning', 'memalloc', 'memrunning', 'memremaining'): for tag in ('cpualloc', 'cpurunning', 'cpuremaining', 'memalloc', 'memrunning', 'memremaining'): self.tag_db['__main__'][tag].update_value() # register libvirt handlers Loading
cloudcontrol/node/hypervisor/tags.py +8 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,14 @@ def cpualloc(handl): handl.hypervisor.domains.itervalues() if vm.tag_db['__main__']['cpu'].value) @_check_virt_connected def cpuremaining(handl): """Allocatable CPU remaining on the hypervisor.""" cpu = int(handl.tag_db['__main__']['cpu'].value) cpualloc = int(handl.tag_db['__main__']['cpualloc'].value) return cpu - cpualloc @_check_virt_connected def memrunning(handl): """Memory used by running VMs on the hypervisor.""" Loading