Hi,
I saw a documentation how to attach a cloudinit drive to vm, and I want to do the same from the API.
1. I have created a vm (vm id: 9000 )
2. I have downloaded cloudinit image and uploaded it to ISO Images (/var/lib/vz/template/iso/focal-server-cloudimg-amd64.img)
3. ?? I want to add cloudinit drive to my vm specifying the image path (like in the example), and I don't understant the API
The example I saw is:
(I am following this documentation: https://pve.proxmox.com/wiki/Cloud-Init_Support)
can you please help me understand what is the equivalent of the last two commands in the API calls?
Also, in the API tree I see:
PUT /api2/json/nodes/{node}/qemu/{vmid}/cloudinit (btw I think PUT & GET are reverted)
required: node, vmid; optional: new, old
can you please elaborate on new&old values?
I saw a documentation how to attach a cloudinit drive to vm, and I want to do the same from the API.
1. I have created a vm (vm id: 9000 )
2. I have downloaded cloudinit image and uploaded it to ISO Images (/var/lib/vz/template/iso/focal-server-cloudimg-amd64.img)
3. ?? I want to add cloudinit drive to my vm specifying the image path (like in the example), and I don't understant the API
The example I saw is:
# download the image
wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
# create a new VM with VirtIO SCSI controller
qm create 9000 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci
# import the downloaded disk to the local-lvm storage, attaching it as a SCSI drive
qm set 9000 --scsi0 local-lvm:0,import-from=/path/to/bionic-server-cloudimg-amd64.img
#The next step is to configure a CD-ROM drive, which will be used to pass the Cloud-Init data to the VM.
qm set 9000 --ide2 local-lvm:cloudinit
(I am following this documentation: https://pve.proxmox.com/wiki/Cloud-Init_Support)
can you please help me understand what is the equivalent of the last two commands in the API calls?
Also, in the API tree I see:
PUT /api2/json/nodes/{node}/qemu/{vmid}/cloudinit (btw I think PUT & GET are reverted)
required: node, vmid; optional: new, old
can you please elaborate on new&old values?
Last edited: