hashicorp/nomad · error
Unsupported drive_interface
Error message
Unsupported drive_interface
What it means
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.
Source
Thrown at drivers/qemu/driver.go:526
}
mb := cfg.Resources.NomadResources.Memory.MemoryMB
if mb < 128 || mb > 4000000 {
return nil, nil, fmt.Errorf("QEMU memory assignment out of bounds")
}
mem := fmt.Sprintf("%dM", mb)
absPath, err := GetAbsolutePath(fmt.Sprintf("qemu-system-%s", emulator))
if err != nil {
return nil, nil, err
}
driveInterface := "ide"
if driverConfig.DriveInterface != "" {
driveInterface = driverConfig.DriveInterface
}
if !isAllowedDriveInterface(driveInterface) {
return nil, nil, fmt.Errorf("Unsupported drive_interface")
}
args := []string{
absPath,
"-machine", "type=" + machineType + ",accel=" + accelerator,
"-name", vmID,
"-m", mem,
// setting a drive ID allows users to attach this to other devices
"-drive", "file=" + vmPath + ",if=" + driveInterface + ",id=image0",
"-nographic",
}
var netdevArgs []string
if cfg.DNS != nil {
if len(cfg.DNS.Servers) > 0 {
netdevArgs = append(netdevArgs, "dns="+cfg.DNS.Servers[0])
}
View on GitHub (pinned to 482b49bf1a)
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).
Example fix
// before
args { "drive_interface" = "virtio-blk" }
// after
args { "drive_interface" = "virtio" } Defensive patterns
Strategy: validation
Validate before calling
const allowedDriveInterfaces = ["ide", "scsi", "sata", "virtio", "nvme"];
function validateDriveInterface(cfg) {
const di = cfg.drive_interface || "ide";
if (!allowedDriveInterfaces.includes(di)) {
throw new Error(`Unsupported drive_interface: ${di}`);
}
} Type guard
function hasValidDriveInterface(cfg) {
return ["ide", "scsi", "sata", "virtio", "nvme"].includes(cfg?.drive_interface ?? "ide");
} Try / catch
try {
await nomad.jobs.startTask(cfg);
} catch (e) {
if (String(e.message).includes("Unsupported drive_interface")) {
console.error("Use one of ide, scsi, sata, virtio, nvme (lowercase)");
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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".
Common situations: 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.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- failed to parse config:
- QEMU graceful shutdown is unsupported on the Windows platfor
- only one of cgroups_v1_override and cgroups_v2_override may
- work_dir must be an absolute path
- require only one of PemKey or PemKeyFile
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/24664f59831bdea3.
Report an issue: GitHub.