Creation of LXC via API (CEPH) without precreating vm storage

Zernox

New Member
Jan 8, 2026
2
0
1
I want to create a LXC or VM via API. Currently working on LXC. BUT I noticed first of all the api doc is plain... bad imo . Anyways.
I NEED to add a rootfs for lxc because ofc I do?! And I am using CEPH for my cluster. So I want to create for example a disk of 1G on Ceph Storage CL1.

Can I do that WITHOUT creating a usable disk with rbd first?! Do not understand the thought behind it. I want to give the API <storageID>:<size> why is that not possible?
Or am I overlooking something?

Current rootfs is rootfs="volume=CL1_NVME:,size=1G when I enter a name like vm-123-disk-0 I get file not found because well... IT DOES NOT EXIST.
I do not see the point in creating in manually or via ssh or ceph api is there a smart way I did not find yet?
 
Hi,

you want the <storagename>:<size-in-GB> syntax, i.e. pct create 1000 local:vztmpl/some-template.tar -rootfs local-lvm:10 to create the root filesystem on local-lvm with 10GB in size.
See also https://pve.proxmox.com/pve-docs/pct.1.html#_storage_backed_mount_points, or documentation of -mp.

Documentation can definitely improved here, adding a hint for this syntax to the -rootfs option too, much like is present for the -mp option.
 
Thank you SOOO much.
It would help A LOT if the api would showcase some example requests or values...
I failed because I thought I need to add the size so GB or G for the size. It now works. But examples would help big time.