{"record":{"id":"24664f59831bdea3","repo":"hashicorp/nomad","slug":"unsupported-drive-interface","errorCode":null,"errorMessage":"Unsupported drive_interface","messagePattern":"Unsupported drive_interface","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/qemu/driver.go","lineNumber":526,"sourceCode":"\t}\n\n\tmb := cfg.Resources.NomadResources.Memory.MemoryMB\n\tif mb < 128 || mb > 4000000 {\n\t\treturn nil, nil, fmt.Errorf(\"QEMU memory assignment out of bounds\")\n\t}\n\tmem := fmt.Sprintf(\"%dM\", mb)\n\n\tabsPath, err := GetAbsolutePath(fmt.Sprintf(\"qemu-system-%s\", emulator))\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tdriveInterface := \"ide\"\n\tif driverConfig.DriveInterface != \"\" {\n\t\tdriveInterface = driverConfig.DriveInterface\n\t}\n\tif !isAllowedDriveInterface(driveInterface) {\n\t\treturn nil, nil, fmt.Errorf(\"Unsupported drive_interface\")\n\t}\n\n\targs := []string{\n\t\tabsPath,\n\t\t\"-machine\", \"type=\" + machineType + \",accel=\" + accelerator,\n\t\t\"-name\", vmID,\n\t\t\"-m\", mem,\n\t\t// setting a drive ID allows users to attach this to other devices\n\t\t\"-drive\", \"file=\" + vmPath + \",if=\" + driveInterface + \",id=image0\",\n\t\t\"-nographic\",\n\t}\n\n\tvar netdevArgs []string\n\tif cfg.DNS != nil {\n\t\tif len(cfg.DNS.Servers) > 0 {\n\t\t\tnetdevArgs = append(netdevArgs, \"dns=\"+cfg.DNS.Servers[0])\n\t\t}\n","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/qemu/driver.go#L508-L544","documentation":"The QEMU driver accepts a drive_interface option (default \"ide\") controlling how the disk is attached (-drive if=...). StartTask checks it against isAllowedDriveInterface, which permits only ide, scsi, sata, virtio, nvme. Any other value aborts the task start.","triggerScenarios":"Setting driver config drive_interface to a value not in {ide, sata, scsi, virtio, nvme} — e.g. \"virtio-blk\", \"IDE\" (case mismatch), \"usb\", or a misspelling like \"virtiio\".","commonSituations":"Copy-pasting QEMU CLI flags (like if=virtio-blk) into the Nomad option; typos; case sensitivity mistakes; using an interface added in newer QEMU versions but not in the driver's allowlist.","solutions":["Change drive_interface in the task's driver config to one of: ide, sata, scsi, virtio, nvme.","Fix casing/spelling (values are matched exactly, lowercase).","If a new interface is genuinely needed, the driver's allowlist must be extended upstream (patch isAllowedDriveInterface)."],"exampleFix":"// before\nargs { \"drive_interface\" = \"virtio-blk\" }\n// after\nargs { \"drive_interface\" = \"virtio\" }","handlingStrategy":"validation","validationCode":"const allowedDriveInterfaces = [\"ide\", \"scsi\", \"sata\", \"virtio\", \"nvme\"];\nfunction validateDriveInterface(cfg) {\n  const di = cfg.drive_interface || \"ide\";\n  if (!allowedDriveInterfaces.includes(di)) {\n    throw new Error(`Unsupported drive_interface: ${di}`);\n  }\n}","typeGuard":"function hasValidDriveInterface(cfg) {\n  return [\"ide\", \"scsi\", \"sata\", \"virtio\", \"nvme\"].includes(cfg?.drive_interface ?? \"ide\");\n}","tryCatchPattern":"try {\n  await nomad.jobs.startTask(cfg);\n} catch (e) {\n  if (String(e.message).includes(\"Unsupported drive_interface\")) {\n    console.error(\"Use one of ide, scsi, sata, virtio, nvme (lowercase)\");\n  }\n  throw e;\n}","preventionTips":["Restrict drive_interface values in your job templates to the five allowed ones.","Keep values lowercase; matching is exact string equality.","Translate raw QEMU if= flags (e.g. virtio-blk) to the closest allowed name (virtio).","Validate job specs in CI before submitting."],"tags":["qemu","config-validation","disk","nomad"],"backgroundTag":"invalid-config-value","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}