KVM host with Ceph based storage pool

Hi,

I wanted to try composing VMs with a Ceph (RBD) based storage pool.
I configured my KVM host manually to add the RBD libvirt storage pool.
It works perfect and I can create a VM with virt-manager or virt-install with no issue but in MaaS UI, when I want to add the KVM host, I get this error :

Error: Performing refresh failed: Failed talking to pod: list index out of range

As soon as I disable the RBD storage pool, it works.

I get these errors in MaaS logs :

2020-09-10 15:43:55 provisioningserver.rpc.pods: [critical] Failed to discover pod.
	Traceback (most recent call last):
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 500, in errback
	    self._startRunCallbacks(fail)
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 567, in _startRunCallbacks
	    self._runCallbacks()
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 653, in _runCallbacks
	    current.result = callback(current.result, *args, **kw)
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1442, in gotResult
	    _inlineCallbacks(r, g, deferred)
	--- <exception caught here> ---
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
	    result = result.throwExceptionIntoGenerator(g)
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
	    return g.throw(self.type, self.value, self.tb)
	  File "/snap/maas/8980/lib/python3.6/site-packages/provisioningserver/drivers/pod/virsh.py", line 1416, in discover
	    discovered_pod = yield deferToThread(conn.get_pod_resources)
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
	    result = inContext.theWork()
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
	    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/snap/maas/8980/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
	    return func(*args,**kw)
	  File "/snap/maas/8980/lib/python3.6/site-packages/provisioningserver/utils/twisted.py", line 217, in wrapper
	    result = func(*args, **kwargs)
	  File "/snap/maas/8980/lib/python3.6/site-packages/provisioningserver/drivers/pod/virsh.py", line 669, in get_pod_resources
	    discovered_pod.storage_pools = self.get_pod_storage_pools()
	  File "/snap/maas/8980/lib/python3.6/site-packages/provisioningserver/drivers/pod/virsh.py", line 561, in get_pod_storage_pools
	    pool_path = evaluator(XPATH_POOL_PATH)[0].text
	builtins.IndexError: list index out of range

What I understand is the fact that the POOL_PATH value is missing but this is normal for that kind of storage pool, there is no target/path defined in the XML configuration as you can see :

<pool type="rbd">
  <name>ceph</name>
  <uuid>b07e4d87-c6a7-4a61-a00c-9608004cb418</uuid>
  <capacity unit="bytes">4801135902720</capacity>
  <allocation unit="bytes">0</allocation>
  <available unit="bytes">4753516195840</available>
  <source>
    <host name="192.168.111.20" port="6789"/>
    <name>libvirt-pool</name>
    <auth type="ceph" username="libvirt">
      <secret uuid="0d64e8cf-f540-4c58-abb2-0d4b9f7eb8b9"/>
    </auth>
  </source>
</pool>