Proxmox API - POST lxc - Error code 500

Cubix Gamer

New Member
Jun 17, 2022
10
0
1
Hello
I'm trying to get my code that sends api requests to work.
But I have this error:

Code:
Only root can pass arbitrary filesystem paths. at /usr/share/perl5/PVE/Storage.pm line 538.

I think it's a problem when I define rootfs in the request body but I'm not sure.

My body:
Code:
var body = {
          "ostemplate": os,
          "password": password,
          "memory": ram_in_mb,
          "rootfs": stockage_name + ":" + stockage_in_mb,
          "cores": number_processor_cores,
          "swap": "0",
          "vmid": nextid.data.data,
          "net0": "name=" + name_network_interface + ",ip6=auto,gw6=" + gw6 + ",gw=" + gw4 + ",ip=" + ipv4 + netmask_ipv4 + ",rate=" + network_rate_limit_in_mbs,
          "start": start_vps_when_create
}

stockage_name + ":" + stockage_in_mb
=
local-lvm:8192

I use root@pam

If someone can help me please
 
Your API request, specifically storage name does not match the expected string in the documentation:
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc

It expected volume: size:, etc. Your storagename:8192 is treated as an arbitrary path, it seems. You may be trying to create a volume in a single request, but I am not sure API allows for that based on the doc.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
please post the fully resolved actual body you are sending. local-lvm:8192 is valid syntax for rootfs and shouldn't trigger the check at all - it's how our GUI does it as well ;)
 
please post the fully resolved actual body you are sending. local-lvm:8192 is valid syntax for rootfs and shouldn't trigger the check at all - it's how our GUI does it as well ;)
My body:
Code:
{
     "ostemplate":"ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz",
     "password":"1ZY2i9VsD20shVVo",
     "memory":"1024",
     "rootfs":"locallvm:8192",
     "cores":"1",
     "swap":"0",
     "vmid":"109",
     "net0":"name=vmbr0,ip6=auto,gw6=2001:470:c8fb:ffff::,gw=10.0.0.1,ip=10.0.0.21/24,rate=100",
     "start":true
}
 
the 'ostemplate' is the culprit - you should provide a proper volume ID there as well, not just the filename..
 
  • Like
Reactions: bbgeek17