2017-05-29 21:20:06 +02:00
|
|
|
<disk type="block" device="{{ options.get('devtype', 'disk') }}">
|
|
|
|
<driver name="phy" />
|
|
|
|
<source dev="{{ device.device_node }}" />
|
|
|
|
{%- if 'frontend-dev' in options %}
|
|
|
|
<target dev="{{ options.get('frontend-dev') }}" />
|
2019-11-18 05:10:09 +01:00
|
|
|
{%- elif options.get('devtype', 'disk') == 'cdrom' and not vm.kernel %}
|
|
|
|
<!-- prefer xvdd for CDROM -->
|
|
|
|
<target dev="xvdd" />
|
2017-05-29 21:20:06 +02:00
|
|
|
{%- else %}
|
2020-01-22 11:10:50 +01:00
|
|
|
<target dev="xvd{{dd[counter.i]}}" />
|
|
|
|
{% if counter.update({'i': counter.i + 1}) %}{% endif %}
|
2017-05-29 21:20:06 +02:00
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
{%- if options.get('read-only', 'no') == 'yes' %}
|
|
|
|
<readonly />
|
|
|
|
{%- endif %}
|
|
|
|
|
2017-07-03 23:42:39 +02:00
|
|
|
{%- if device.backend_domain.name != 'dom0' %}
|
2017-05-29 21:20:06 +02:00
|
|
|
<backenddomain name="{{ device.backend_domain.name }}" />
|
2017-07-03 23:42:39 +02:00
|
|
|
{%- endif %}
|
2017-05-29 21:20:06 +02:00
|
|
|
</disk>
|