Open rck opened 5 years ago
Hi @rck, I think with the current implementation it might be possible to attach the VDI to dom0, but you need to return a XenDisk
as well to be able to plug the VDI into a VM. For this you can start a qemu-dp
process, from that you can return a XenDisk
and a Nbd
. You can find a existing implementation here: https://github.com/rposudnevskiy/xcpng-storage-libs/blob/master/xapi/storage/libs/xcpng/datapath.py , I don't know whether this implementation works, but looks roughly ok, I haven't tried it. (Or you can look at the existing datapath plugins installed on XenServer)
Thank you for the hint, but what you linked is "xcpng", I use the original one. And when I there compare for example the implementation of qemudisk.py
, they are completely different. Mine on xenserver has a different interface and lots of "fixmes" and "would not work with raw devices",... So should I backport these libs?
@gaborigloi Actually, I think this issue should stay open, if returning a block device is not good enough and a plugin implementer has to go down the rabbit hole of XenDisks, qemu-dp, nbd, something is broken in the plugin system. This could be a tracking ticket for that.
I thought that xcp-ng code could be a starting point - you could take the datapath plugin and adapt it to your needs, if the license permits that. Writing a datapath plugin definitely requires XenServer knowledge. But it's true that the documentation could mention that XenDisk must be returned for attaching to VMs. So I'll keep this open as a documentation issue.
I'm working on a SR, volume, datapath plugin for API version v5 that integrates LINSTOR/DRBD. Things look promising, I got a SR in xencenter and the functions I can test for the volume/datapath plugin on the CLI look good. This is developed on xenserver 7.6.0.
Unfortunately, if I create a VM in the GUI (and it also then happens on shutdown), I geht this error:
datapath.Attach returns this kind of dictionary:
This nicely passes the type checks in
/usr/lib/python2.7/site-packages/xapi/storage/api/v5/datapath.py
but then fails somewhere down the road. The block device exists and is accessible on the machine. Yeah, I don't want to implement a "XenDisk", DRBD operates on block devices. Is this a bug or did I misunderstand something? "implementations" is a "variant" type, mine is "BlockDevice|. What is wrong with that?Any hints? Best, rck