kubernetes/kops · error

unsupported resource type %q for providerID %q

Error message

unsupported resource type %q for providerID %q

What it means

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.

Source

Thrown at pkg/nodeidentity/azure/identify.go:170

}

func getVMNameFromProviderID(providerID string) (string, error) {
	if !strings.HasPrefix(providerID, "azure://") {
		return "", fmt.Errorf("providerID %q not recognized", providerID)
	}

	res, err := arm.ParseResourceID(strings.TrimPrefix(providerID, "azure://"))
	if err != nil {
		return "", fmt.Errorf("error parsing providerID: %v", err)
	}

	switch res.ResourceType.String() {
	case "Microsoft.Compute/virtualMachines":
		return res.Name, nil
	case "Microsoft.Compute/virtualMachineScaleSets/virtualMachines":
		return res.Parent.Name + "_" + res.Name, nil
	default:
		return "", fmt.Errorf("unsupported resource type %q for providerID %q", res.ResourceType, providerID)
	}
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the resource type in the error and ensure the node's providerID points at an individual VM or VMSS VM instance.
  2. Upgrade kOps to a version supporting the new providerID resource type, or add a case to the switch in getVMNameFromProviderID.
  3. Restart kubelet/CCM so it re-stamps the canonical per-VM providerID.
  4. For VMSS, confirm the ID ends with /virtualMachines/<instanceName> — only that form yields "scaleSetName_instanceName".

Example fix

// before: switch lacks the new type
case "Microsoft.Compute/virtualMachineScaleSets/virtualMachines":
    return res.Parent.Name + "_" + res.Name, nil

// after: add support for additional shapes as needed
case "Microsoft.Compute/virtualMachineScaleSets/virtualMachines":
    return res.Parent.Name + "_" + res.Name, nil
case "Microsoft.Compute/virtualMachines/runCommand": // example of a newly seen type
    return res.Parent.Name, nil
Defensive patterns

Strategy: type-guard

Validate before calling

res, err := arm.ParseResourceID(strings.TrimPrefix(pid, "azure://"))
if err == nil {
    t := res.ResourceType.String()
    if t != "Microsoft.Compute/virtualMachines" && t != "Microsoft.Compute/virtualMachineScaleSets/virtualMachines" {
        return fmt.Errorf("unsupported providerID resource type %s", t)
    }
}

Type guard

func isComputeVMResourceType(res *arm.ResourceID) bool {
    t := res.ResourceType.String()
    return t == "Microsoft.Compute/virtualMachines" ||
        t == "Microsoft.Compute/virtualMachineScaleSets/virtualMachines"
}

Try / catch

name, err := getVMNameFromProviderID(pid)
if err != nil && strings.Contains(err.Error(), "unsupported resource type") {
    return fmt.Errorf("upgrade kops or fix providerID %q to point at a VM/VMSS instance", pid)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/fc7d4f4832213070. Report an issue: GitHub.