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 data source vgpu profiles #2048

Merged
merged 3 commits into from
Feb 12, 2024

Conversation

mristok
Copy link
Contributor

@mristok mristok commented Oct 27, 2023

Description

Add a new data source to the provider to query and return available vGPU profiles for a host.

Acceptance tests

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

No acceptance tests added.

Provider tests

Output from provider testing:

ESXi host with A100 GPU

ESXi host with A100 GPU - no vGPU profile name filter

Changes to Outputs:
  + all_host_vgpu_profiles = {
      + host_id       = "host-1021"
      + id            = "fdcccc4252c0516e9d54a1ee6e851ba9f336c64502d6e80c5a684072f6e02bdc"
      + name          = null
      + vgpu_profiles = [
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-4c"
            },
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-8c"
            },
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-10c"
            },
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-16c"
            },
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-20c"
            },
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-40c"
            },
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-80c"
            },
        ]
    }

ESXi host with A100 GPU - vGPU profile name filter grid_a100d-80c

Changes to Outputs:
  + single_host_vgpu_profile = {
      + host_id       = "host-1021"
      + id            = "fdcccc4252c0516e9d54a1ee6e851ba9f336c64502d6e80c5a684072f6e02bdc"
      + name          = "grid_a100d-80c"
      + vgpu_profiles = [
          + {
              + disk_snapshot_supported   = true
              + memory_snapshot_supported = true
              + migrate_supported         = true
              + suspend_supported         = true
              + vgpu                      = "grid_a100d-80c"
            },
        ]
    }

ESXi host without GPU

ESXi host without GPU - no vGPU profile name filter

Changes to Outputs:
  + all_host_vgpu_profiles = {
      + host_id       = "host-4016"
      + id            = "7025a70fb666db1fd6f2f0d3f27ca9c6cb574a780443fd37d49685275e5b9b66"
      + name          = null
      + vgpu_profiles = []
    }

ESXi host without GPU - vGPU profile name filter grid_a100d-80c

Changes to Outputs:
  + single_host_vgpu_profiles = {
      + host_id       = "host-4016"
      + id            = "7025a70fb666db1fd6f2f0d3f27ca9c6cb574a780443fd37d49685275e5b9b66"
      + name          = "grid_a100d-80c"
      + vgpu_profiles = []
    }

Release Note

Release note for CHANGELOG:

...

References

Closes #2047

@mristok mristok requested a review from a team as a code owner October 27, 2023 18:37
@hashicorp-cla
Copy link

hashicorp-cla commented Oct 27, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added provider Type: Provider size/l Relative Sizing: Large labels Oct 27, 2023
@tenthirtyam
Copy link
Collaborator

The markdown for the data source docs should also be included.

Copy link
Contributor

@vasilsatanasov vasilsatanasov left a comment

Choose a reason for hiding this comment

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

Hi @mristok this is a great augmentation to the provider but I think that this data should be part of the vsphere_host data source. This will make it more consistent for the users as they will have to write less HCL code. I also do not see an acceptance test for this functionality and this will be a very good addition to the PR.

Best regards, Vasil

@mristok
Copy link
Contributor Author

mristok commented Oct 30, 2023

@vasilsatanasov This functionality can be moved into the vsphere_host data source; the reason I made it separate was so that it was aligned with the vsphere_host_pci_device being a separate data source.

Also, I did not add any acceptance tests to this given that the GPU based hardware in Equinix Metal is expensive (and based on 12/36 month contracts). If this were to be added to the acceptance tests would the following be in line with your vision:

  • User must specify a GPU ESXi host (not part of the standard acceptance test deployment)
    • Example: TF_VAR_VSPHERE_TEST_GPU_ESXI
  • If no GPU ESXi host is specified, the test is skipped

@tenthirtyam tenthirtyam changed the title feat: Add data source vgpu profiles feat: add data source vgpu profiles Oct 30, 2023
@tenthirtyam tenthirtyam added this to the Backlog milestone Oct 30, 2023
@tenthirtyam tenthirtyam added the new-data-source Feature: New Data Source label Oct 30, 2023
Copy link
Contributor

@vasilsatanasov vasilsatanasov left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

lgtm

@tenthirtyam tenthirtyam modified the milestones: Backlog, v2.7.0 Nov 10, 2023
@tenthirtyam tenthirtyam modified the milestones: v2.7.0, On Deck Jan 23, 2024
@tenthirtyam tenthirtyam modified the milestones: On Deck, v2.7.0 Feb 12, 2024
@tenthirtyam tenthirtyam merged commit 5a22e9a into hashicorp:main Feb 12, 2024
5 checks passed
Copy link

github-actions bot commented Mar 6, 2024

This functionality has been released in v2.7.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Apr 6, 2024

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 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Type: Documentation new-data-source Feature: New Data Source provider Type: Provider size/l Relative Sizing: Large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for vGPU data source
5 participants