{"record":{"id":"b37f9eb0af1bef13","repo":"kubernetes/kops","slug":"detachinstance-not-implemented-on-azurecloud","errorCode":null,"errorMessage":"DetachInstance not implemented on azureCloud","messagePattern":"DetachInstance not implemented on azureCloud","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/azure_cloud.go","lineNumber":256,"sourceCode":"\nfunc (c *azureCloudImplementation) DeleteInstance(i *cloudinstances.CloudInstance) error {\n\tvmssName := i.CloudInstanceGroup.HumanName\n\tinstanceID := strings.TrimPrefix(i.ID, vmssName+\"_\")\n\treturn c.vmscaleSetVMsClient.Delete(context.TODO(), c.resourceGroupName, vmssName, instanceID)\n}\n\n// DeregisterInstance drains a cloud instance and loadbalancers.\nfunc (c *azureCloudImplementation) DeregisterInstance(i *cloudinstances.CloudInstance) error {\n\tklog.V(8).Info(\"Azure DeregisterInstance not implemented\")\n\treturn nil\n}\n\nfunc (c *azureCloudImplementation) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error {\n\treturn errors.New(\"DeleteGroup not implemented on azureCloud\")\n}\n\nfunc (c *azureCloudImplementation) DetachInstance(i *cloudinstances.CloudInstance) error {\n\treturn errors.New(\"DetachInstance not implemented on azureCloud\")\n}\n\n// AddClusterTags adds cluster tags to the resource.\nfunc (c *azureCloudImplementation) AddClusterTags(tags map[string]*string) {\n\tfor k, v := range c.tags {\n\t\ttags[k] = &v\n\t}\n}\n\nfunc (c *azureCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error) {\n\tvar ingresses []fi.ApiIngressStatus\n\trg := cluster.AzureResourceGroupName()\n\n\tlbSpec := cluster.Spec.API.LoadBalancer\n\tif lbSpec != nil {\n\t\t// Get load balancers in cluster resource group\n\t\tlbs, err := c.loadBalancersClient.List(context.TODO(), rg)\n\t\tif err != nil {","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/azure_cloud.go#L238-L274","documentation":"Detaching an individual instance from its cloud group (used by rolling-update --cloud-azure style flows to detach then drain then delete a node) is not implemented on Azure; the method always returns this error.","triggerScenarios":"Calling cloud.DetachInstance(i) on an Azure CloudInstance — typically from the rolling-update detach/drain machinery when DetachInstance option is enabled.","commonSituations":"Rolling update with detachment enabled on an Azure cluster; drain-and-detach automation ported from AWS to Azure; chaos/node-removal tooling calling the generic CloudInstance detach API.","solutions":["Do not use instance detach on Azure; rely on standard rolling update without --detach or equivalent","Remove the VM from the VMSS/availability set directly in Azure if detach semantics are required","Implement DetachInstance for Azure by removing the vm from the scale set (vmssClient update/delete)","Upgrade kops to a version with Azure detach support"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if c.ProviderID() == kops.CloudProviderAzure && requireDetach {\n\treturn fmt.Errorf(\"instance detach is unsupported on Azure\")\n}","typeGuard":null,"tryCatchPattern":"if err := cloud.DetachInstance(inst); err != nil {\n\tif strings.Contains(err.Error(), \"DetachInstance not implemented on azureCloud\") {\n\t\t// skip detach; proceed with drain-only flow\n\t} else { return err }\n}","preventionTips":["Avoid --detach style rolling updates on Azure clusters","Test rolling-update automation against Azure before production","Handle provider-specific capability gaps in the rolling-update driver"],"tags":["azure","instance-detach","not-implemented","rolling-update"],"backgroundTag":"not-implemented-on-provider","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"}