{"record":{"id":"97fdfcbd5713b431","repo":"kubernetes/kops","slug":"found-vmss-without-os-profile","errorCode":null,"errorMessage":"found VMSS without OS profile","messagePattern":"found VMSS without OS profile","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/vmscaleset.go","lineNumber":122,"sourceCode":"\n\tif found.ID == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without ID\")\n\t}\n\tif found.Properties == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without properties\")\n\t}\n\tif fi.ValueOf(found.Properties.ProvisioningState) == \"Failed\" {\n\t\tklog.Warningf(\"found VMSS %q in failed provisioning state\", *s.Name)\n\t\treturn nil, nil\n\t}\n\tif found.Properties.VirtualMachineProfile == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without VM profile\")\n\t}\n\tif found.Properties.VirtualMachineProfile.NetworkProfile == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without network profile\")\n\t}\n\tif found.Properties.VirtualMachineProfile.OSProfile == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without OS profile\")\n\t}\n\n\tprofile := found.Properties.VirtualMachineProfile\n\n\tnwConfigs := profile.NetworkProfile.NetworkInterfaceConfigurations\n\tif len(nwConfigs) != 1 {\n\t\treturn nil, fmt.Errorf(\"expecting exactly 1 network interface config for %q, found %d: %+v\", *s.Name, len(nwConfigs), nwConfigs)\n\t}\n\tnwConfig := nwConfigs[0]\n\tif nwConfig.Properties == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without network interface config properties\")\n\t}\n\tipConfigs := nwConfig.Properties.IPConfigurations\n\tif len(ipConfigs) != 1 {\n\t\treturn nil, fmt.Errorf(\"expecting exactly 1 network interface IP config for %q, found %d: %+v\", *s.Name, len(ipConfigs), ipConfigs)\n\t}\n\tipConfig := ipConfigs[0]\n\tif ipConfig.Properties == nil {","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/vmscaleset.go#L104-L140","documentation":"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.","triggerScenarios":"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.","commonSituations":"Externally created VMSS in the kops-managed resource group; deployment tooling that omits OS settings; mocks missing OSProfile.","solutions":["Re-run kops apply to recreate the VMSS with the full OS profile kops expects.","Delete the malformed VMSS so the next apply provisions a correct one.","Include OSProfile in test mock responses.","Avoid managing the same VMSS with both kops and other IaC tools."],"exampleFix":"// before\nprofile := &compute.VirtualMachineScaleSetVMProfile{NetworkProfile: np}\n// after\nprofile := &compute.VirtualMachineScaleSetVMProfile{NetworkProfile: np, OSProfile: &compute.VirtualMachineScaleSetOSProfile{}}","handlingStrategy":"validation","validationCode":"p := vmss.Properties.VirtualMachineProfile\nif p.OSProfile == nil {\n    return fmt.Errorf(\"VMSS lacks OSProfile; recreate with kops apply\")\n}","typeGuard":"func hasOSProfile(v *compute.VirtualMachineScaleSet) bool {\n    return v != nil && v.Properties != nil && v.Properties.VirtualMachineProfile != nil &&\n        v.Properties.VirtualMachineProfile.OSProfile != nil\n}","tryCatchPattern":"found, err := task.Find(ctx, cloud)\nif err != nil {\n    if strings.Contains(err.Error(), \"without OS profile\") {\n        return recreateScaleSet(task.Name)\n    }\n    return err\n}","preventionTips":["Create VMSS only through kops apply.","Include OSProfile in test fixtures.","Watch for external automation stripping OS settings from the scale set."],"tags":["azure","vmss","os-profile"],"backgroundTag":"azure-vmss-invalid-profile","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}