{"record":{"id":"faeae53f9d17c946","repo":"kubernetes/kops","slug":"found-vmss-without-vm-profile","errorCode":null,"errorMessage":"found VMSS without VM profile","messagePattern":"found VMSS without VM profile","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/vmscaleset.go","lineNumber":116,"sourceCode":"\tif err != nil && !strings.Contains(err.Error(), \"NotFound\") {\n\t\treturn nil, err\n\t}\n\tif found == nil {\n\t\treturn nil, nil\n\t}\n\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}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/vmscaleset.go#L98-L134","documentation":"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.","triggerScenarios":"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.","commonSituations":"Manually created/modified VMSS in the resource group; interrupted arm template/deployment; mock fixtures in TestVMScaleSetFind missing VirtualMachineProfile.","solutions":["Recreate the VMSS via kops apply so it includes a full VirtualMachineProfile.","If a broken VMSS is leaked, delete it (az vmss delete) and re-apply.","Populate VirtualMachineProfile in test mocks.","Ensure no external tooling (ARM/Terraform) strips the profile from the scale set kops manages."],"exampleFix":"// before\nprops := &compute.VirtualMachineScaleSetProperties{ProvisioningState: &state}\n// after\nprops := &compute.VirtualMachineScaleSetProperties{ProvisioningState: &state, VirtualMachineProfile: &compute.VirtualMachineScaleSetVMProfile{}}","handlingStrategy":"validation","validationCode":"if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile == nil {\n    return fmt.Errorf(\"VMSS %s lacks VirtualMachineProfile; recreate via kops apply\", name)\n}","typeGuard":"func hasVMProfile(v *compute.VirtualMachineScaleSet) bool {\n    return v != nil && v.Properties != nil && v.Properties.VirtualMachineProfile != nil\n}","tryCatchPattern":"found, err := task.Find(ctx, cloud)\nif err != nil {\n    if strings.Contains(err.Error(), \"without VM profile\") {\n        return recreateVMSS(task.Name)\n    }\n    return err\n}","preventionTips":["Never hand-edit or template-manage kops-owned VMSS resources.","Ensure test fixtures include VirtualMachineProfile.","Delete leaked/partially-created VMSS before re-applying."],"tags":["azure","vmss","vm-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"}