Am 27.02.23 um 15:04 schrieb Thomas Lamprecht: > Am 16/02/2023 um 13:35 schrieb Fiona Ebner: >> Add a get_derived_property() method to AbstractConfig.pm, taking a >> (partial) config and the name for the derived property. The first two >> will be 'maxcpu' and 'maxmem' (should I use 'max-cpu' or different >> names?), because that's what HA manager needs. > > Yeah, would prefer having *some* sort of casing, as none is IMO needlessly > hard to read. kebab-case would work fine for me. >
Okay! > >> >> The partial config needs to contain all actual properties needed to >> compute the derived property, e.g. 'vcpus', 'sockets' and 'cores' for >> 'maxcpu' in case of VMs. >> >> If we switch to get_guest_config_properties(), there needs to be a > > do you mean `get_derived_property` here? Sorry, should've been clearer. I mean PVE::Cluster::get_guest_config_properties() where it's only possible to query specific properties, hence the need for the second method. > >> second method to request which properties are actually needed for the >> computation of the derived property beforehand. > > I.e., something like a `get_derived_property_inputs` sub? > Yes. >> >> Whenever something in the actual properties changes, the calculation >> needs to be adapted to still yield the same result for the derived >> property, but this can be done entirely in the VM/CT plugin implementation. >> >> Whenever HA manager needs something new, a new derived property is >> implemented in the plugins and dependency bumps for >> qemu-server/pve-container are done. > > It has some complexity, but I don't have a really better idea, so fine > by me. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel