Loading ccnode/hypervisor/__init__.py +4 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ from ccnode.host import Handler as HostHandler from ccnode.tags import Tag, tag_inspector, get_tags from ccnode.hypervisor import tags from ccnode.hypervisor import lib as _libvirt from ccnode.hypervisor.lib import EVENTS, EventLoop from ccnode.hypervisor.lib import EVENTS, STORAGE_STATES, EventLoop from ccnode.hypervisor.domains import VirtualMachine Loading Loading @@ -40,6 +40,7 @@ class Handler(HostHandler): # register hypervisor storage tags for name, storage in self.hypervisor.storage.storages.iteritems(): for t in ( Tag('sto%s_state' % name, lambda: storage.state, 5), Tag('sto%s_size' % name, lambda: storage.capacity, 5), Tag('sto%s_free' % name, lambda: storage.available, 5), Tag('sto%s_used' % name, Loading Loading @@ -224,7 +225,8 @@ class Storage(object): self.uuid = lv_storage.UUID() self.name = lv_storage.name() self.capacity, self.allocation, self.available = lv_storage.info()[1:] self.state, self.capacity, self.allocation, self.available = lv_storage.info() self.state = STORAGE_STATES[self.state] self.volumes = map( partial(Volume, storage=self), Loading ccnode/hypervisor/lib.py +10 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,16 @@ DOMAIN_STATES = ( ) STORAGE_STATES = ( 'inactive', 'building', 'running', 'degraded', 'inaccessible', '???', # 5 ) #: libvirt envents EVENTS = ( 'Added', Loading Loading
ccnode/hypervisor/__init__.py +4 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ from ccnode.host import Handler as HostHandler from ccnode.tags import Tag, tag_inspector, get_tags from ccnode.hypervisor import tags from ccnode.hypervisor import lib as _libvirt from ccnode.hypervisor.lib import EVENTS, EventLoop from ccnode.hypervisor.lib import EVENTS, STORAGE_STATES, EventLoop from ccnode.hypervisor.domains import VirtualMachine Loading Loading @@ -40,6 +40,7 @@ class Handler(HostHandler): # register hypervisor storage tags for name, storage in self.hypervisor.storage.storages.iteritems(): for t in ( Tag('sto%s_state' % name, lambda: storage.state, 5), Tag('sto%s_size' % name, lambda: storage.capacity, 5), Tag('sto%s_free' % name, lambda: storage.available, 5), Tag('sto%s_used' % name, Loading Loading @@ -224,7 +225,8 @@ class Storage(object): self.uuid = lv_storage.UUID() self.name = lv_storage.name() self.capacity, self.allocation, self.available = lv_storage.info()[1:] self.state, self.capacity, self.allocation, self.available = lv_storage.info() self.state = STORAGE_STATES[self.state] self.volumes = map( partial(Volume, storage=self), Loading
ccnode/hypervisor/lib.py +10 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,16 @@ DOMAIN_STATES = ( ) STORAGE_STATES = ( 'inactive', 'building', 'running', 'degraded', 'inaccessible', '???', # 5 ) #: libvirt envents EVENTS = ( 'Added', Loading