Skip to content

[WIP]vendor: adopt autolun API #2654

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Nov 19, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
adopt autolun API as POC, while since we have not migrated to track2 sdk for VMSSVM client, this is missing updateCache functionality which could reduce vmss list API calls

https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/attach-detach-data-disks

testing image: andyzhangx/azuredisk-csi:v1.33.0

	newVM := compute.VirtualMachineScaleSetVM{
		VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
			StorageProfile: &compute.StorageProfile{
				DataDisks: result.StorageProfile.DataDisks,
			},
		},
	}

	// clean node cache first and then update cache
	_ = ss.DeleteCacheForNode(ctx, vmName)
	if err := ss.updateCache(ctx, vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, &newVM); err != nil {
		klog.Errorf("updateCache(%s, %s, %s, %s) failed with error: %v", vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, err)
	}
	return nil
I0414 02:09:25.947019       1 utils.go:105] GRPC call: /csi.v1.Controller/ControllerPublishVolume
I0414 02:09:25.947045       1 utils.go:106] GRPC request: {"node_id":"aks-azlinux-22469925-vmss000000","volume_capability":{"AccessType":{"Mount":{}},"access_mode":{"mode":7}},"volume_context":{"csi.storage.k8s.io/pv/name":"pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2","csi.storage.k8s.io/pvc/name":"persistent-storage-statefulset-azuredisk-3","csi.storage.k8s.io/pvc/namespace":"default","requestedsizegib":"10","skuName":"StandardSSD_LRS","storage.kubernetes.io/csiProvisionerIdentity":"1729987942300-7415-disk.csi.azure.com"},"volume_id":"/subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2"}
I0414 02:09:26.168103       1 azure_vmss_cache.go:425] Node aks-azlinux-22469925-vmss000000 has joined the cluster since the last VM cache refresh in NonVmssUniformNodesEntry, refreshing the cache
I0414 02:09:26.168123       1 azure_vmss_cache.go:342] refresh the cache of NonVmssUniformNodesCache in rg &{map[mc_andy-aks130_andy-aks130_eastus2:{}]}
I0414 02:09:26.377004       1 controllerserver.go:517] GetDiskLun returned: cannot find Lun for disk pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2. Initiating attaching volume /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2 to node aks-azlinux-22469925-vmss000000 (vmState Succeeded).
I0414 02:09:26.431645       1 azuredisk.go:568] volumeAttachments count: 8, nodeName: aks-azlinux-22469925-vmss000000
I0414 02:09:26.431700       1 controllerserver.go:543] Trying to attach volume /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2 to node aks-azlinux-22469925-vmss000000
I0414 02:09:26.431735       1 azure_controller_common.go:215] wait 1000ms for more requests on node aks-azlinux-22469925-vmss000000, current disk attach: /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2
I0414 02:09:27.432090       1 azure_controller_common.go:229] Trying to attach volume /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2 lun 2 to node aks-azlinux-22469925-vmss000000, diskMap len:1, map[/subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourcegroups/mc_andy-aks130_andy-aks130_eastus2/providers/microsoft.compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2:0xc000889b00]
I0414 02:09:27.432127       1 azure_controller_vmss.go:101] azureDisk - update: rg(MC_andy-aks130_andy-aks130_eastus2) vm(aks-azlinux-22469925-vmss000000) - attach disk list(map[/subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourcegroups/mc_andy-aks130_andy-aks130_eastus2/providers/microsoft.compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2:0xc000889b00])
I0414 02:09:36.159829       1 azure_controller_vmss.go:103] azureDisk - update: rg(MC_andy-aks130_andy-aks130_eastus2) vm(aks-azlinux-22469925-vmss000000) - attach disk list(map[/subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourcegroups/mc_andy-aks130_andy-aks130_eastus2/providers/microsoft.compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2:0xc000889b00]) returned with <nil>
I0414 02:09:36.159872       1 azure_vmss_cache.go:328] updateCache(aks-azlinux-22469925-vmss, MC_andy-aks130_andy-aks130_eastus2, aks-azlinux-22469925-vmss000000) for cacheKey(mc_andy-aks130_andy-aks130_eastus2/aks-azlinux-22469925-vmss) updated successfully
I0414 02:09:36.159887       1 azure_vmss_cache.go:286] DeleteCacheForNode(mc_andy-aks130_andy-aks130_eastus2, aks-azlinux-22469925-vmss, aks-azlinux-22469925-vmss000000) successfully
I0414 02:09:36.159899       1 azure_vmss_cache.go:425] Node aks-azlinux-22469925-vmss000000 has joined the cluster since the last VM cache refresh in NonVmssUniformNodesEntry, refreshing the cache
I0414 02:09:36.159908       1 azure_vmss_cache.go:342] refresh the cache of NonVmssUniformNodesCache in rg &{map[mc_andy-aks130_andy-aks130_eastus2:{}]}
I0414 02:09:36.282424       1 azure_vmss.go:253] Couldn't find VMSS VM with nodeName aks-azlinux-22469925-vmss000000, refreshing the cache(vmss: aks-azlinux-22469925-vmss, rg: mc_andy-aks130_andy-aks130_eastus2)
I0414 02:09:36.402422       1 azure_controller_common.go:499] azureDisk - found disk: lun 2 name pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2 uri /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2
I0414 02:09:36.402455       1 controllerserver.go:552] Attach operation successful: volume /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2 attached to node aks-azlinux-22469925-vmss000000.
I0414 02:09:36.402470       1 controllerserver.go:576] attach volume /subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2 to node aks-azlinux-22469925-vmss000000 successfully
I0414 02:09:36.402508       1 azure_metrics.go:105] "Observed Request Latency" latency_seconds=10.234390089 request="azuredisk_csi_driver_controller_publish_volume" resource_group="mc_andy-aks130_andy-aks130_eastus2" subscription_id="b9d2281e-dcd5-4dfd-9a97-0d50377cdf76" source="disk.csi.azure.com" volumeid="/subscriptions/b9d2281e-dcd5-4dfd-9a97-0d50377cdf76/resourceGroups/MC_andy-aks130_andy-aks130_eastus2/providers/Microsoft.Compute/disks/pvc-a70d01eb-dfd2-4825-971c-7d93d91fddc2" node="aks-azlinux-22469925-vmss000000" result_code="succeeded"
I0414 02:09:36.402523       1 utils.go:112] GRPC response: {"publish_context":{"LUN":"2"}}

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 19, 2024
@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 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 19, 2024
@andyzhangx
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 8, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2025
@k8s-ci-robot
Copy link
Contributor

@andyzhangx: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-azuredisk-csi-driver-verify 2be776c link true /test pull-azuredisk-csi-driver-verify
pull-azuredisk-csi-driver-e2e-capz 2be776c link true /test pull-azuredisk-csi-driver-e2e-capz

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 15, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants