Otherwise it is rather non-deterministic if the HA rules are actually
applied as it depends whether the HA Manager is on one of the nodes,
which have already been upgraded to the new version.

Signed-off-by: Daniel Kral <d.k...@proxmox.com>
---
 src/PVE/API2/HA/Rules.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PVE/API2/HA/Rules.pm b/src/PVE/API2/HA/Rules.pm
index 62d05440..881f36f6 100644
--- a/src/PVE/API2/HA/Rules.pm
+++ b/src/PVE/API2/HA/Rules.pm
@@ -259,6 +259,9 @@ __PACKAGE__->register_method({
         PVE::Cluster::check_cfs_quorum();
         mkdir("/etc/pve/ha");
 
+        die "cannot create ha rule: ha groups have not been migrated yet\n"
+            if !PVE::HA::Config::have_groups_been_migrated();
+
         my $type = extract_param($param, 'type');
         my $ruleid = extract_param($param, 'rule');
 
@@ -305,6 +308,9 @@ __PACKAGE__->register_method({
     code => sub {
         my ($param) = @_;
 
+        die "cannot update ha rule: ha groups have not been migrated yet\n"
+            if !PVE::HA::Config::have_groups_been_migrated();
+
         my $ruleid = extract_param($param, 'rule');
         my $digest = extract_param($param, 'digest');
         my $delete = extract_param($param, 'delete');
-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to