diff --git a/console/views.py b/console/views.py index 656e9238..6f5d618f 100644 --- a/console/views.py +++ b/console/views.py @@ -11,12 +11,10 @@ from django.conf import settings from django.shortcuts import redirect, render from django.utils.translation import gettext_lazy as _ from instances.models import Instance -from instances.utils import can_open_console +from instances.utils import can_open_console, novnc_unreachable from libvirt import libvirtError from operations.utils import safe_text -from vrtManager.connection import CONN_TCP, CONN_TLS from vrtManager.instance import wvmInstance -from vrtManager.util import is_loopback from webvirtcloud.middleware import error_text logger = logging.getLogger(__name__) @@ -68,9 +66,8 @@ def console(request, compute_id, uuid): running = conn.instance.isActive() # novncd reaches a console that listens on its host's loopback only # through SSH (or on this host); the running VM's listener, as novncd sees it - unreachable = instance.compute.type in (CONN_TCP, CONN_TLS) and bool( - conn.get_console_socket() or is_loopback(conn.get_console_listener_addr()) - ) + unreachable = novnc_unreachable(instance.compute.type, conn.get_console_socket(), + conn.get_console_listener_addr()) except libvirtError as err: # the host or the VM could not be read: the page says that, not to check the console settings logger.warning("Console of %s on %s: %s", instance.name, instance.compute.name, safe_text(err)) diff --git a/doc/behavior-changes.md b/doc/behavior-changes.md index fab22611..cf04588e 100644 --- a/doc/behavior-changes.md +++ b/doc/behavior-changes.md @@ -33,6 +33,7 @@ What an update from an older version changes for operators and users. To run the - On a running VM the edit forms show the settings as they will be at the next start, so saving an edit no longer reverts another pending change. - External snapshots need libvirt 9.9 or newer on the computes. libvirt 9.10 (openEuler 24.03 LTS) refuses to revert a snapshot taken without memory of a running or paused VM ("Invalid target domain state 'disk-snapshot'"); 11.10 reverts it. A VM's snapshots form one chain: after a revert, delete the newer snapshots before taking another. An internal snapshot is reverted only on a shut-off VM. Snapshot names no longer get an `s1.` prefix. A snapshot an older version took of a UEFI VM can only be deleted, not reverted. On NFS, the qemu user needs write access to the image directory to remove merged snapshot files. - A superuser limits a disk's I/O (IOPS and MiB/s, reads and writes together) under its Device details on the Disks tab; a running VM gets the limit at once. +- The VM page shows a running or paused VM's screen beside its summary, read again every 10 seconds, to those who may open its console; clicking it opens the console. It needs a VNC or SPICE console and a host whose libvirt gives screenshots as PNG (libvirt 9 and QEMU 7.1 or later); otherwise it is not shown. - **Free unused space** on a running VM's Disks tab (superusers) has its guest agent trim each file system (`guest-fstrim`, a job that lists what each one trimmed). Only a disk with the discard mode `unmap` (Device details, from the VM's next start; Settings > Disk Discard for new disks) passes it to its image file, which then shrinks; the tab says when no disk has it. - A storage volume a VM still needs (a disk, a backing file or a snapshot's file) is not deleted; deleting a VM with its files keeps a file another compute's VM or volume uses at the same path, and is refused before the VM is stopped when one of the other computes cannot be reached. A pool's page names the VMs of its host that use each volume and lists those the host does not use. - A VM that vanishes from its compute, or whose compute is deleted, keeps its owners, tags, protection and schedules for `INSTANCE_OWNERSHIP_RETENTION_DAYS` (30) in case the same UUID comes back, and its backups are linked to it again; superusers manage these records on the "Removed VMs" page. diff --git a/instances/templates/instance.html b/instances/templates/instance.html index 6791b693..322174ad 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -21,7 +21,8 @@ data-opens-on="{% if instance.is_template and can_clone %}#clone{% endif %}" data-random-mac-url="{% url 'instances:random_mac_address' %}" {% if can_open_console and vdi_reachable %}data-vdi-url="{% url 'vdi_url' compute.id instance.name %}"{% endif %}> -