Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for RDM disks #1366

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sumitAgrawal007
Copy link
Contributor

Description

This PR adds code to enable creating VM or adding into VM, RDM disks.

Acceptance tests

  • Have you added an acceptance test for the functionality being added? Yes
  • Have you run the acceptance tests on this branch? Yes

Output from acceptance testing:

run=TestAccResourceVSphereVirtualMachine_RDMDisk -timeout 10m
?   	github.com/hashicorp/terraform-provider-vsphere	[no test files]
=== RUN   TestAccResourceVSphereVirtualMachine_RDMDisk
--- PASS: TestAccResourceVSphereVirtualMachine_RDMDisk (356.00s)
=== RUN   TestAccResourceVSphereVirtualMachine_storageVMotionGlobalSetting
--- PASS: TestAccResourceVSphereVirtualMachine_storageVMotionGlobalSetting (427.26s)
=== RUN   TestAccResourceVSphereVirtualMachine_cloneFromTemplate
--- PASS: TestAccResourceVSphereVirtualMachine_cloneFromTemplate (213.51s)
PASS

Link to Binary to try out this feature.

Release Note

Release note for CHANGELOG:

Capability to Add RDM Disk to a VM.

References

#397

@ghost ghost added size/xl Relative Sizing: Extra-Large documentation Type: Documentation labels Mar 17, 2021
@sumitAgrawal007
Copy link
Contributor Author

Hello @bill-rich @koikonom ,
Any update on this? Its been pending for a long time and requested by many customers.
I have already rebased it twice.

@redeux
Copy link
Contributor

redeux commented Jun 8, 2021

Hi Sumit. Thank you for your contribution, as always. I've added your request to our backlog. We have a few items ahead of this right now, but we'll start looking at it in the near future.

@clbx
Copy link

clbx commented Oct 12, 2021

Any update on when this might get looked at?

@appilon appilon self-assigned this Dec 1, 2021
@iBrandyJackson iBrandyJackson linked an issue Dec 10, 2021 that may be closed by this pull request
@github-actions github-actions bot added the provider Type: Provider label Dec 16, 2021
@appilon
Copy link
Contributor

appilon commented Dec 16, 2021

I have taken the liberty of rebasing and making necessary changes to this PR. The provided acceptance test seems acceptable, however it's not an environment/feature we have the ability to test at the moment. In general, testing homelab specific/hardware related features is not a scalable activity for us. So after making some final changes to this PR we will be asking the community to manually test the feature for us.

@appilon
Copy link
Contributor

appilon commented Dec 17, 2021

After further inspection, one thing I am struggling with on the PR is the awkward polymorphic behavior between the 2 disk types. Some things are nil for one type and not the other (and vice versa if we were to completely expand out an expose all the attributes of RDM).

Are these the only 2 types of disk? (asking @tenthirtyam or any vsphere experts) If not, then it's a recipe for problems if there are eventually many "backings". If there were only ever 2, I could clean this up and live with it.

UPDATE: looking through govmomi indicates there are several possible backings. For this resource to scale something more granular is going to be needed I think.

@tenthirtyam
Copy link
Collaborator

@appilon - agreed. Perhaps we could discuss this enhancement in detail early in New Year with the intended planning and collaboration. We can invite Sumit and also Michael/Doug from our vmware/govmomi team, if needed.

@appilon
Copy link
Contributor

appilon commented Jan 10, 2022

@tenthirtyam Coming back to this, the best way forward I believe is introducing a new nested block disk_rdm, that way we can keep the attributes required by different disk types separate. The configuration would look like this when configuring disks

 disk {
   label = "disk0"
   size  = 20
 }
 disk_rdm {
   label       = "disk1"
   unit_number = 1
   size        = 2
   disk_mode = "independent_persistent"
   compatibility_mode = "physicalMode"
   rdm_lun_path = "path/to/lun"
 }

Subsequent disk types added later on will also have a separate block definition. We will also rename the existing disk block to disk_vmdk or disk_virtual to create a consistent pattern.

@appilon
Copy link
Contributor

appilon commented Jan 10, 2022

I will go ahead and tweak this PR to that implementation, from there, as stated earlier, I'll ask the community to test the new disk type, as we do not have the capacity to test this type of disk.

@appilon
Copy link
Contributor

appilon commented Jan 12, 2022

@sumitAgrawal007 @tenthirtyam After digging into this PR further, it's unclear to me how the RDM disk relevant data made its way to the backend (vsphere)? Specifically the compatibility mode, after looking into it further, I don't think this provider can support "physical" mode, logically it will be too difficult since the existing disk resource supports the features of vmdk (cloning specifically). I am not a vmware expert so I'm uncertain on if it's even safe in "virtual" mode (quick glance seems like it is?).

If we can't support physical mode at this time, is this feature still worth pursuing? Or should we wait until we can support physical mode?

@tenthirtyam tenthirtyam added this to the Research milestone Feb 14, 2022
@tenthirtyam tenthirtyam added area/storage Area: Storage area/vm Area: Virtual Machines labels Feb 22, 2022
@tenthirtyam tenthirtyam changed the title Ability to add RDM Disk in a VM feat: Add support for RDM disks Mar 11, 2022
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@tejavar tejavar modified the milestones: Backlog, v2.3.0 Apr 13, 2022
@tenthirtyam tenthirtyam modified the milestones: v2.3.0, Backlog / Triage Jun 16, 2022
@tenthirtyam tenthirtyam added the merge-conflict Merge Conflict label Sep 11, 2022
@tenthirtyam tenthirtyam marked this pull request as draft September 11, 2022 22:20
@tenthirtyam
Copy link
Collaborator

Marking as draft due to merge conflicts that need to be resolved and open concerned regarding implementation.

Ryan Johnson
Senior Staff Solutions Architect | Product Engineering @ VMware, Inc.

@tkriviradev
Copy link

I think this is needed... It would be nice to have it in the provider. RDM is quite useful, if not implemented pls. ignore it.

@tenthirtyam tenthirtyam added the enhancement Type: Enhancement label Aug 7, 2023
Copy link

github-actions bot commented Feb 4, 2024

Marking this pull request as stale due to inactivity in the past 180 days. This helps us focus on the active pull requests. If this pull request receives no comments in the next 30 days it will automatically be closed.
If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Status: Stale label Feb 4, 2024
@github-actions github-actions bot closed this Mar 6, 2024
@tenthirtyam tenthirtyam removed this from the Backlog milestone Mar 6, 2024
@dijarvrella
Copy link

Any progress on this PR? This is indeed useful!

@github-actions github-actions bot removed the stale Status: Stale label Mar 19, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
@github-actions github-actions bot added the needs-review Status: Pull Request Needs Review label Jun 26, 2024
@tenthirtyam tenthirtyam removed the documentation Type: Documentation label Sep 17, 2024
@tenthirtyam tenthirtyam added this to the Backlog milestone Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/storage Area: Storage area/vm Area: Virtual Machines enhancement Type: Enhancement merge-conflict Merge Conflict needs-review Status: Pull Request Needs Review provider Type: Provider size/xl Relative Sizing: Extra-Large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for RDM disk mappings
10 participants