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

Add support for NVME, update and shared disk creation in vcd_independent_disk resource #789

Merged
merged 37 commits into from
Mar 21, 2022

Conversation

vbauzys
Copy link
Contributor

@vbauzys vbauzys commented Feb 18, 2022

Ref: #699
Ref: #430
Ref: #694

Resource vcd_independent_disk improvements:

  • allows creating additionally shared disks types by configuring sharing_type
  • Add update support
  • Add new disk type NVME (requires vmx-13 hardware version VMs)
  • New attributes encrypted and uuid
  • Import now allows listing all independent disks in VDC

Sharing disk creation requires a specific configuration in env. Our used test storage profiles do not support shared disks creation. So no tests were added to support that. Overall it's just additional property sent to API.

There is a possibility to update the existing storage profile using Vsphere (sync by creating a new one failed).

  • Create a new tag
  • Add this new tag to storages which are type VMFS 6
  • Update existing storage profile to use new tag
  • Resync Vsphere connection in VCD
    Additionally, what I saw was that far more changes in Vsphere configuration are needed when such disks start to be used by a few VMs at the same time. Storages have to support multi writes and so on.

Tested with 10.2.2 and 10.3.1

Also updated vcd_independent_disk to not use deprecated schema.Resource fields for create/update/delete/import, now it uses CreateContext, UpdateContext, ReadContext, DeleteContext.

Also functions return the diag.Diagnostics struct instead of plain Go errors, to adjust their signature to the new CreateContext, UpdateContext, ReadContext, DeleteContext fields.

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
@vbauzys vbauzys changed the title Improve indepent disk Add support for NVME, update and shared disk creation in vcd_independent_disk resource Feb 21, 2022
@vbauzys vbauzys marked this pull request as ready for review February 21, 2022 14:14
@vbauzys vbauzys requested review from mikeletux and adambarreiro and removed request for dataclouder February 21, 2022 14:15
@vbauzys vbauzys self-assigned this Feb 21, 2022
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass

.changes/v3.6.0/789-features.md Outdated Show resolved Hide resolved
vcd/datasource_vcd_independent_disk_test.go Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
website/docs/r/independent_disk.html.markdown Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk_test.go Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Show resolved Hide resolved
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Contributor

@mikeletux mikeletux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Approved! Thanks for this awesome work! 🚀
Tested also manually on VCD 10.3.2 and it works as a charm!

Maybe we could test it agains VCD 10.2.0. That's the only comment that I have 😄

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
vcd/resource_vcd_independent_disk.go Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
vcd/resource_vcd_independent_disk.go Outdated Show resolved Hide resolved
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested manually as good as I could and these locks look to have been working.

@vbauzys vbauzys removed the request for review from dataclouder March 21, 2022 08:35
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for all the updates!

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
@vbauzys vbauzys merged commit d0b5a85 into vmware:main Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants