Univention Bugzilla – Bug 35080
Update available capacity for "logical" storage pools
Last modified: 2023-06-28 10:46:35 CEST
UVMMd does not refresh the available capacity of LVM storage pools. diff --git a/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/storage.py b/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/storage.py index 188acc9..f36eafe 100644 --- a/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/storage.py +++ b/branches/ucs-3.2/ucs-3.2-2/virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/storage.py @@ -57,6 +57,7 @@ POOLS_TYPE = { 'netfs': Disk.TYPE_FILE, 'scsi': Disk.TYPE_BLOCK, } +POOLS_FAST_REFRESH = set(('dir', 'fs', 'netfs', 'logical')) configRegistry = ucr.ConfigRegistry() configRegistry.load() @@ -160,7 +161,7 @@ def create_storage_volume(conn, domain, disk): #raise StorageError(_('Volume "%(volume)s" for "%(domain)s" in not located in any storage pool.'), volume=disk.source, domain=domain.name) #create_storage_pool(conn, path.dirname(disk.source)) try: - if pool_type in ('dir', 'fs', 'netfs'): + if pool_type in POOLS_FAST_REFRESH: pool.refresh(0) vol = pool.storageVolLookupByName(disk.source[length:]) logger.warning( @@ -259,6 +260,8 @@ def create_storage_volume(conn, domain, disk): domain.name, domain.uuid, ) + if pool_type in POOLS_FAST_REFRESH: + pool.refresh(0) return vol except libvirt.libvirtError, ex: if ex.get_error_code() in (libvirt.VIR_ERR_NO_STORAGE_VOL,): @@ -295,7 +298,7 @@ def get_storage_volumes(node, pool_name, type=None): xml = pool.XMLDesc(0) doc = parseString(xml) pool_type = doc.firstChild.getAttribute('type') - if pool_type in ('dir', 'fs', 'netfs'): + if pool_type in POOLS_FAST_REFRESH: pool.refresh(0) except TimeoutError, ex: logger.warning('libvirt connection "%s" timeout: %s', node.pd.uri, ex)
This issue has been filed against UCS 4.2. UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.