Skip to content

Commit e6f463c

Browse files
authored
Add allow_workload_disruption parameter to MigrationPolicy (#2676)
KubeVirt introduced AllowWorkloadDisruption in the MigrationPolicySpec. This field controls migration behavior when migrations exceed AcceptableCompletionTime: the controller can pause the VMI or switch to post-copy to force completion.
1 parent 4f1322f commit e6f463c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ocp_resources/migration_policy.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def __init__(
99
name=None,
1010
allow_auto_converge=None,
1111
allow_post_copy=None,
12+
allow_workload_disruption=None,
1213
bandwidth_per_migration=None,
1314
completion_timeout_per_gb=None,
1415
namespace_selector=None,
@@ -22,6 +23,7 @@ def __init__(
2223
name (str): Migration Policy name
2324
allow_auto_converge (bool, optional)
2425
allow_post_copy (bool, optional)
26+
allow_workload_disruption (bool, optional)
2527
bandwidth_per_migration (str, optional, i.e. "1Gi")
2628
completion_timeout_per_gb (int, optional)
2729
namespace_selector (dict, optional): Dict of Namespace labels to match (e.g. {"project-owner": "redhat"})
@@ -33,6 +35,7 @@ def __init__(
3335
)
3436
self.allow_auto_converge = allow_auto_converge
3537
self.allow_post_copy = allow_post_copy
38+
self.allow_workload_disruption = allow_workload_disruption
3639
self.bandwidth_per_migration = bandwidth_per_migration
3740
self.completion_timeout_per_gb = completion_timeout_per_gb
3841
self.namespace_selector = namespace_selector or {}
@@ -48,6 +51,8 @@ def to_dict(self) -> None:
4851
self.res["spec"]["allowAutoConverge"] = self.allow_auto_converge
4952
if self.allow_post_copy is not None:
5053
self.res["spec"]["allowPostCopy"] = self.allow_post_copy
54+
if self.allow_workload_disruption is not None:
55+
self.res["spec"]["allowWorkloadDisruption"] = self.allow_workload_disruption
5156
if self.bandwidth_per_migration:
5257
self.res["spec"]["bandwidthPerMigration"] = self.bandwidth_per_migration
5358
if self.completion_timeout_per_gb:

0 commit comments

Comments
 (0)