kubernetes/kops · error

found VMSS without OS profile

Error message

found VMSS without OS profile

What it means

Find requires VirtualMachineProfile.OSProfile to be non-nil because it reads the admin username / computer-name prefix and other OS settings for the nodes. The error means the VMSS returned by Azure has no OS profile section in its VM profile.

Source

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

	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")
	}
	ipConfigs := nwConfig.Properties.IPConfigurations
	if len(ipConfigs) != 1 {
		return nil, fmt.Errorf("expecting exactly 1 network interface IP config for %q, found %d: %+v", *s.Name, len(ipConfigs), ipConfigs)
	}
	ipConfig := ipConfigs[0]
	if ipConfig.Properties == nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Re-run kops apply to recreate the VMSS with the full OS profile kops expects.
  2. Delete the malformed VMSS so the next apply provisions a correct one.
  3. Include OSProfile in test mock responses.
  4. Avoid managing the same VMSS with both kops and other IaC tools.

Example fix

// before
profile := &compute.VirtualMachineScaleSetVMProfile{NetworkProfile: np}
// after
profile := &compute.VirtualMachineScaleSetVMProfile{NetworkProfile: np, OSProfile: &compute.VirtualMachineScaleSetOSProfile{}}
Defensive patterns

Strategy: validation

Validate before calling

p := vmss.Properties.VirtualMachineProfile
if p.OSProfile == nil {
    return fmt.Errorf("VMSS lacks OSProfile; recreate with kops apply")
}

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: VirtualMachineProfile.OSProfile == nil in the returned scale set — VMSS created without osProfile (e.g. custom-image-only setup by other tooling) or test fixture omission.

Common situations: Externally created VMSS in the kops-managed resource group; deployment tooling that omits OS settings; mocks missing OSProfile.

Related errors


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