-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 Accelerated Networking (SR-IOV) #672
Changes from all commits
0524fce
134c215
4787ce6
0e1e5f0
6b6f1fe
3b8e5c0
e6c9531
b4e892d
67e30cf
80db544
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,25 @@ func TestAccAzureRMNetworkInterface_enableIPForwarding(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccAzureRMNetworkInterface_enableAcceleratedNetworking(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we also add a test that provisions a VM using a Managed Disk in this file? That would allow us to have an end-to-end example of this working There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure can. I'll also rebase against the latest master. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The one caveat here is that only certain instance types support AN. I will select the smallest I know of, which is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the acceptance tests only spin the machines up for tests for a short while, I don't think that'll be that bad for us (HashiCorp) - however I think it's worth mentioning for contributors. In the AWS Provider we document this kind of thing at the top of the file, for instance:
As such - can we update the top of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tombuildsstuff I put that test in the wrong file.... it's in the network interface tests. I'll move it over now and update the top as requested. |
||
resourceName := "azurerm_network_interface.test" | ||
rInt := acctest.RandInt() | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMNetworkInterfaceDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccAzureRMNetworkInterface_acceleratedNetworking(rInt, testLocation()), | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMNetworkInterfaceExists(resourceName), | ||
resource.TestCheckResourceAttr(resourceName, "enable_accelerated_networking", "true"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMNetworkInterface_multipleLoadBalancers(t *testing.T) { | ||
rInt := acctest.RandInt() | ||
resource.Test(t, resource.TestCase{ | ||
|
@@ -524,6 +543,43 @@ resource "azurerm_network_interface" "test" { | |
`, rInt, location, rInt, rInt) | ||
} | ||
|
||
func testAccAzureRMNetworkInterface_acceleratedNetworking(rInt int, location string) string { | ||
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctest-rg-%d" | ||
location = "%s" | ||
} | ||
|
||
resource "azurerm_virtual_network" "test" { | ||
name = "acctestvn-%d" | ||
address_space = ["10.0.0.0/16"] | ||
location = "${azurerm_resource_group.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
} | ||
|
||
resource "azurerm_subnet" "test" { | ||
name = "testsubnet" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
virtual_network_name = "${azurerm_virtual_network.test.name}" | ||
address_prefix = "10.0.2.0/24" | ||
} | ||
|
||
resource "azurerm_network_interface" "test" { | ||
name = "acctestni-%d" | ||
location = "${azurerm_resource_group.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
enable_ip_forwarding = false | ||
enable_accelerated_networking = true | ||
|
||
ip_configuration { | ||
name = "testconfiguration1" | ||
subnet_id = "${azurerm_subnet.test.id}" | ||
private_ip_address_allocation = "dynamic" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
} | ||
|
||
func testAccAzureRMNetworkInterface_withTags(rInt int, location string) string { | ||
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add an entry to the documentation for this new field in
website/docs/r/network_interface.html.markdown
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. I was looking for the docs, but didn't quite know the code base well enough yet to find them.