1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 11:46:49 +00:00
webvirtcloud/instances/templates/instances/destroy_instance_form.html
catborise dbc7e688ac feat(instances): a shut-off VM with a TPM migrates with its TPM state
A shut-off VM with TPM state, as every Windows 11 VM, was refused for
migration: the state is a file of the source host, and an offline move
would start it there with a new TPM. Such a VM now migrates as a shut-off
VM with disks to copy does: its UEFI variables are copied, it is started
paused, its CPUs never run, migrates live, which carries the TPM state,
and is shut off on the destination. A shut-off VM with a saved state is
refused before any of that, for every way it moves: started paused, it
would resume and then lose the saved memory.

The clone tab says that a clone gets a new, empty TPM, and the destroy
page that the TPM state goes with the VM.
2026-11-01 18:29:53 +03:00

55 lines
3.4 KiB
HTML

{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% blocktrans with name=instance.name %}Destroy {{ name }}{% endblocktrans %}{% endblock title %}
{% block page_heading %}
{% blocktrans with name=instance.name %}Destroy {{ name }}{% endblocktrans %} <small class="text-body-secondary fs-6">{% blocktrans with host=instance.compute.name %}on {{ host }}{% endblocktrans %}</small>
{% endblock page_heading %}
{% block content %}
<p class="small">{% trans "The VM's definition, saved state and snapshot records are removed. A running VM is forced off first; what the guest has not written to disk is lost." %}</p>
<form action="{% url 'instances:destroy' instance.id %}" method="post" id="delete_form">{% csrf_token %}
<fieldset class="mb-3">
<legend class="h6">{% trans "What should happen to the files?" %}</legend>
<div class="row g-2">
<div class="col-12 col-md-6">
<label class="border rounded p-3 d-block h-100">
<input class="form-check-input me-2" type="radio" name="delete_disk" value="true" checked>
<strong>{% trans "Delete disk files" %}</strong>
<span class="small d-block mt-2">{% trans "With them go this VM's external snapshot files, snapshot memory files and cloud-init seed." %}</span>
</label>
</div>
<div class="col-12 col-md-6">
<label class="border rounded p-3 d-block h-100">
<input class="form-check-input me-2" type="radio" name="delete_disk" value="false">
<strong>{% trans "Keep the disk files" %}</strong>
<span class="small d-block mt-2">{% trans "They stay with their internal snapshot data; the snapshot records still go with the VM." %}</span>
</label>
</div>
</div>
</fieldset>
{% if instance.config_disks %}
<p class="small fw-semibold mb-1">{% trans "Disks" %}</p>
<ul class="small ps-3">
{% for disk in instance.config_disks %}
<li><strong>{{ disk.dev }}</strong> <span class="text-break">{{ disk.path|default:_("no file") }}</span></li>
{% endfor %}
</ul>
{% endif %}
<p class="small text-body-secondary">{% trans "A file another VM uses on any of the panel's hosts, directly or under its own disk, is kept, and so is the template a disk was made from. If a host cannot be checked, the VM is not destroyed." %}</p>
{% if instance.nvram %}
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" name="delete_nvram" value="true" id="delete_nvram" checked>
<label class="form-check-label" for="delete_nvram">{% trans "Delete the NVRAM file (firmware settings). Untick to keep it." %}</label>
</div>
{% endif %}
{% if instance.config_tpm == "emulator" %}
<p class="small text-body-secondary" id="destroy-tpm">{% trans "Its TPM state is deleted with it, and the keys in it, such as BitLocker's." %}</p>
{% endif %}
<div class="border-top pt-3 d-flex flex-wrap align-items-center gap-2">
<span class="small text-danger me-auto">{% trans "This cannot be undone." %}</span>
<a class="btn btn-secondary" href="{% url 'instances:instance' instance.id %}">{% trans "Cancel" %}</a>
<button class="btn btn-danger" type="submit" name="delete">{% trans "Destroy VM" %}</button>
</div>
</form>
{% endblock content %}