kubernetes/kops · error

found VMSS without VM profile

Error message

found VMSS without VM profile

What it means

After confirming the VMSS is not in Failed provisioning state, Find requires VirtualMachineProfile to be non-nil, since all node configuration (image, network, OS) is read from it. A VMSS without a VM profile has no virtual machine definition and cannot be diffed against the desired spec.

Source

Thrown at upup/pkg/fi/cloudup/azuretasks/vmscaleset.go:116

	if err != nil && !strings.Contains(err.Error(), "NotFound") {
		return nil, err
	}
	if found == nil {
		return nil, nil
	}

	if found.ID == nil {
		return nil, fmt.Errorf("found VMSS without ID")
	}
	if found.Properties == nil {
		return nil, fmt.Errorf("found VMSS without properties")
	}
	if fi.ValueOf(found.Properties.ProvisioningState) == "Failed" {
		klog.Warningf("found VMSS %q in failed provisioning state", *s.Name)
		return nil, nil
	}
	if found.Properties.VirtualMachineProfile == nil {
		return nil, fmt.Errorf("found VMSS without VM profile")
	}
	if found.Properties.VirtualMachineProfile.NetworkProfile == nil {
		return nil, fmt.Errorf("found VMSS without network profile")
	}
	if found.Properties.VirtualMachineProfile.OSProfile == nil {
		return nil, fmt.Errorf("found VMSS without OS profile")
	}

	profile := found.Properties.VirtualMachineProfile

	nwConfigs := profile.NetworkProfile.NetworkInterfaceConfigurations
	if len(nwConfigs) != 1 {
		return nil, fmt.Errorf("expecting exactly 1 network interface config for %q, found %d: %+v", *s.Name, len(nwConfigs), nwConfigs)
	}
	nwConfig := nwConfigs[0]
	if nwConfig.Properties == nil {
		return nil, fmt.Errorf("found VMSS without network interface config properties")
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Recreate the VMSS via kops apply so it includes a full VirtualMachineProfile.
  2. If a broken VMSS is leaked, delete it (az vmss delete) and re-apply.
  3. Populate VirtualMachineProfile in test mocks.
  4. Ensure no external tooling (ARM/Terraform) strips the profile from the scale set kops manages.

Example fix

// before
props := &compute.VirtualMachineScaleSetProperties{ProvisioningState: &state}
// after
props := &compute.VirtualMachineScaleSetProperties{ProvisioningState: &state, VirtualMachineProfile: &compute.VirtualMachineScaleSetVMProfile{}}
Defensive patterns

Strategy: validation

Validate before calling

if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile == nil {
    return fmt.Errorf("VMSS %s lacks VirtualMachineProfile; recreate via kops apply", name)
}

Type guard

func hasVMProfile(v *compute.VirtualMachineScaleSet) bool {
    return v != nil && v.Properties != nil && v.Properties.VirtualMachineProfile != nil
}

Try / catch

found, err := task.Find(ctx, cloud)
if err != nil {
    if strings.Contains(err.Error(), "without VM profile") {
        return recreateVMSS(task.Name)
    }
    return err
}

Prevention

When it happens

Trigger: Azure returns a VMSS whose Properties.VirtualMachineProfile is nil — e.g. the scale set was created without a VM profile, is mid-update, or the test fixture omitted it.

Common situations: Manually created/modified VMSS in the resource group; interrupted arm template/deployment; mock fixtures in TestVMScaleSetFind missing VirtualMachineProfile.

Related errors


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