From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 8972C1FF15C for ; Fri, 27 Jun 2025 11:10:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4790610A86; Fri, 27 Jun 2025 11:10:46 +0200 (CEST) Message-ID: <527054c0-0385-4b2b-83b5-0b15a7ff69c4@proxmox.com> Date: Fri, 27 Jun 2025 11:10:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Daniel Kral To: pve-devel@lists.proxmox.com References: <20250620143148.218469-1-d.kral@proxmox.com> <20250620143148.218469-20-d.kral@proxmox.com> Content-Language: en-US In-Reply-To: <20250620143148.218469-20-d.kral@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH ha-manager v2 15/26] manager: handle migrations for colocated services X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On 6/20/25 16:31, Daniel Kral wrote: > +=head3 get_colocated_services($rules, $sid) > + > +Returns a list of two hash sets, where the first hash set contains the > +positively colocated services for C<$sid>, while the second hash set contains > +the negatively colocated services for C<$sid> according to the colocation rules > +in C<$rules>. > + > +For example, if a service is in a negative colocation with C<'vm:101'> and in a > +positive colocation with C<'ct:200'> and C<'ct:201'>, the returned value will be: > + > + { > + together => { > + 'vm:101' => 1 > + }, > + separate => { > + 'ct:200' => 1, > + 'ct:201' => 1 > + } > + } > + > +=cut > + I'd tend to introduce another colocation rules canonicalize helper in v3 to also make any negatively colocated services of the positively colocated services of a service $sid also negatively colocated with that service $sid. This could also be done in get_colocated_services(...) and get_colocation_preference(...) individually, but introducing these inferred extra rules ends up in less code. An example could help here to understand the above better: Services A, B, and C must be kept together Services A and Z must be kept separate Therefore, services B and Z must be kept separate and services C and Z must be kept separate too. I hope this is still intuitive enough for users (came across it while implementing showing the comigrated services / blocking services in the web interface) and must prevent invalid migrations as a migration of service B would currently allow "comigrating" service A (!) and C to the node of service Z. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel