Creating additional virtio disk of a VM

darian

New Member
Jul 3, 2017
3
0
1
38
Hi to everyone.

I'm trying to create an additional virtio1 disk for a VM. FYI, the VM has already a virtio0 disk.

Therefore, I try to create it via the API using the call:

Code:
POST /api2/json/nodes/{node}/qemu/{vmid}/config

But I'm receiving this:

Code:
update VM 105: -virtio1 local:105/vm-105-disk2.qcow2,cache=writeback,mbps_rd=300,mbps_wr=150,media=disk,size=14G
TASK ERROR: volume 'local:105/vm-105-disk2.qcow2' does not exist

As you can see, it tries to update the vm (and that's why it fails correctly, because a virtio1 disk does not exit indeed), which is weird because the PUT call should do that instead of the POST.

Am I using it wrong? Is there any alternative way for creating an additional virtio disk for a VM?

PS: Proxmox v4.3, API2
 
If you want to create/allocate a new disk, you can use the special syntax "-virtio1 local:<size_in_GB>,..."

Or you allocate the volume first.
 
  • Like
Reactions: darian
I found a solution. I've tried to do this:

Code:
POST /api2/json/nodes/{node}/qemu/{vmid}/config 
-virtio1 local:105/vm-105-disk2.qcow2,cache=writeback,mbps_rd=300,mbps_wr=150,media=disk,size=14G

But the right way was this:

Code:
PUT /api2/json/nodes/{node}/qemu/{vmid}/config 
-virtio1 local:14,media=disk,cache=writeback,mbps_rd=300,mbps_wr=150,format=qcow2