-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: Add support for SR-IOV Network Adapters #1417
Conversation
…en-source.core/terraform-provider-vsphere into sriov_vm_network_interface_type
…heck that any SRIOV physical NIC has SRIOV enabled.
…. This also means you can't add or delete non-SRIOV Nics if you have any SRIOV ones.
Great work on this PR @sunnycarter. I've been doing some testing. Plan fails when a VM's Workaround is to replace NetworkInterfaceDiffOperation and ValidateDiff functions in this PR with original develop branch's. Works, but your helpful validation and descriptive error messages are lost. Perhaps this is unavoidable. |
Workaround is in my repo. |
Given @holmesb's comment I wonder if we should:
@holmesb - relatedly I can see how it is likely Is that good enough? |
@andrew-lee-metaswitch, you're right, there's not yet a resource or datasource for retrieving a PCI address to feed into |
- Ported the code introduced with hashicorp#1417 - Verified that virtual machines with SR-IOV network adapters can be created - Added basic e2e to verify that SR-IOV is supporte4d with ported code - Verified that there are no regressions introduced ran TestAccResourceVSphereVirtualMachine_staticMAC TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionClone TestAccResourceVSphereVirtualMachine_disksKeepOnRemove TestAccResourceVSphereVirtualMachine_addDevices TestAccResourceVSphereVirtualMachine_highDiskUnitInsufficientBus TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers TestAccResourceVSphereVirtualMachine_removeMiddleDevicesChangeDiskUnit TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom TestAccResourceVSphereVirtualMachine_vAppIsoBasic TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool TestAccResourceVSphereVirtualMachine_cloneBlockESXi TestAccResourceVSphereVirtualMachine_clonePoweredOn TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithLinkedClone TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname TestAccResourceVSphereVirtualMachine_cpuHotAdd TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6 TestAccResourceVSphereVirtualMachine_hostVMotion on the branch with the changes + same tests on the main branch with identical results Signed-off-by: Vasil Atanasov <vasila@vmware.com>
@andrew-lee-metaswitch @sunnycarter Thanks for your contribution ported it as a separate PR since the code is quite old and it took too much time to resolve conflicts. Added reference to this PR in my commit message so your contribution will count. Thanks, Vasil |
- Ported the code introduced with hashicorp#1417 - Verified that virtual machines with SR-IOV network adapters can be created - Added basic e2e to verify that SR-IOV is supporte4d with ported code - Verified that there are no regressions introduced ran TestAccResourceVSphereVirtualMachine_staticMAC TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionClone TestAccResourceVSphereVirtualMachine_disksKeepOnRemove TestAccResourceVSphereVirtualMachine_addDevices TestAccResourceVSphereVirtualMachine_highDiskUnitInsufficientBus TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers TestAccResourceVSphereVirtualMachine_removeMiddleDevicesChangeDiskUnit TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom TestAccResourceVSphereVirtualMachine_vAppIsoBasic TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool TestAccResourceVSphereVirtualMachine_cloneBlockESXi TestAccResourceVSphereVirtualMachine_clonePoweredOn TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithLinkedClone TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname TestAccResourceVSphereVirtualMachine_cpuHotAdd TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6 TestAccResourceVSphereVirtualMachine_hostVMotion on the branch with the changes + same tests on the main branch with identical results - Addressed PR coments Signed-off-by: Vasil Atanasov <vasila@vmware.com>
- Ported the code introduced with hashicorp#1417 - Verified that virtual machines with SR-IOV network adapters can be created - Added basic e2e to verify that SR-IOV is supporte4d with ported code - Verified that there are no regressions introduced ran TestAccResourceVSphereVirtualMachine_staticMAC TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionClone TestAccResourceVSphereVirtualMachine_disksKeepOnRemove TestAccResourceVSphereVirtualMachine_addDevices TestAccResourceVSphereVirtualMachine_highDiskUnitInsufficientBus TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers TestAccResourceVSphereVirtualMachine_removeMiddleDevicesChangeDiskUnit TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom TestAccResourceVSphereVirtualMachine_vAppIsoBasic TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool TestAccResourceVSphereVirtualMachine_cloneBlockESXi TestAccResourceVSphereVirtualMachine_clonePoweredOn TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithLinkedClone TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname TestAccResourceVSphereVirtualMachine_cpuHotAdd TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6 TestAccResourceVSphereVirtualMachine_hostVMotion on the branch with the changes + same tests on the main branch with identical results - Addressed PR coments Signed-off-by: Vasil Atanasov <vasila@vmware.com>
- Ported the code introduced with hashicorp#1417 - Verified that virtual machines with SR-IOV network adapters can be created - Added basic e2e to verify that SR-IOV is supporte4d with ported code - Verified that there are no regressions introduced ran TestAccResourceVSphereVirtualMachine_staticMAC TestAccResourceVSphereVirtualMachine_TestAccResourceVSphereVirtualMachine_hardwareVersionClone TestAccResourceVSphereVirtualMachine_disksKeepOnRemove TestAccResourceVSphereVirtualMachine_addDevices TestAccResourceVSphereVirtualMachine_highDiskUnitInsufficientBus TestAccResourceVSphereVirtualMachine_highDiskUnitNumbers TestAccResourceVSphereVirtualMachine_removeMiddleDevicesChangeDiskUnit TestAccResourceVSphereVirtualMachine_vAppIsoNoCdrom TestAccResourceVSphereVirtualMachine_vAppIsoBasic TestAccResourceVSphereVirtualMachine_vAppIsoChangeCdromBacking TestAccResourceVSphereVirtualMachine_cloneCustomizeWithNewResourcePool TestAccResourceVSphereVirtualMachine_cloneBlockESXi TestAccResourceVSphereVirtualMachine_clonePoweredOn TestAccResourceVSphereVirtualMachine_cloneWithBadSizeWithLinkedClone TestAccResourceVSphereVirtualMachine_cloneWithDifferentHostname TestAccResourceVSphereVirtualMachine_cpuHotAdd TestAccResourceVSphereVirtualMachine_dualStackIPv4AndIPv6 TestAccResourceVSphereVirtualMachine_hostVMotion on the branch with the changes + same tests on the main branch with identical results - Addressed PR coments Signed-off-by: Vasil Atanasov <vasila@vmware.com>
This functionality has been released in v2.6.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! |
1 similar comment
This functionality has been released in v2.6.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! |
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. |
Description
This pull request adds SR-IOV network_interface function to terraform, so that you can add SR-IOV Nics to a VM.
SR-IOV, Single Root I/O Virtualization, allows a single NIC (termed the Physical Function - PF) to be shared between a bounded number of VMs, providing a Virtual Function (VF) network interface to each VM. It is used for high-performance throughput on the network interface.
An SR-IOV network interface subresource would be declared in terraform main.tf as follows:
If you set the adapter_type to sriov, you must also do the following:
There are limitations to the use of SRIOV NICS, due to fiddlyness with their PCI Bus unit numbers. (Non-SRIOV interfaces use unit numbers 7-17, whereas SRIOV interfaces use unit numbers 45-36 decreasing.) As much of the code for network adapters uses unit numbers as akin to index number of the interface in main.tf, this has made the changes fiddly. The limitations created here mean:
Acceptance tests
I have not run acceptance tests as my vsphere environment does not have access to any NAS storage, so I cannot set environment variable TF_VAR_VSPHERE_NAS_HOST or TF_VAR_VSPHERE_NFS_PATH, so tests are failing with ```
make testacc TESTARGS="-run=TestAccResourceVSphereVirtualMachine_basic"
Error: error mounting datastore: host "<TF_VAR_VSPHERE_ESXI2>": ServerFaultCode: A specified parameter was not correct:
. I'd appreciate guidance on how to get around this, and which acceptance tests to run if it is possible. I've made notes on manual testing below.
Manual testing
The following manual tests have been done:
Error cases:
Apply new:
Update (new interfaces):
Delete interfaces:
Import:
Bandwidth stuff:
Non-interface tests:
Release Note
Release note for CHANGELOG:
References
vmware/govmomi#2060
Resolves #1136