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

chore: Add EnableAHUB in WindowsProfile #3322

Merged
merged 6 commits into from
Jun 4, 2020
Merged

Conversation

AbelHu
Copy link
Member

@AbelHu AbelHu commented May 22, 2020

Reason for Change:

Allow users to use Azure hybrid benefit for Windows server.

Issue Fixed:

Requirements:

Notes:

@mboersma
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented May 22, 2020

Codecov Report

Merging #3322 into master will increase coverage by 0.60%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3322      +/-   ##
==========================================
+ Coverage   72.57%   73.17%   +0.60%     
==========================================
  Files         147      147              
  Lines       25215    24923     -292     
==========================================
- Hits        18300    18238      -62     
+ Misses       5782     5559     -223     
+ Partials     1133     1126       -7     
Impacted Files Coverage Δ
pkg/api/vlabs/types.go 73.30% <ø> (ø)
pkg/api/converterfromapi.go 94.01% <100.00%> (+0.36%) ⬆️
pkg/api/convertertoapi.go 93.50% <100.00%> (+0.33%) ⬆️
pkg/api/types.go 94.37% <100.00%> (+0.02%) ⬆️
pkg/engine/virtualmachines.go 80.98% <100.00%> (+0.13%) ⬆️
pkg/engine/virtualmachinescalesets.go 81.28% <100.00%> (+0.09%) ⬆️
pkg/engine/artifacts.go 99.12% <0.00%> (-0.88%) ⬇️
pkg/api/addons.go 97.86% <0.00%> (-0.05%) ⬇️
pkg/api/common/const.go 40.00% <0.00%> (ø)
pkg/api/k8s_versions.go 100.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fa283b...1bbf235. Read the comment docs.

@jackfrancis
Copy link
Member

@AbelHu How can we add E2E test coverage for this? Can the current Windows VHD image be associated with a LicenseType?

@AbelHu
Copy link
Member Author

AbelHu commented May 25, 2020

@jackfrancis From my understanding and the test result, LicenseType is only a property of VMSS for Windows and there is no additional change for the Windows VHD.
I manually ran aks-engine deploy with and without LicenseType and both passed. How about to add "LicenseType": "Windows_Server" in windowsProfile of the file test\e2e\test_cluster_configs\windows\cse_benchmark_aks_vhds.json?

@AbelHu
Copy link
Member Author

AbelHu commented May 25, 2020

One question for the type WindowsLicenseType I added in common/types.go: Is this correct? Or should I add this separately in vlabs and api, and then convert them to *string in pkg/api/converterfromapi.go and pkg/api/convertertoapi.go?

Refine the PR to follow the style of KubeProxyMode

@jackfrancis
Copy link
Member

@AbelHu I see the WindowsLicenseType type as being defined in both the api and vlabs packages, and then converted. Strictly speaking you could define this thinly wrapped string type in a common library that both api and vlabs imported (like common), to avoid the unnecessary conversion.

The only consideration would be whether or not the evolution of that type definition might want to evolve discretely for the api and vlabs data structures. In this case I don't think it will.

@AbelHu
Copy link
Member Author

AbelHu commented May 26, 2020

@jackfrancis Agree with your point. That is why I defined it in common in the original PR. But later I found that common/types.go is never introduced in AKS and it seems like to introduce many conflicts for namespace in AKS unit tests so I define them separately for vlabs and api.

@AbelHu AbelHu requested a review from marosset May 27, 2020 02:23
@marosset
Copy link
Contributor

marosset commented May 27, 2020

@AbelHu Does AKS ever plan to use liscenseType of Windows_Client here? If not it might be good to add validation to fail if licenseType is set to Windows_Client.

@marosset
Copy link
Contributor

Can you either add comments in docs/validation about this only working for scale sets or set this up for availability sets too?

In the portal I see on option to 'use Azure Hybrid Benefit' when creating non-scaleset VMs which get added to availability sets?

@AbelHu
Copy link
Member Author

AbelHu commented May 28, 2020

Can you either add comments in docs/validation about this only working for scale sets or set this up for availability sets too?

In the portal I see on option to 'use Azure Hybrid Benefit' when creating non-scaleset VMs which get added to availability sets?

I will add the comment. AKS only supports Windows with VMSS. If later we need to support this in VMAS, I can help to add the support later.

@marosset And if many aks-engine users are using VMAS with Windows and want to enable AHUB, I can help to do it in this PR if you can share how I can test VMAS with Windows in aks-engine.

@AbelHu
Copy link
Member Author

AbelHu commented May 28, 2020

@AbelHu Does AKS ever plan to use liscenseType of Windows_Client here? If not it might be good to add validation to fail if licenseType is set to Windows_Client.

AKS only uses Windows_Server and will validate this in AKS side. It seems like that SDK and API allows users to set it to Windows_Client so I think that it may be better to keep this option. But I will check this with our PM. If we can confirm that Windows_Server is the only option for AKS, we can use a bool EnableAHUB in WindowsProfile and set the value LicenseType to Windows_Server when generating ARM template.

@AbelHu AbelHu force-pushed the win_license branch 4 times, most recently from f19bf3e to 449a2bd Compare May 28, 2020 08:23
@AbelHu
Copy link
Member Author

AbelHu commented May 29, 2020

@marosset @jackfrancis @mboersma I will update this PR with below changes soon:

  1. Support VMAS by adding code in pkg\engine\virtualmachines.go
  2. Change LicenseType (*string) to EnableAHUB (*bool)

@marosset
Copy link
Contributor

Sounds good!

@AbelHu AbelHu changed the title chore: Add LicenseType in WindowsProfile chore: Add EnableAHUB in WindowsProfile Jun 2, 2020
@AbelHu
Copy link
Member Author

AbelHu commented Jun 2, 2020

@keikhara helped to confirm that AKS only needs to set LicenseType to Windows_Server. Now I have updated this PR. I also test VMAS with examples/windows/kubernetes-wincni.json and it works.

Please help to review it. @marosset @jackfrancis @mboersma

@AbelHu AbelHu requested a review from marosset June 4, 2020 00:48
@AbelHu
Copy link
Member Author

AbelHu commented Jun 4, 2020

@marosset Could you help to take a look at the updated PR? Thanks.

@marosset
Copy link
Contributor

marosset commented Jun 4, 2020

Can we add one e2e test config that exercises this behavior?

you can add a new json file at https://github.com/Azure/aks-engine/tree/master/test/e2e/test_cluster_configs/windows with in enabled and also set

"env": {
	"SKIP_TESTS": "true",
},
"options": {
	"allowedOrchestratorVersions": ["latestReleasedVersion"]
},

in the top (like in https://github.com/Azure/aks-engine/blob/master/test/e2e/test_cluster_configs/windows/vhd_url.json)

@marosset
Copy link
Contributor

marosset commented Jun 4, 2020

Looks good after we get one e2e test config with this set to true.

@AbelHu
Copy link
Member Author

AbelHu commented Jun 4, 2020

Can we add one e2e test config that exercises this behavior?

you can add a new json file at https://github.com/Azure/aks-engine/tree/master/test/e2e/test_cluster_configs/windows with in enabled and also set

"env": {
	"SKIP_TESTS": "true",
},
"options": {
	"allowedOrchestratorVersions": ["latestReleasedVersion"]
},

in the top (like in https://github.com/Azure/aks-engine/blob/master/test/e2e/test_cluster_configs/windows/vhd_url.json)

Added now. Why I did not add it is because it is difficult to verify it after enabling AHUB. currently it only can verify whether the cluster can be created successfully with enabling AHUB.

@marosset
Copy link
Contributor

marosset commented Jun 4, 2020

Can we add one e2e test config that exercises this behavior?
you can add a new json file at https://github.com/Azure/aks-engine/tree/master/test/e2e/test_cluster_configs/windows with in enabled and also set

"env": {
	"SKIP_TESTS": "true",
},
"options": {
	"allowedOrchestratorVersions": ["latestReleasedVersion"]
},

in the top (like in https://github.com/Azure/aks-engine/blob/master/test/e2e/test_cluster_configs/windows/vhd_url.json)

Added now. Why I did not add it is because it is difficult to verify it after enabling AHUB. currently it only can verify whether the cluster can be created successfully with enabling AHUB.

That is alright, the SKIP_TESTS equals true will cause the e2e test to only validate deployment and will skip running the actually e2e tests.
Thanks or adding this!

Copy link
Contributor

@marosset marosset left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot
Copy link

acs-bot commented Jun 4, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AbelHu, marosset

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@marosset marosset merged commit 2062d07 into Azure:master Jun 4, 2020
AbelHu added a commit to AbelHu/aks-engine that referenced this pull request Jun 4, 2020
* Add LicenseType in WindowsProfile

* fix run tests in parallel with same variable

* Change LicenseType to EnableAHUB

* Support LicenseType in VMAS

* Update doc

* Add E2E test config for Windows AHUB
AbelHu added a commit to AbelHu/aks-engine that referenced this pull request Jun 9, 2020
* Add LicenseType in WindowsProfile

* fix run tests in parallel with same variable

* Change LicenseType to EnableAHUB

* Support LicenseType in VMAS

* Update doc

* Add E2E test config for Windows AHUB
andyliuliming pushed a commit that referenced this pull request Jun 12, 2020
* chore: Add EnableAHUB in WindowsProfile (#3322)

* Add LicenseType in WindowsProfile

* fix run tests in parallel with same variable

* Change LicenseType to EnableAHUB

* Support LicenseType in VMAS

* Update doc

* Add E2E test config for Windows AHUB

* fix: don't hardcode csi enableproxy in kubeclusterconfig.json (#3127)

fix has been manually validated and we want to include this in v0.50.0

Co-authored-by: Mark Rossetti <[email protected]>
penggu pushed a commit to penggu/aks-engine that referenced this pull request Oct 28, 2020
* Add LicenseType in WindowsProfile

* fix run tests in parallel with same variable

* Change LicenseType to EnableAHUB

* Support LicenseType in VMAS

* Update doc

* Add E2E test config for Windows AHUB
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants