Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ocp_resources/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Plan(NamespacedResource):
rules should be applied to the target VM resource.
enable_nested_virtualization (bool, optional): Whether to enable nested virtualization on migrated VMs.
When False, CPU features vmx/svm are disabled on the target VM.
rdm_as_lun (bool, optional): Whether to map RDM (Raw Device Mapping) disks as LUN devices
with SCSI bus on the target VM. When True, RDM disks use
lun.bus: scsi instead of the default disk.bus: virtio.
Only applies to vSphere source providers.
"""

api_group = NamespacedResource.ApiGroup.FORKLIFT_KONVEYOR_IO
Expand Down Expand Up @@ -78,6 +82,7 @@ def __init__(
target_labels: dict[str, str] | None = None,
target_affinity: dict[str, Any] | None = None,
enable_nested_virtualization: bool | None = None,
rdm_as_lun: bool | None = None,
**kwargs: Any,
) -> None:
super().__init__(**kwargs)
Expand Down Expand Up @@ -112,6 +117,7 @@ def __init__(
self.target_labels = target_labels
self.target_affinity = target_affinity
self.enable_nested_virtualization = enable_nested_virtualization
self.rdm_as_lun = rdm_as_lun

if self.pre_hook_name and self.pre_hook_namespace:
self.hooks_array.append(
Expand Down Expand Up @@ -214,6 +220,9 @@ def to_dict(self) -> None:
if self.enable_nested_virtualization is not None:
spec["enableNestedVirtualization"] = self.enable_nested_virtualization

if self.rdm_as_lun is not None:
spec["rdmAsLun"] = self.rdm_as_lun

def _generate_hook_spec(self, hook_name: str, hook_namespace: str, hook_type: str) -> dict[str, Any]:
return {
"hook": {
Expand Down