{"record":{"id":"0779b4087829d12b","repo":"kubernetes/kops","slug":"deleting-vmss-vm-w","errorCode":null,"errorMessage":"deleting VMSS VM: %w","messagePattern":"deleting VMSS VM: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/vmscalesetvm.go","lineNumber":55,"sourceCode":"var _ VMScaleSetVMsClient = (*vmScaleSetVMsClientImpl)(nil)\n\nfunc (c *vmScaleSetVMsClientImpl) List(ctx context.Context, resourceGroupName, vmssName string) ([]*compute.VirtualMachineScaleSetVM, error) {\n\tvar l []*compute.VirtualMachineScaleSetVM\n\tpager := c.c.NewListPager(resourceGroupName, vmssName, nil)\n\tfor pager.More() {\n\t\tresp, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"listing VMSS VMs: %w\", err)\n\t\t}\n\t\tl = append(l, resp.Value...)\n\t}\n\treturn l, nil\n}\n\nfunc (c *vmScaleSetVMsClientImpl) Delete(ctx context.Context, resourceGroupName, vmssName, instanceId string) error {\n\tfuture, err := c.c.BeginDelete(ctx, resourceGroupName, vmssName, instanceId, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting VMSS VM: %w\", err)\n\t}\n\tif _, err = future.PollUntilDone(ctx, nil); err != nil {\n\t\treturn fmt.Errorf(\"waiting for VMSS VM deletion completion: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc newVMScaleSetVMsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*vmScaleSetVMsClientImpl, error) {\n\tc, err := compute.NewVirtualMachineScaleSetVMsClient(subscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating VMSS VMs client: %w\", err)\n\t}\n\treturn &vmScaleSetVMsClientImpl{\n\t\tc: c,\n\t}, nil\n}\n","sourceCodeStart":37,"sourceCodeEnd":72,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/vmscalesetvm.go#L37-L72","documentation":"Wraps the BeginDelete failure when deleting a VMSS VM instance via the Azure compute SDK. Fires when the ARM DELETE call is rejected — bad instance ID, resource group mismatch, RBAC permissions, or a concurrent operation on the instance.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/vmscalesetvm.go:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the instance ID and resource group/name of the VMSS VM","Ensure the caller has Virtual Machine Contributor (or equivalent) RBAC rights","Inspect the wrapped error for the ARM error code and correct accordingly","Retry after any in-progress operation on the instance completes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}