Use of variables in lxc.conf files

luison

Renowned Member
Feb 22, 2010
160
6
83
Spain
elsurexiste.com
We use to use VMID vars in OpenVZ conf files to define fixed mount points on all our containers.
We've been trying to achieve the same with LXC without success.
Something like:

Code:
mp2: /logs/$VMID,mp=/logs

I understand there are a number of Environment Variables available in LXC (https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html#lbBD) but we can't figure out if they are also available in LXC container conf file or how to use them if they are... $ [], etc

Also, we don't find a var that corresponds to the machine "number", although I understand that the old OpenVZ number now corresponds to the containers name.

Thanks.
 
this is not supported (but you can add/replace/delete config lines with "pct set", so you should be able to emulate it)