Hi,
It has come to my attention that in recent times there was some change in how VDI format is tracked in XAPI database, especially with arrival of QCOW2 support, first in XenServer (GFS2 SRs only) and then in XCP-ng 8.3 (other SR types).
Currently, I have access to XCP-ng 8.1 and 8.3 (with latest updates) and I'm seeing these differences:
XCP-ng 8.1:
$ xe vdi-param-list uuid=SOMEUUID
...
sm-config (MRO): vdi_type: vhd
...
XCP-ng 8.3:
$ xe vdi-param-list uuid=SOMEUUID
...
sm-config (MRO): image-format: vhd
...
So it seems what was earlier vdi_type is now image-format key in a sm-config parameter of a VDI.
On the other hand, some people are reporting having both keys present in sm-config, e.g.:
...
sm-config (MRO): image-format: vhd; vdi_type: vhd
...
Neither are well documented and I can't find any official info on what keys in sm-config are supported and what is their purpose. Maybe devs can shed some light on this?
To add to the confusion, official XenServer documentation mentiones a key just called type when creating raw VDIs:
xe vdi-create sr-uuid=sr-uuid type=user virtual-size=virtual-size \
name-label=VDI name sm-config:type=raw
In my testing this transparently gets renamed to image-format in latest version of XCP-ng.
The reason this bothers me is that I was asked to implement reporting of VDI format in my Ansible modules for XCP-ng but now I'm not sure how to do it across all of the supported versions of XenServer and XCP-ng. Currently it looks like I should try to get vdi_type and fallback to image-format if the first one is not found but I'm not certain if these keys are interchangable and have the same purpose or they just happen to sometimes have the same value.
Any info on this subject is well appreciated. Thanks.