From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 3A7381FF17A for ; Fri, 4 Jul 2025 16:16:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 81AFF39753; Fri, 4 Jul 2025 16:17:10 +0200 (CEST) Message-ID: Date: Fri, 4 Jul 2025 16:16:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Daniel Kral References: <20250620143148.218469-1-d.kral@proxmox.com> <20250620143148.218469-28-d.kral@proxmox.com> Content-Language: en-US From: =?UTF-8?Q?Michael_K=C3=B6ppl?= In-Reply-To: <20250620143148.218469-28-d.kral@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.218 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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 23/26] api: introduce ha rules api endpoints 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On 6/20/25 16:31, Daniel Kral wrote: > +my $check_feasibility = sub { > + my ($rules) = @_; > + > + $rules = dclone($rules); > + > + # set optional rule parameter's default values > + for my $rule (values %{ $rules->{ids} }) { > + PVE::HA::Rules->set_rule_defaults($rule); > + } > + > + # TODO PVE 10: Remove group migration when HA groups have been fully migrated to location rules > + if (!PVE::HA::Config::is_ha_location_enabled()) { > + my $groups = PVE::HA::Config::read_group_config(); > + my $services = PVE::HA::Config::read_and_check_resources_config(); > + > + PVE::HA::Rules::Location::delete_location_rules($rules); > + PVE::HA::Groups::migrate_groups_to_rules($rules, $groups, $services); > + } > + > + return PVE::HA::Rules->check_feasibility($rules); > +}; > + > +my $assert_feasibility = sub { > + my ($rules, $ruleid) = @_; > + > + my $global_errors = $check_feasibility->($rules); > + my $rule_errors = $global_errors->{$ruleid}; > + > + return if !$rule_errors; Consider the following scenario: I have a colocation rule with vm:100 and vm:101 together and a location rule for vm:100 and node1. I would still be able to add another location rule for vm:101 and node2 because $global_errors would contain an error for the colocation rule, but $rule_errors would still be empty as it's strictly speaking not an error for the location rule I just created and its ID is not contained in $global_errors. >From a technical standpoint this makes sense, but from a user's perspective I found this a bit confusing, as whether or not I received an error dialog upon creation which also stopped me from creating a contradictory rule depended on the order in which I create said rules. I understand that, at the moment, location rules trump colocation rules in this regard and as long as the colocation rule is disabled and displays a warning as a result of such a scenario, I don't see a problem with it. Just wanted to note this as a potential future improvement. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel