<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to reliably determine VDI format (vhd, qcow2, raw) via XAPI across versions]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">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).</p>
<p dir="auto">Currently, I have access to XCP-ng 8.1 and 8.3 (with latest updates) and I'm seeing these differences:</p>
<p dir="auto">XCP-ng 8.1:</p>
<pre><code>$ xe vdi-param-list uuid=SOMEUUID
...
               sm-config (MRO): vdi_type: vhd
...
</code></pre>
<p dir="auto">XCP-ng 8.3:</p>
<pre><code>$ xe vdi-param-list uuid=SOMEUUID
...
               sm-config (MRO): image-format: vhd
...
</code></pre>
<p dir="auto">So it seems what was earlier <code>vdi_type</code> is now <code>image-format</code> key in the <code>sm-config</code> parameter of a VDI.</p>
<p dir="auto">On the other hand, some people are reporting having both keys present in <code>sm-config</code>, e.g.:</p>
<pre><code>...
               sm-config (MRO): image-format: vhd; vdi_type: vhd
...
</code></pre>
<p dir="auto">Neither are well documented and I can't find any official info on what keys in <code>sm-config</code> are supported and what is their purpose. Maybe devs can shed some light on this?</p>
<p dir="auto">To add to the confusion, <a href="https://docs.xenserver.com/en-us/xenserver/8/storage.html" target="_blank" rel="noopener noreferrer nofollow ugc">official XenServer documentation</a> mentiones a key called just <code>type</code> when creating raw VDIs:</p>
<pre><code>xe vdi-create sr-uuid=sr-uuid type=user virtual-size=virtual-size \
        name-label=VDI name sm-config:type=raw
</code></pre>
<p dir="auto">In my testing this transparently gets renamed to <code>image-format</code> in the latest version of XCP-ng.</p>
<p dir="auto">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 <code>vdi_type</code> and fallback to <code>image-format</code> 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.</p>
<p dir="auto">Any info on this subject is well appreciated. Thanks.</p>
]]></description><link>https://xcp-ng.org/forum/topic/12259/how-to-reliably-determine-vdi-format-vhd-qcow2-raw-via-xapi-across-versions</link><generator>RSS for Node</generator><lastBuildDate>Thu, 04 Jun 2026 23:50:03 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/12259.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Jun 2026 21:26:25 GMT</pubDate><ttl>60</ttl></channel></rss>