diff --git a/.changelogs/1.1.7/305_add_conntrack_support_for_migrations.yml b/.changelogs/1.1.7/305_add_conntrack_support_for_migrations.yml new file mode 100644 index 0000000..ffb0fd8 --- /dev/null +++ b/.changelogs/1.1.7/305_add_conntrack_support_for_migrations.yml @@ -0,0 +1,2 @@ +added: + - Add conntrack state aware migrations of VMs (@gyptazy). [#305] diff --git a/.changelogs/1.1.7/release_meta.yml b/.changelogs/1.1.7/release_meta.yml new file mode 100644 index 0000000..c19765d --- /dev/null +++ b/.changelogs/1.1.7/release_meta.yml @@ -0,0 +1 @@ +date: TBD diff --git a/README.md b/README.md index 9d937fa..46cd2e9 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,7 @@ The following options can be set in the configuration file `proxlb.yaml`: | | parallel_jobs | | 5 | `Int` | The amount if parallel jobs when migrating guests. (default: `5`)| | | live | | True | `Bool` | If guests should be moved live or shutdown.| | | with_local_disks | | True | `Bool` | If balancing of guests should include local disks.| +| | with_conntrack_state | | True | `Bool` | If balancing of guests should including the conntrack state.| | | balance_types | | ['vm', 'ct'] | `List` | Defined the types of guests that should be honored. [values: `vm`, `ct`]| | | max_job_validation | | 1800 | `Int` | How long a job validation may take in seconds. (default: 1800) | | | balanciness | | 10 | `Int` | The maximum delta of resource usage between node with highest and lowest usage. | @@ -310,6 +311,7 @@ balancing: parallel: False live: True with_local_disks: True + with_conntrack_state: True balance_types: ['vm', 'ct'] max_job_validation: 1800 balanciness: 5 diff --git a/config/proxlb_example.yaml b/config/proxlb_example.yaml index ab49f4a..1632b88 100644 --- a/config/proxlb_example.yaml +++ b/config/proxlb_example.yaml @@ -25,6 +25,7 @@ balancing: parallel_jobs: 1 live: True with_local_disks: True + with_conntrack_state: True balance_types: ['vm', 'ct'] max_job_validation: 1800 balanciness: 5 diff --git a/helm/proxlb/values.yaml b/helm/proxlb/values.yaml index dae5e25..799b1e4 100644 --- a/helm/proxlb/values.yaml +++ b/helm/proxlb/values.yaml @@ -43,6 +43,7 @@ configmap: parallel_jobs: 1 live: True with_local_disks: True + with_conntrack_state: True balance_types: [ 'vm', 'ct' ] max_job_validation: 1800 balanciness: 5 diff --git a/proxlb/models/balancing.py b/proxlb/models/balancing.py index 76d23ae..8e594ac 100644 --- a/proxlb/models/balancing.py +++ b/proxlb/models/balancing.py @@ -154,10 +154,16 @@ 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-local-disks': with_local_disks, + 'with-conntrack-state': with_conntrack_state, } try: