Telmate/proxmox-api-go

QEMU VMs with 2+ ide devices will override iso parameter

akadoya opened this issue · 0 comments

when creating a qemu vm with more than 2 ide disks, 'iso' param is no longer honored.

{
  "name": "proxmox-api-go-test",
  "desc": "Test proxmox-api-go",
  "memory": 2048,
  "os": "l26",
  "cores": 2,
  "sockets": 1,
  "vmid": 123,
  "iso": "local:iso/ubuntu-18.04.5-live-server-amd64.iso",                                // supposedly  alias for ide2
  "disk": {
    "0": {
      "type": "virtio",
      "storage": "local-thinlvm",
      "storage_type": "lvmthin",
      "size": "30G",
      "backup": false
    },
    "1" :{
      "type": "ide",
      "storage": "whatever",
      "size": "1",
      "media": "cdrom",
      "backup": false,
      "slot": 0,                                                          // not used
      "volume": "local:iso/some.iso"
    },
    "2" :{
      "type": "ide",
      "storage": "whatever",
      "size": "1",
      "media": "cdrom",
      "backup": false,
      "slot": 3,                                                          // not used
      "volume": "local:iso/some.iso"
    }
  },
  "network": {
    "0": {
      "model": "virtio",
      "bridge": "vmbr0",
      "firewall": true,
      "tag": -1
    }
  }
}

the first iso is always mounted as ide1 then the next one is meant to be ide3 or ide0 that are available but proxmox-api-go overrides the ide2 instead.

request made by this client:
agent=0&cores=2&description=Test+proxmox-api-go&ide1=local%3Aiso%2Fsome.iso%2Csize%3D1%2Cmedia%3Dcdrom&ide2=local%3Aiso%2Fsome.iso%2Csize%3D1%2Cmedia%3Dcdrom&kvm=1&memory=2048&name=proxmox-api-go-test&net0=virtio%3DC2%3AC5%3A48%3A3E%3A9C%3ADD%2Cbridge%3Dvmbr0%2Cfirewall%3D1&numa=0&onboot=0&ostype=l26&sockets=1&virtio0=local-thinlvm%3A30&vmid=123

shouldn't this api client honor "slot" param or exclude ide2 to be assigned in the disk config section when iso param exists?