XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    How to reliably determine VDI format (vhd, qcow2, raw) via XAPI across versions

    Scheduled Pinned Locked Moved Development
    1 Posts 1 Posters 7 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bvitnikB Offline
      bvitnik
      last edited by bvitnik

      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 the 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 called just 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 the 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. Also, ISO image VDIs seems to be missing any format indication.

      Any info on this subject is well appreciated. Thanks.

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post