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

feat(computes): the Computes page tells what a host lacks for another host's VMs

A VM migrated to a host without its network, network filter or secret was
refused only when the migration was asked for. The box above the hosts now
names, for each pair of hosts it has read, what the VMs of one use (their
running definition and the one for the next start) that the other lacks: an
active network, a network filter or one of other rules, a secret by UUID or
usage; the migration check refuses moving those VMs there. A host in
maintenance is no destination. What a host's VMs need is read on its own
thread, apart from the pools and snapshots, and used again for 5 minutes, so
a host of many VMs is compared too. The rules of two hosts' filters are
compared as the migration check does (filter_rules, shared).
This commit is contained in:
catborise 2026-11-20 12:33:37 +03:00
parent b36f674542
commit 640511cfd4
11 changed files with 542 additions and 321 deletions

View file

@ -78,7 +78,7 @@ from lxml import etree
from vrtManager import util
from vrtManager.connection import NVRAM_DIR, wvmConnect
from vrtManager.nodedevs import check_hostdevs, pci_address, pci_label, usb_selector, usb_selector_label
from vrtManager.nwfilters import same_text
from vrtManager.nwfilters import filter_rules
from vrtManager.storage import wvmStorage, wvmStorages
from vrtManager.virtsecrets import REF_USAGE_TYPES
@ -138,10 +138,7 @@ class wvmInstances(wvmConnect):
source (another connection), each sorted. A VM runs with its host's
filters of those names, whatever their rules."""
def rules(wvm, name):
tree = etree.fromstring(wvm.nwfilterLookupByName(name).XMLDesc(0))
for uuid in tree.findall("uuid"): # each host's own
tree.remove(uuid)
return same_text(etree.tostring(tree, encoding="unicode")), tree.xpath("filterref/@filter")
return filter_rules(wvm.nwfilterLookupByName(name))
if not names: # the hosts are asked only about what the cards name
return [], []