Using a cloud image to create a new VM using the command line is straightforward. I'm running into a problem using the API to do the same.
I am using this cloud image:
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
I'm using this API endpoint (substituting node for my node's name):
/api2/json/nodes/{node}/qemu
And then the following config:
I'm getting a 400 error:
local:iso/ubuntu-22.04-server-cloudimg-amd64.img has wrong type 'iso' - not an image
I am using this cloud image:
https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
I'm using this API endpoint (substituting node for my node's name):
/api2/json/nodes/{node}/qemu
And then the following config:
JSON:
{
'name': 'test',
'vmid': 101,
'ostype': 'l26',
'memory': 2048,
'cores': 4,
'scsihw': 'virtio-scsi-pci',
'virtio0': 'local-zfs:0,import-from=local:iso/ubuntu-22.04-server-cloudimg-amd64.img,backup=0,format=qcow2',
'cipassword': 'password',
'boot': 'order=virtio0',
'net0': f'model=virtio,bridge=vmbr1'
}
I'm getting a 400 error:
local:iso/ubuntu-22.04-server-cloudimg-amd64.img has wrong type 'iso' - not an image