From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9F2E41FF0B7 for ; Fri, 13 Nov 2026 16:05:09 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3FEE221666; Fri, 13 Nov 2026 16:05:04 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 13 Nov 2026 16:04:57 +0100 Message-Id: Subject: Re: [PATCH ha-manager v2 02/16] tree-wide: use the term vmid instead of name when referring to VMs/CTs From: "Daniel Kral" To: "Thomas Lamprecht" , X-Mailer: aerc 0.22.0-10-g6373ac9d2179-dirty References: <20261112163113.294302-3-d.kral@proxmox.com> <20261112163113.294302-5-d.kral@proxmox.com> <7fad08fb-62eb-4e5a-b73e-800ec7e46c04@proxmox.com> In-Reply-To: <7fad08fb-62eb-4e5a-b73e-800ec7e46c04@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794582298050 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.579 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: UL6E6SVD5YQQ7DMCRZJZ6UO5NU6LA4DB X-Message-ID-Hash: UL6E6SVD5YQQ7DMCRZJZ6UO5NU6LA4DB X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu Nov 12, 2026 at 11:33 PM CET, Thomas Lamprecht wrote: > Am 12.11.26 um 17:33 schrieb Daniel Kral: >> The variable name $name is a bit generic when referring to the unique >> identifier for VMs/CTs, so actually name it after its identifier VMID. > > FWIW, this variable naming came from the original plan of adding > more resources types besides VMs and CTs, which was then scrapped > (I briefly tried with a floating IP ages ago, but it wasn't really > worth it especially as setting up e.g. HAProxy gives one a bit > nicer properties here. > > So this renaming might be OK to do, just wanted to give some > history context for why these variable names were chosen. > > btw. this is also the main reason for why the type is in the sid. > As just for guest IDs we know that they are unique and can be always > mapped to their underlying type just by the plain integer VMID anyway, > but the preparation for generic resource types made this sensible. > > ($sid, $type, $name) -> ($resource, $type, $id) (or $resource_type, > $resource_id) would be technically probably the more fitting and/or > consequent rename, but again not sure if worth the churn. Also you > here still use "name" in e.g. "verify_name" method name. > > btw. I can get where you come from, but such renaming patches might > be actually suited better at the back of a series to allow easily > omitting them, as they are a great bikeshedding target (proof: see > this reply ;-)) > > Given the next parse_vmid_or_sid patch and also the goal of this > series being performance improvement, which often gets most out > of leveraging the specific use case rather over the intended > potential future use case that did not materialize in over a decade > of this software stack (time really flies) I can be fine with > more actively going away from that premise (still not /that/ happy, > it still feels like we leave out some potential unused then - otoh, > can all be reworked again in the future if really needed). Yeah, I figured that this stemmed from planning on adding other kinds of HA resources... Should have noted that a bit better in the patch message. My train of thought mostly was that adding those would likely mean that something about the current abstraction of HA resources would have to change anyway... or maybe not. My thought was that if there are other HA resource types such as 'storage' or 'ipaddr', then they would be connected in some way to VMs or CTs (e.g. using a certain storage) or even with each other, which are dependencies that aren't really present in the HA Manager at the moment (besides the resource affinity rules). Would be interesting though to hear your thoughts what types of resources the HA Manager could handle in the future, maybe at a quieter time in the future ;-). It would also be interesting to see what type of HA capabilities can also be done with the SDN and now the SAN multipathing series (at least on the link level). I digress, I guess dropping the s/$name/$vmid/ in PVE::HA::LRM and PVE::HA::Resources here would be a good option, letting $name stay in the generic code paths, but using $vmid where it's clear that it is always a VMID, i.e., in the API, CLI, PVEVM, PVECT, and PVE::HA::Config.