close #1543: allow lxc low-level update via api

sinux-l5d

New Member
Jan 22, 2025
2
0
1
Hello,

I'm trying to fully automate my homelab with Proxmox and infra as code with Pulumi.

A missing feature is to allow the modification of low-level lxc settings via the API, as spotted in #1543.
Today, the GET config endpoint returns the current low-level configuration but don't allow to edit it (PUT).

I've read developers are to communicate via the mailing-list and sign the Contributor License Agreement. But before enrolling myself in a complex process (if it is?), I'd like to know if the following patch as a chance to be accepted.

Before patch:
Code:
$ curl -k -H 'Authorization: [RETRACTED]' 'https://192.168.1.199:8006/api2/json/nodes/homelab/lxc/100/config' -X PUT -H "Content-Type: application/json" -d '{"lxc":[["lxc.cgroup2.devices.allow","c 10:200 rwm"],["lxc.mount.entry","/dev/net dev/net none bind,create=dir"]]}'
{
  "errors": {
    "lxc": "property is not defined in schema and the schema does not allow additional properties"
  },
  "data": null
}

After patch:
Code:
$ curl -k -H 'Authorization: [RETRACTED]' 'https://192.168.1.199:8006/api2/json/nodes/homelab/lxc/100/config' -X PUT -H "Content-Type: application/json" -d '{"lxc":[["lxc.cgroup2.devices.allow","c 10:200 rwm"],["lxc.mount.entry","/dev/net dev/net none bind,create=dir"]]}'
{
  "data": null
}

$ curl -k -H 'Authorization: [RETRACTED]' 'https://192.168.1.199:8006/api2/json/nodes/homelab/lxc/100/config' | jq '.data.lxc'
[
  [
    "lxc.cgroup2.devices.allow",
    "c 10:200 rwm"
  ],
  [
    "lxc.mount.entry",
    "/dev/net dev/net none bind,create=dir"
  ]
]
Code:
# tail -2 /etc/pve/lxc/100.conf
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

You can find the git diff attached, for the repo pve-container.
 

Attachments

Hi!

Thanks for contributing to Proxmox VE, we really appreciate it!

I've read developers are to communicate via the mailing-list and sign the Contributor License Agreement. But before enrolling myself in a complex process (if it is?), I'd like to know if the following patch as a chance to be accepted.
Even though it is required to sign the contributor license agreement to get patches accepted, there is no requirement to sign anything for participating on the mailing list and on the Bugzilla.

As the community forum is meant for discussion, tutorials and questions about Proxmox products in general, it is better to move the discussion to
  • Bugzilla for discussing preliminary design decisions and informing interested parties about the current status, and
  • the mailing list (pve-devel in this case) to present a solution to the problem and get it reviewed.
So, I'd ask you kindly to resend this on the mailing list and adding a new entry to the Bugzilla report with the following template to get a proper review :)

Code:
A patch for this was sent in for review [0].
 
[0] https://lore.proxmox.com/pve-devel/...
 
Hello dakralex,

thanks for you reply. Is it mandatory to subscribe to pve-devel in order to send and receive emails ? Or is the subscription just to receive emails when one is sent to pve-devel@lists.proxmox.com ?

Sorry if it's a silly question, I'm not used to mailing lists...
 

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!