xcp-ng / xcp-ng-xapi-storage

XCP-ng implementation of the xapi-storage interface
GNU Lesser General Public License v2.1
5 stars 3 forks source link

Cannot use RAW file with SR filebased #24

Open gthvn1 opened 2 months ago

gthvn1 commented 2 months ago
  1. I created a new SR of type filebased
  2. I created a raw VDI (using sm-config:type=raw) on this SR and attach it to a VM
  3. I started the VM and it fails because it tries to use VHD type when opening the disk with tap-ctl: In the SMlog I can see:
    ['tap-ctl', 'open', '-m', '0', '-p', '737932', '-a', 'vhd:/custom_sr/1', '-D']

    It looks like when we are calling the activate method from class COWDatapath it doesn't look the type of the file in the DB but always return VHD unless the VDI is sharable or is a block device. So in our case it is nor sharable nor a block device and the function _get_image_from_vdi() returns VHD. Shouldn't we look in the database to get the type of the VDI?

gthvn1 commented 2 months ago

Notice that in the DB the image_type is set to 0 that is IMAGE_RAW