1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/instances/templates/add_instance_cdrom.html
catborise 2a05576e18 feat(instances): a CD-ROM is added on the bus chosen, with its ISO
A running VM got its new CD-ROM on SCSI, the one bus the panel could plug
in then, and Windows does not see a virtio-scsi drive before the driver
on that ISO is installed. Add CD-ROM is now a dialog that chooses the bus
and the ISO: a running VM takes USB, first, which every guest sees and
which hot-plugs, or SCSI; a shut-off one SATA (IDE on pc), SCSI or USB.
libvirt has no empty USB drive, so a USB CD-ROM takes its ISO when it is
added and is detached instead of ejected, also while the VM runs.

A USB CD-ROM is a CD drive on QEMU's usb-bot only. Where QEMU has none
(RHEL 9), libvirt took usb-storage, which shows the guest a hard disk
that Windows does not read; the drive now asks for usb-bot, and such a
host refuses it with libvirt's message.
2026-11-01 16:27:39 +03:00

43 lines
2.7 KiB
HTML

{% load i18n %}
{% load bootstrap_icons %}
<button type="button" class="btn btn-sm btn-secondary" data-bs-toggle="modal" data-bs-target="#addInstanceCdrom"{% if not cdrom_buses %} disabled{% endif %}>{% bs_icon 'plus' %} {% trans "Add CD-ROM" %}</button>
<div class="modal fade" id="addInstanceCdrom" tabindex="-1" role="dialog" aria-labelledby="addInstanceCdromLabel" aria-hidden="true">
<div class="modal-dialog">
<form class="modal-content" action="{% url 'instances:add_cdrom' instance.id %}" method="post" aria-label="{% trans "Add CD-ROM form" %}">{% csrf_token %}
<div class="modal-header">
<h5 class="modal-title" id="addInstanceCdromLabel">{% trans "Add CD-ROM" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans "Close" %}"></button>
</div>
<div class="modal-body">
<div class="row g-3">
<div class="col-sm-4">
<label class="form-label" for="add-cdrom-bus">{% trans "Bus" %}</label>
<select class="form-select" id="add-cdrom-bus" name="bus" aria-describedby="add-cdrom-help">
{% for bus in cdrom_buses %}
<option value="{{ bus }}">{{ bus }}</option>
{% endfor %}
</select>
</div>
<div class="col-sm-8">
<label class="form-label" for="add-cdrom-media">{% trans "ISO image" %}</label>
<select class="form-select" id="add-cdrom-media" name="media">
{% for iso in instance.media_iso %}
<option value="{{ iso }}">{{ iso }}</option>
{% endfor %}
<option value="">{% trans "No media" %}</option>
</select>
</div>
<div class="col-12 form-text mt-2" id="add-cdrom-help">
{% trans "Windows sees USB, SATA and IDE drives without a driver; SCSI ones need the virtio driver." %}
{% trans "A running VM takes USB and SCSI drives. A USB drive needs an ISO image, is detached instead of ejected, and needs a QEMU with usb-bot (not RHEL 9's)." %}
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
<button type="submit" class="btn btn-primary">{% trans "Add" %}</button>
</div>
</form>
</div>
</div>