Repetitive RBD disk definitions

wferi at niif.hu wferi at niif.hu
Fri Jan 24 10:34:29 UTC 2020


Hi,

I'm using libvirt 5.0.0 on a Ceph cluster.  The VM disks are all from
the same Ceph pool, so all my <disk> elements are basically the same:

    <disk type="network" device="disk">
      <driver name="qemu" type="raw" cache="none"/>
      <source protocol="rbd" name="vmdisks/VOLNAME">
        <host name="x.y.z.1" port="6789"/>
        <host name="x.y.z.2" port="6789"/>
        <host name="x.y.z.3" port="6789"/>
      </source>
      <auth username="libvirt">
        <secret type="ceph" usage="libvirt_key"/>
      </auth>
      <target dev="vdX"/>
    </disk>

... apart from the VOLNAME and vdX words.  Is there a way to factor out
(at least part of) the common stuff?  This repetition isn't totally
unmanageable, just not pretty.  Creating a libvirt storage pool seemed
like a good solution at first, but I couldn't find a way to
"instantiate" volumes in the domain XML (and defining them cluster-wide
would mean duplicating what Ceph does, which I'd rather avoid).
-- 
I'd be grateful for any ideas,
Feri.





More information about the libvirt-users mailing list