Univention Bugzilla – Bug 44830
Support libvirt Storage Pools without target - RBD, Sheepdog, Gluster
Last modified: 2023-06-28 10:46:07 CEST
duplicates univention/uvmm/protocol.py:class Data_Pool(object): it not used itself.
Does not handle CEPH pools - they don't use paths: curl 'http://10.200.47.203/univention/command/uvmm/domain/add' -H 'Cookie: UMCSessionId=176149db-0fbd-430c-91e5-fb5df078d596; UMCUsername=Administrator; _pk_id.14.3827=4a27aa0be0284e01.1497974845.1.1497975888.1497974845.; _pk_ses.14.3827=*' -H 'Origin: http://10.200.47.203' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: de-DE' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json; q=1.0, text/html; q=0.3; */*; q=0.1' -H 'Referer: http://10.200.47.203/univention/management/' -H 'X-Requested-With: XMLHttpRequest' -H 'X-XSRF-Protection: 176149db-0fbd-430c-91e5-fb5df078d596' -H 'Connection: keep-alive' --data-binary '{"options":{"nodeURI":"qemu://ceph01.cephtest.local/system","domain":{"nodeURI":"qemu://ceph01.cephtest.local/system","profile":"cn=Microsoft Windows 10,cn=kvm,cn=Profiles,cn=Virtual Machine Manager,dc=cephtest,dc=local","profileDN":"cn=Microsoft Windows 10,cn=kvm,cn=Profiles,cn=Virtual Machine Manager,dc=cephtest,dc=local","name":"win10-pmg","description":"","maxMem":1073741824,"vcpus":"1","vnc":true,"vnc_remote":true,"disks":[{"$id$":1,"driver_cache":"none","readonly":false,"paravirtual":false,"device":"disk","volumeFilename":"win10-pmg-0","pool":"ceph_rbd","size":34359738368,"driver_type":"raw","volumeType":"new","source":null}],"interfaces":[{"model":"rtl8139","source":"br0"}]}}}' --compressed Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/base.py", line 249, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/uvmm/domains.py", line 439, in domain_add for disk in domain['disks'] File "/usr/lib/pymodules/python2.7/univention/management/console/modules/uvmm/domains.py", line 276, in _create_disk drive.source = os.path.join(pool['path'], disk['volumeFilename']) File "/usr/lib/python2.7/posixpath.py", line 77, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith' Die Ausführung des Kommandos uvmm/domain/add ist fehlgeschlagen:
(In reply to Philipp Hahn from comment #1) > Does not handle Rados Block Device storage pools - they don't use paths to represent volumes as local files: >>> pprint(data['options']['domain']['disks']) [{u'$id$': 1, u'device': u'disk', u'driver_cache': u'none', u'driver_type': u'raw', u'paravirtual': False, u'pool': u'ceph_rbd', u'readonly': False, u'size': 34359738368, u'source': None, u'volumeFilename': u'win10-pmg-0', u'volumeType': u'new'}] > Traceback (most recent call last): > "/usr/lib/pymodules/python2.7/univention/management/console/modules/uvmm/ > domains.py", line 276, in _create_disk > drive.source = os.path.join(pool['path'], disk['volumeFilename']) 271 »···»···if disk.get('source', None) is None: 272 »···»···»···# new drive 273 »···»···»···drive.size = disk['size'] 274 »···»···»···if not pool: 275 »···»···»···»···raise ValueError('Pool "%s" not found' % (pool_name,)) + if pool.get('path'): 276 »···»···»···drive.source = os.path.join(pool['path'], disk['volumeFilename']) the UMC code assumes that all "Storage Pools" use paths, which isn't true for CEPH. UVMM mis-uses that case to distinguish between re-using an existing and creating a new "Storage Volume". We need to make this case more explicit in the UMC-Protocol used between the JavaScript code running in the browser and the UMC-Python module running on the Web-Server. There are more cases, where pool['path'] is expected. uvmm volumes qemu://ceph03.cephtest.local/system ceph_rbd
(In reply to Philipp Hahn from comment #0) > duplicates univention/uvmm/protocol.py:class Data_Pool(object): > it not used itself. Is is already removed by git:d3421471b0bc7e609197a81e6cd4e2bcea8583ee Thanks to our internal use of Ceph and Stephan's workshop on that I now haven an easy way to setup my own Ceph cluster for development and testing: <https://git.knut.univention.de/phahn/ceph-workshop>
This is still an issues with UCS-4.4-2 with a rbd pool: 2019-11-11 09:12:15,605 - uvmmd.unix - ERROR - [1049] Exception: 'NoneType' object has no attribute 'findtext' Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/uvmm/unix.py", line 148, in handle_command res = cmd(self, command) File "/usr/lib/pymodules/python2.7/univention/uvmm/commands.py", line 610, in STORAGE_POOLS pools = storage.storage_pools(node_stat) File "/usr/lib/pymodules/python2.7/univention/uvmm/storage.py", line 456, in storage_pools for pool in timeout(node.conn.listAllStoragePools)() File "/usr/lib/pymodules/python2.7/univention/uvmm/storage.py", line 437, in get_pool_info res.path = pool_tree.find('target').findtext('path') AttributeError: 'NoneType' object has no attribute 'findtext' Also see Bug #49297 for mishandling disk/@type='volume' storage volumes.
UVMM and virtualization with UCS is deprecated and will no longer be developed in UCS 4.4; they have already been removed from UCS 5.0.