kubernetes/kops · error

VMScaleSet is missing ID or Name

Error message

VMScaleSet is missing ID or Name

What it means

Fires in toVMScaleSetVMResource when the parent VM Scale Set is nil or lacks ID/Name, so the VM instance resource cannot be keyed against its scale set during Azure discovery — a guard against incompletely populated VMSS objects from the API.

Source

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

	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
	}

	return &resources.Resource{

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Re-run discovery; the VMSS may have been concurrently deleted
  2. Verify the VMSS exists and is fully provisioned via az CLI
  3. Remove orphaned resources in the resource group if the VMSS is gone
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/resources/azure/azure.go:525 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/0bb2fcd3f35e9b0d. Report an issue: GitHub.