kubernetes/kops · error

getting machine type info: %w

Error message

getting machine type info: %w

What it means

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).

Source

Thrown at upup/pkg/fi/cloudup/gcetasks/instancetemplate.go:324

		return machineTypeInfo, nil
	}

	family := strings.Split(machineType, "-")[0]

	switch family {
	case "a4x", "a4", "a3", "a2", "g2", "g4":
		// VMs with GPUs attached do not support live migration.
		// https://docs.cloud.google.com/compute/docs/instances/live-migration-process#limitations
		machineTypeInfo.SupportsMigration = false
	}

	return machineTypeInfo, nil
}

func (e *InstanceTemplate) mapToGCE(project string, region string) (*compute.InstanceTemplate, error) {
	machineTypeInfo, err := guessMachineTypeInfo(fi.ValueOf(e.MachineType))
	if err != nil {
		return nil, fmt.Errorf("getting machine type info: %w", err)
	}

	scheduling := buildScheduling(machineTypeInfo, e.Preemptible, e.GCPProvisioningModel, e.GuestAccelerators)

	var disks []*compute.AttachedDisk
	disks = append(disks, &compute.AttachedDisk{
		Kind: "compute#attachedDisk",
		InitializeParams: &compute.AttachedDiskInitializeParams{
			SourceImage: BuildImageURL(project, *e.BootDiskImage),
			DiskSizeGb:  *e.BootDiskSizeGB,
			DiskType:    *e.BootDiskType,
		},
		Boot:       true,
		DeviceName: "persistent-disks-0",
		Index:      0,
		AutoDelete: true,
		Mode:       "READ_WRITE",
		Type:       "PERSISTENT",

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the machine type in the instance template spec is a valid GCE type name (e.g. n1-standard-2)
  2. Check the wrapped error for the specific parse failure
  3. Correct the cluster spec's machine type and re-run
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gcetasks/instancetemplate.go:324 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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