API equivalent of qm importdisk

vijay_m2

New Member
Nov 15, 2024
2
0
1
Currently I use `qm importdisk 9000 jammy-server-cloudimg-amd64-disk-kvm.iso <Volume Group>` during VM creation. Now would like to use VE API for the same. What is the equivalent for that command with API.
 
I know POST /api2/json/nodes/{node}/qemu's scsi<n> parameter has `import-from` option, but it didn't work for me. Can you please give an example on how to use it if it is the one we need to use.
 
I know POST /api2/json/nodes/{node}/qemu's scsi<n> parameter has `import-from` option, but it didn't work for me. Can you please give an example on how to use it if it is the one we need to use.
what exactly did not work for you?


an example parameter set would be

Code:
--scsi0 local:0,import-from=/path/to/imagefile

note that this can only be done as root@pam (since arbitrary paths can be given here) and there might be additional checks regarding format, etc.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!