1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

feat(instances): free a running VM's unused disk space with the guest agent

The Disks tab of a running VM gets "Free unused space": a job
(instance.fstrim) has the guest agent trim each mounted file system
(guest-fstrim, 30 minutes at most) and lists what each one trimmed. A
disk passes the trim to its image file only with the discard mode unmap:
the tab and the job say when no disk of the running VM has it, and where
to set it (the disk's device details, from the next start).
This commit is contained in:
catborise 2026-11-25 10:51:41 +03:00
parent d6cee18434
commit 8625d6250a
17 changed files with 367 additions and 5 deletions

View file

@ -21,7 +21,7 @@
</div>
<div class="small text-body-secondary mt-1">{% trans "User" %}: {{ job.username }}</div>
</div>
{% if job.phase or op.progress_total or job.cancellable or job.error or job.result.open or job.result.links or job.result.warning or job.result.left_behind or job.resolution %}
{% if job.phase or op.progress_total or job.cancellable or job.error or job.result.open or job.result.links or job.result.warning or job.result.left_behind or job.result.trimmed or job.resolution %}
<div class="card-body pb-0">
{% if job.phase or job.cancellable %}
<div class="d-flex flex-wrap align-items-center gap-2 mb-3">
@ -64,6 +64,12 @@
{% if job.result.warning %}
<div class="alert alert-warning text-break" role="alert">{{ job.result.warning }}</div>
{% endif %}
{% if job.result.trimmed %}
<h2 class="h6">{% trans "Trimmed" %}</h2>
<ul class="list-unstyled mb-3">
{% for fs in job.result.trimmed %}<li class="text-break"><code>{{ fs.path }}</code> {% if fs.error %}{{ fs.error }}{% elif fs.trimmed is None %}{% trans "trimmed" %}{% else %}{{ fs.trimmed|binary_size }}{% endif %}</li>{% endfor %}
</ul>
{% endif %}
{% if job.result.left_behind %}
<h2 class="h6">{% trans "Left behind" %}</h2>
<ul class="list-unstyled mb-3">