Skip to content

ops instance create -t proxmox fails to attach disk on Proxmox VE 9.x — "explicit 'media=cdrom' is required for iso images" #1787

Description

@tmvtmv

Title

ops instance create -t proxmox fails to attach disk on Proxmox VE 9.x — "explicit 'media=cdrom' is required for iso images"

Environment

  • Ops version: 0.1.55
  • Host OS: macOS (Apple Silicon), cross-building for --arch=amd64
  • Proxmox VE version: 9.2.2
  • Target storage: ZFS (zfsdata)

Description

ops image create -t proxmox succeeds and uploads the built image, but it lands in the iso content type on the configured isoStorageName (e.g. local:iso/webapp.iso) rather than as a raw disk image. When ops instance create -t proxmox then tries to attach that file directly as a virtio0 block device, Proxmox rejects it:

{"virtio0":"explicit 'media=cdrom' is required for iso images"}

This appears to be caused by a Proxmox VE behavior change (present since 8.4, still enforced in 9.x) that strictly disallows attaching anything under iso storage content as a normal disk — it must either be mounted as media=cdrom or imported into proper disk/image storage first. Proxmox support has confirmed this is intentional current behavior, not a bug on their end:
https://forum.proxmox.com/threads/possible-regression-in-pve-9-2-3-owner-vm-when-migrating-iso-attached-as-media-disk.184582/

Steps to reproduce

GOOS=linux GOARCH=amd64 go build -o webapp main.go

export API_URL="https://<proxmox-ip>:8006"
export TOKEN_ID="user@pam!tokenid"
export SECRET="..."
export NODE_NAME="gn2"

ops image create webapp -t proxmox -c config.json --arch=amd64
# succeeds, image lands as local:iso/webapp.iso

ops instance create webapp -t proxmox -c config.json
# fails: {"virtio0":"explicit 'media=cdrom' is required for iso images"}

config.json

{
  "RunConfig": {
    "Ports": ["8080"]
  },
  "TargetConfig": {
    "isoStorageName": "local",
    "Arch": "x86_64",
    "Machine": "q35",
    "Sockets": "1",
    "Cores": "1",
    "Memory": "512M",
    "StorageName": "zfsdata",
    "BridgePrefix": "vmbr",
    "Onboot": "0"
  }
}

Expected behavior

ops instance create -t proxmox should either upload the image directly into disk/image storage (bypassing ISO content type entirely), or perform the equivalent of qm importdisk + attach against StorageName automatically, so the resulting VM has a working boot disk without manual intervention.

Actual behavior

The VM is created with network/CPU/memory config intact, but no usable boot disk is attached — it requires manually running (on the Proxmox host):

qm importdisk <vmid> /var/lib/vz/template/iso/webapp.iso zfsdata --format raw
qm set <vmid> --virtio0 zfsdata:vm-<vmid>-disk-0
qm set <vmid> --boot order=virtio0
qm start <vmid>

...after which the unikernel boots correctly.

Related issues

  • add proxmox target #1187 — discusses that Proxmox lacked a raw-disk-import API at the time and that this step had to be done manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions