{"record":{"id":"fc7d4f4832213070","repo":"kubernetes/kops","slug":"unsupported-resource-type-q-for-providerid-q","errorCode":null,"errorMessage":"unsupported resource type %q for providerID %q","messagePattern":"unsupported resource type %q for providerID %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/azure/identify.go","lineNumber":170,"sourceCode":"}\n\nfunc getVMNameFromProviderID(providerID string) (string, error) {\n\tif !strings.HasPrefix(providerID, \"azure://\") {\n\t\treturn \"\", fmt.Errorf(\"providerID %q not recognized\", providerID)\n\t}\n\n\tres, err := arm.ParseResourceID(strings.TrimPrefix(providerID, \"azure://\"))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error parsing providerID: %v\", err)\n\t}\n\n\tswitch res.ResourceType.String() {\n\tcase \"Microsoft.Compute/virtualMachines\":\n\t\treturn res.Name, nil\n\tcase \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\":\n\t\treturn res.Parent.Name + \"_\" + res.Name, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported resource type %q for providerID %q\", res.ResourceType, providerID)\n\t}\n}\n","sourceCodeStart":152,"sourceCodeEnd":173,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/azure/identify.go#L152-L173","documentation":"The providerID parsed as a valid ARM ID, but its resource type is neither Microsoft.Compute/virtualMachines nor Microsoft.Compute/virtualMachineScaleSets/virtualMachines. getVMNameFromProviderID only knows these two shapes, so any other Azure resource behind an azure:// providerID (e.g. VMSS itself, disks, or compute galleries) is rejected.","triggerScenarios":"providerID pointing at \"Microsoft.Compute/virtualMachineScaleSets\" (the scale set, not a VM instance), \"Microsoft.Network/networkInterfaces\", or a newer resource type introduced by a cloud controller without a matching kOps update.","commonSituations":"Hand-editing providerIDs to point at the VMSS resource; third-party controllers stamping providerIDs for non-VM resources; Azure CCM emitting a new providerID shape after an upgrade while the kOps nodeidentity code predates it.","solutions":["Check the resource type in the error and ensure the node's providerID points at an individual VM or VMSS VM instance.","Upgrade kOps to a version supporting the new providerID resource type, or add a case to the switch in getVMNameFromProviderID.","Restart kubelet/CCM so it re-stamps the canonical per-VM providerID.","For VMSS, confirm the ID ends with /virtualMachines/<instanceName> — only that form yields \"scaleSetName_instanceName\"."],"exampleFix":"// before: switch lacks the new type\ncase \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\":\n    return res.Parent.Name + \"_\" + res.Name, nil\n\n// after: add support for additional shapes as needed\ncase \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\":\n    return res.Parent.Name + \"_\" + res.Name, nil\ncase \"Microsoft.Compute/virtualMachines/runCommand\": // example of a newly seen type\n    return res.Parent.Name, nil","handlingStrategy":"type-guard","validationCode":"res, err := arm.ParseResourceID(strings.TrimPrefix(pid, \"azure://\"))\nif err == nil {\n    t := res.ResourceType.String()\n    if t != \"Microsoft.Compute/virtualMachines\" && t != \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\" {\n        return fmt.Errorf(\"unsupported providerID resource type %s\", t)\n    }\n}","typeGuard":"func isComputeVMResourceType(res *arm.ResourceID) bool {\n    t := res.ResourceType.String()\n    return t == \"Microsoft.Compute/virtualMachines\" ||\n        t == \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\"\n}","tryCatchPattern":"name, err := getVMNameFromProviderID(pid)\nif err != nil && strings.Contains(err.Error(), \"unsupported resource type\") {\n    return fmt.Errorf(\"upgrade kops or fix providerID %q to point at a VM/VMSS instance\", pid)\n}","preventionTips":["Keep kOps and cloud-provider-azure versions in lockstep so new providerID shapes are supported","Point providerIDs only at individual VM instances, never at scale sets or NICs","Add a case for new Azure resource types in getVMNameFromProviderID before rolling out upgraded CCMs"],"tags":["azure","provider-id","vmss","unsupported-resource-type","kops"],"backgroundTag":"unsupported-resource-type","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}