1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

fix(instances): a failed power cycle says the VM stays off; templates have no autostart

Power Cycle forced the VM off and, when the start failed, showed only
libvirt's error: the page now also says the VM was forced off and stays
off, and the audit row says so. A template kept the autostart it had as a
VM, so the host started it although the panel refuses to: marking a
template turns autostart off, and autostart is refused on a template. The
autostart switch is disabled, with the reason, on a template and on a VM
that exists only while it runs (libvirt refuses autostart there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-11 14:28:35 +03:00
parent 0ce1139c9d
commit 7dd68aaca4
10 changed files with 259 additions and 196 deletions

View file

@ -86,6 +86,10 @@ class Instance(models.Model):
def autostart(self) -> int:
return self.proxy.get_autostart()
@cached_property
def persistent(self) -> bool:
return self.proxy.instance.isPersistent()
@cached_property
def bootmenu(self) -> bool:
return self.proxy.get_bootmenu()