mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix: a backup's files say so on the pool page; Removed VMs names schedules and backups
On a backup target's pool every backup file was "Not used on this host" and listed with the unused volumes, though its deletion there is refused: it is deleted with its backup. The column now says "Backup of <VM>" and counts it as in use. A VM kept on the Removed VMs page for its schedules or backups alone showed no owner and no reason; its row now names its schedules and counts its backups.
This commit is contained in:
parent
aeef837afa
commit
981ff7b294
11 changed files with 227 additions and 135 deletions
|
|
@ -23,7 +23,7 @@ from vrtManager.storage import wvmStorage, wvmStorages
|
|||
from storages.forms import AddStgPool, CloneImage, CreateVolumeForm
|
||||
from storages.jobs import is_iso
|
||||
from storages.upload import write_chunk
|
||||
from vmbackups.utils import refuse_backup_volume, refuse_target_pool
|
||||
from vmbackups.utils import backups_of, refuse_backup_volume, refuse_target_pool
|
||||
from webvirtcloud.gunicorn_worker import request_progressed
|
||||
|
||||
|
||||
|
|
@ -237,8 +237,10 @@ def storage(request, compute_id, pool):
|
|||
# which VMs of this host use each volume; the page lists them without it when it cannot be read
|
||||
with contextlib.suppress(libvirtError):
|
||||
users = conn.volume_users()
|
||||
backups = backups_of(compute, pool, [volume["name"] for volume in volumes or []])
|
||||
for volume in volumes or []:
|
||||
volume["iso"] = is_iso(volume["name"])
|
||||
volume["backup"] = backups.get(volume["name"])
|
||||
volume["users"] = users.get(volume["path"]) if users is not None else None
|
||||
try:
|
||||
size, free = conn.get_size()
|
||||
|
|
@ -258,6 +260,7 @@ def storage(request, compute_id, pool):
|
|||
"state": state,
|
||||
"volumes": volumes,
|
||||
"users_read": users is not None,
|
||||
"has_backups": bool(backups),
|
||||
"size": size,
|
||||
"free": free,
|
||||
"used": used,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue