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

fix: get vmss instance error for standalone vm #798

Closed

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Sep 7, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

fix: get vmss instance error for standalone vm

This PR fixed the issue when agent node is either not vmss nor in availability set, in such case, should return standard vmType when attach/detach disk. Original error is like following on capz cluster:

AttachVolume.Attach failed for volume "pvc-84f57545-0f8c-4087-b9ab-a04f500e6218" : failed to get azure instance id for node "capz-target-cluster-md-0-xs8cn" (not a vmss instance)

Which issue(s) this PR fixes:

Fixes #338, #576

Special notes for your reviewer:

/hold

Does this PR introduce a user-facing change?

fix: get vmss instance error for standalone vm

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 7, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 7, 2021
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 80.615% when pulling 443820b on andyzhangx:vm-get-instance-fix into 75e477f on kubernetes-sigs:master.

@@ -142,6 +142,13 @@ func (c *controllerCommon) getNodeVMSet(nodeName types.NodeName, crt azcache.Azu
}

// 4. Node is managed by vmss
if _, err := ss.GetInstanceIDByNodeName(mapNodeNameToVMName(nodeName)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should invoke vmas.GetInstanceIDByNodeName in ss.GetInstanceIDByNodeName instead of modifying the vmSet directly. This is because it is recommended to set the vmSet type to vmss when using standalone VMs.

@andyzhangx
Copy link
Member Author

it actually works on capz standalone vm node pool now, should set DisableAvailabilitySetNodes as true in that capz test case. this pr is not necessary now.

@andyzhangx andyzhangx closed this Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow clusters with different infrastructure "vmType" node pools
4 participants