From 343f639cb8addfa0f164bd1e79b48bd83931709e Mon Sep 17 00:00:00 2001 From: Marian Krcmarik Date: Wed, 1 Jul 2026 19:28:49 +0200 Subject: [PATCH] feat: add rdmAsLun parameter to Plan resource Add rdm_as_lun parameter to the Plan class to support mapping RDM (Raw Device Mapping) disks as LUN devices with SCSI bus on the target VM during MTV migrations. Only applies to vSphere source providers. --- ocp_resources/plan.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ocp_resources/plan.py b/ocp_resources/plan.py index 948f39c446..f4f1bbe06e 100644 --- a/ocp_resources/plan.py +++ b/ocp_resources/plan.py @@ -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 @@ -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) @@ -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( @@ -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": {