{"record":{"id":"c0cc50b73a12c6c1","repo":"kubernetes/kops","slug":"getting-machine-type-info-w-c0cc50","errorCode":null,"errorMessage":"getting machine type info: %w","messagePattern":"getting machine type info: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/instancetemplate.go","lineNumber":324,"sourceCode":"\t\treturn machineTypeInfo, nil\n\t}\n\n\tfamily := strings.Split(machineType, \"-\")[0]\n\n\tswitch family {\n\tcase \"a4x\", \"a4\", \"a3\", \"a2\", \"g2\", \"g4\":\n\t\t// VMs with GPUs attached do not support live migration.\n\t\t// https://docs.cloud.google.com/compute/docs/instances/live-migration-process#limitations\n\t\tmachineTypeInfo.SupportsMigration = false\n\t}\n\n\treturn machineTypeInfo, nil\n}\n\nfunc (e *InstanceTemplate) mapToGCE(project string, region string) (*compute.InstanceTemplate, error) {\n\tmachineTypeInfo, err := guessMachineTypeInfo(fi.ValueOf(e.MachineType))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting machine type info: %w\", err)\n\t}\n\n\tscheduling := buildScheduling(machineTypeInfo, e.Preemptible, e.GCPProvisioningModel, e.GuestAccelerators)\n\n\tvar disks []*compute.AttachedDisk\n\tdisks = append(disks, &compute.AttachedDisk{\n\t\tKind: \"compute#attachedDisk\",\n\t\tInitializeParams: &compute.AttachedDiskInitializeParams{\n\t\t\tSourceImage: BuildImageURL(project, *e.BootDiskImage),\n\t\t\tDiskSizeGb:  *e.BootDiskSizeGB,\n\t\t\tDiskType:    *e.BootDiskType,\n\t\t},\n\t\tBoot:       true,\n\t\tDeviceName: \"persistent-disks-0\",\n\t\tIndex:      0,\n\t\tAutoDelete: true,\n\t\tMode:       \"READ_WRITE\",\n\t\tType:       \"PERSISTENT\",","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/instancetemplate.go#L306-L342","documentation":"Wrapped error propagated from guessMachineTypeInfo inside InstanceTemplate.mapToGCE. The helper derives migration support from the machine-type family prefix; failure means the machine type string was malformed or could not be split into a family (e.g. empty or non-standard MachineType in the spec).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/instancetemplate.go:324 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the machine type in the instance template spec is a valid GCE type name (e.g. n1-standard-2)","Check the wrapped error for the specific parse failure","Correct the cluster spec's machine type and re-run"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}