kubernetes/kops · error

VMScaleSetVM is missing ID

Error message

VMScaleSetVM is missing ID

What it means

Fires in toVMScaleSetVMResource when a VM Scale Set VM instance is nil or has a nil ID, so it cannot be converted into a trackable resource during Azure cluster resource discovery. The input at fault is an incompletely returned VM instance from the Azure API.

Source

Thrown at pkg/resources/azure/azure.go:522

	for lb := range lbs {
		blocks = append(blocks, toKey(typeLoadBalancer, lb))
	}

	return &resources.Resource{
		Obj:     vmss,
		Type:    typeVMScaleSet,
		ID:      *vmss.ID,
		Name:    *vmss.Name,
		Deleter: g.deleteVMScaleSet,
		Blocks:  blocks,
		Blocked: blocked,
		Dumper:  DumpVMScaleSet,
	}, nil
}

func (g *resourceGetter) toVMScaleSetVMResource(vmss *compute.VirtualMachineScaleSet, vm *compute.VirtualMachineScaleSetVM) (*resources.Resource, error) {
	if vm == nil || vm.ID == nil {
		return nil, fmt.Errorf("VMScaleSetVM is missing ID")
	}
	if vmss == nil || vmss.Name == nil || vmss.ID == nil {
		return nil, fmt.Errorf("VMScaleSet is missing ID or Name")
	}

	rid, err := arm.ParseResourceID(*vm.ID)
	if err != nil {
		return nil, err
	}
	instanceID := rid.Name

	name := ""
	if vm.Properties != nil && vm.Properties.OSProfile != nil && vm.Properties.OSProfile.ComputerName != nil {
		name = *vm.Properties.OSProfile.ComputerName
	} else if vm.Name != nil {
		name = *vm.Name
	} else {
		name = instanceID

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Re-run discovery; the instance may have been mid-creation/deletion
  2. List VMSS instances via az CLI to find the malformed instance
  3. Delete the broken instance directly in Azure if it persists
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/resources/azure/azure.go:522 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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