mirror of
https://github.com/gyptazy/ProxLB.git
synced 2026-04-05 20:31:57 +02:00
fix(balancing): Fix API errors when using conntrack aware migration with older PVE versions.
Fixes: #318
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
fixed:
|
||||
- Fix API errors when using conntrack aware migration with older PVE versions. (@gyptazy). [#318]
|
||||
1
.changelogs/1.1.8/release_meta.yml
Normal file
1
.changelogs/1.1.8/release_meta.yml
Normal file
@@ -0,0 +1 @@
|
||||
date: TBD
|
||||
@@ -156,18 +156,17 @@ class Balancing:
|
||||
else:
|
||||
with_local_disks = 0
|
||||
|
||||
if proxlb_data["meta"]["balancing"].get("with_conntrack_state", True):
|
||||
with_conntrack_state = 1
|
||||
else:
|
||||
with_conntrack_state = 0
|
||||
|
||||
migration_options = {
|
||||
'target': guest_node_target,
|
||||
'online': online_migration,
|
||||
'with-local-disks': with_local_disks,
|
||||
'with-conntrack-state': with_conntrack_state,
|
||||
}
|
||||
|
||||
# Conntrack state aware migrations are not supported in older
|
||||
# PVE versions, so we should not add it by default.
|
||||
if proxlb_data["meta"]["balancing"].get("with_conntrack_state", True):
|
||||
migration_options['with-conntrack-state'] = 1
|
||||
|
||||
try:
|
||||
logger.info(f"Balancing: Starting to migrate VM guest {guest_name} from {guest_node_current} to {guest_node_target}.")
|
||||
job_id = proxmox_api.nodes(guest_node_current).qemu(guest_id).migrate().post(**migration_options)
|
||||
|
||||
Reference in New Issue
Block a user