public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules
@ 2025-07-22 16:54 Michael Köppl
  2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 1/2] config: use entire path to groups.cfg path in delete_group_config Michael Köppl
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Köppl @ 2025-07-22 16:54 UTC (permalink / raw)
  To: pve-devel

These 2 patches are meant as a follow-up for the HA affinity rules
series [0]. During testing, I encountered some errors during the
persistent migration that stopped the entire migration from working.

[0] https://lore.proxmox.com/pve-devel/20250704181659.465441-1-d.kral@proxmox.com/

pve-ha-manager.git:

Michael Köppl (2):
  config: use entire path to groups.cfg path in delete_group_config
  ha: decode JSON string with version info returned by get_node_kv

 src/PVE/HA/Config.pm   | 3 ++-
 src/PVE/HA/Env/PVE2.pm | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)


Summary over all repositories:
  2 files changed, 5 insertions(+), 2 deletions(-)

-- 
Generated by git-murpp 0.8.0


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH FOLLOW-UP ha-manager 1/2] config: use entire path to groups.cfg path in delete_group_config
  2025-07-22 16:54 [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl
@ 2025-07-22 16:54 ` Michael Köppl
  2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 2/2] ha: decode JSON string with version info returned by get_node_kv Michael Köppl
  2025-07-23 15:37 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Köppl @ 2025-07-22 16:54 UTC (permalink / raw)
  To: pve-devel

Prepend /etc/pve/ to the path, as is done for other read and write
functions for the groups.cfg file. Otherwise, removing the file does not
work.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 src/PVE/HA/Config.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/HA/Config.pm b/src/PVE/HA/Config.pm
index 59bafd7..50d7972 100644
--- a/src/PVE/HA/Config.pm
+++ b/src/PVE/HA/Config.pm
@@ -235,8 +235,9 @@ sub read_group_config {
 }
 
 sub delete_group_config {
+    my $groups_config_file = "/etc/pve/$ha_groups_config";
 
-    unlink $ha_groups_config or die "failed to remove group config: $!\n";
+    unlink $groups_config_file or die "failed to remove group config: $!\n";
 }
 
 sub write_group_config {
-- 
2.47.2



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH FOLLOW-UP ha-manager 2/2] ha: decode JSON string with version info returned by get_node_kv
  2025-07-22 16:54 [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl
  2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 1/2] config: use entire path to groups.cfg path in delete_group_config Michael Köppl
@ 2025-07-22 16:54 ` Michael Köppl
  2025-07-23 15:37 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Köppl @ 2025-07-22 16:54 UTC (permalink / raw)
  To: pve-devel

The version info entries for each node returned by get_node_kv are JSON
strings and need to be decoded to read the version of the node.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 src/PVE/HA/Env/PVE2.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PVE/HA/Env/PVE2.pm b/src/PVE/HA/Env/PVE2.pm
index aecffc0..0ddc1ac 100644
--- a/src/PVE/HA/Env/PVE2.pm
+++ b/src/PVE/HA/Env/PVE2.pm
@@ -514,7 +514,9 @@ sub get_node_version {
 
     return undef if !$version_info->{$node};
 
-    return $version_info->{$node}->{version};
+    my $node_versioninfo = eval { decode_json($version_info->{$node}) };
+
+    return $node_versioninfo->{version};
 }
 
 1;
-- 
2.47.2



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules
  2025-07-22 16:54 [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl
  2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 1/2] config: use entire path to groups.cfg path in delete_group_config Michael Köppl
  2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 2/2] ha: decode JSON string with version info returned by get_node_kv Michael Köppl
@ 2025-07-23 15:37 ` Michael Köppl
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Köppl @ 2025-07-23 15:37 UTC (permalink / raw)
  To: Michael Köppl; +Cc: Proxmox VE development discussion

Superseded-by: https://lore.proxmox.com/pve-devel/20250723153524.288508-1-m.koeppl@proxmox.com

On 7/22/25 18:54, Michael Köppl wrote:
> These 2 patches are meant as a follow-up for the HA affinity rules
> series [0]. During testing, I encountered some errors during the
> persistent migration that stopped the entire migration from working.
> 
> [0] https://lore.proxmox.com/pve-devel/20250704181659.465441-1-d.kral@proxmox.com/
> 
> pve-ha-manager.git:
> 
> Michael Köppl (2):
>   config: use entire path to groups.cfg path in delete_group_config
>   ha: decode JSON string with version info returned by get_node_kv
> 
>  src/PVE/HA/Config.pm   | 3 ++-
>  src/PVE/HA/Env/PVE2.pm | 4 +++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> 
> Summary over all repositories:
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-23 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-22 16:54 [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl
2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 1/2] config: use entire path to groups.cfg path in delete_group_config Michael Köppl
2025-07-22 16:54 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 2/2] ha: decode JSON string with version info returned by get_node_kv Michael Köppl
2025-07-23 15:37 ` [pve-devel] [PATCH FOLLOW-UP ha-manager 0/2] fix errors during persistent migration of HA groups to rules Michael Köppl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal