Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Activate Accelerated Networking per default #3449

Merged
merged 6 commits into from
Jul 16, 2018

Conversation

julienstroheker
Copy link
Collaborator

@julienstroheker julienstroheker commented Jul 9, 2018

What this PR does / why we need it:

Activate the Accelerated Networking feature per default is the SKU is supported

Which issue this PR fixes *

fixes #3236

Special notes for your reviewer:

  • documentation (already there)
  • unit tests

@ghost ghost assigned julienstroheker Jul 9, 2018
@ghost ghost added the in progress label Jul 9, 2018
@julienstroheker
Copy link
Collaborator Author

julienstroheker commented Jul 9, 2018

@lachie83 @jackfrancis @CecileRobertMichon would love to have a first review on this to see if I am on the right track.

I tested using VMSS and VMAS and it works with simple and multiple agentpool profile.

Thanks !

@julienstroheker julienstroheker changed the title [WIP] Init code structure and logic for default activation [WIP] Activate Accelerated Networking per default Jul 9, 2018
@lachie83
Copy link
Member

lachie83 commented Jul 9, 2018

cc @sozercan can you please review

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

Added some comments

pkg/api/types.go Outdated
}
return true
}
return *a.AcceleratedNetworkingEnabled
Copy link
Contributor

Choose a reason for hiding this comment

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

If the user manually sets a.AcceleratedNetworkingEnabled to true, I think we should also check if it is supported with the VM SKU, either by checking here and overriding to false if it's not, or by adding validation for the apimodel (https://github.com/Azure/acs-engine/blob/master/pkg/api/vlabs/validate.go) to make sure that if a.AcceleratedNetworkingEnabled is true, then the VM SKU supports accelerated networking and returning an error if it doesn't. I personally think the latter is better UX so we don't silently override.

pkg/api/types.go Outdated
@@ -451,6 +451,45 @@ type AgentPoolProfile struct {
ImageRef *ImageReference `json:"imageReference,omitempty"`
}

// IsEnabledAcc returns if the AcceleratedNetworkingEnabled is explicitly enabled, or the user-provided default if non explicitly enabled
func (a *AgentPoolProfile) IsEnabledAcc() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we need an extra field/function IsEnabledAcc() : instead, we could set a default for AcceleratedNetworkingEnabled in https://github.com/Azure/acs-engine/blob/master/pkg/acsengine/defaults.go#L791 (using the same logic as below)

@@ -32,7 +32,11 @@
"location": "[variables('location')]",
"name": "[concat(variables('{{.Name}}VMNamePrefix'), 'nic-', copyIndex(variables('{{.Name}}Offset')))]",
"properties": {
"enableAcceleratedNetworking" : "{{.AcceleratedNetworkingEnabled}}",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this code could stay unchanged, see my comment below

@@ -53,7 +53,11 @@
"name": "[variables('{{.Name}}VMNamePrefix')]",
"properties": {
"primary": true,
"enableAcceleratedNetworking" : "{{.AcceleratedNetworkingEnabled}}",
{{if IsEnabledAcc .}}
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@@ -645,6 +645,12 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
}
return false
},
"IsEnabledAcc": func(profile *api.AgentPoolProfile) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

this would also be removed

@codecov
Copy link

codecov bot commented Jul 16, 2018

Codecov Report

Merging #3449 into master will decrease coverage by <.01%.
The diff coverage is 55.17%.

@@            Coverage Diff             @@
##           master    #3449      +/-   ##
==========================================
- Coverage   55.94%   55.94%   -0.01%     
==========================================
  Files         105      105              
  Lines       15888    15917      +29     
==========================================
+ Hits         8889     8905      +16     
- Misses       6253     6262       +9     
- Partials      746      750       +4

@@ -347,6 +347,11 @@ func (a *Properties) validateAgentPoolProfiles() error {
if e := validatePoolOSType(agentPoolProfile.OSType); e != nil {
return e
}
if agentPoolProfile.AcceleratedNetworkingEnabled != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you could use helpers.IsTrueBoolPointer(agentPoolProfile.AcceleratedNetworkingEnabled) instead of checking if it's nil and check helpers.AcceleratedNetworkingSupported(VMSize)` in validatePoolAcceleratedNetworking, no need to check if it is true or if AcceleratedNetworkingSupported == AcceleratedNetworking.

@julienstroheker julienstroheker changed the title [WIP] Activate Accelerated Networking per default Activate Accelerated Networking per default Jul 16, 2018
@@ -164,3 +164,58 @@ EPDesL0rH+3s1CKpgkhYdbJ675GFoGoq+X21QaqsdvoXmmuJF9qq9Tq+JaWloUNq
t.Fatalf("Public Key did not match expected format/value")
}
}

func TestAcceleratedNetworkingSupported(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon 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 @julienstroheker !

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable accelerated networking by default for supported VMs
4 participants