I would like to edit LXD profiles from the command line. This is done by lxc profile set
:
lxc profile get <profile> <key>
Get profile configuration.
lxc profile set <profile> <key> <value>
Set profile configuration.
What is the expected format of the <key> <value>
? The output from lxc show profile
suggests a dotted structure:
root@ubuntu ~# lxc profile show zoneminder
name: zoneminder
config:
raw.lxc: lxc.aa_allow_incomplete=1
description: ""
devices:
eth0:
name: eth0
nictype: bridged
parent: zoneminder0
type: nic
but I did not manage to get
anything (not to mention - set
). I tried various incantations (as an example lxc profile get zoneminder name
, lxc profile get zoneminder lxc.name
, ... to get the value of name
above) but they all return nothing.
The basic syntax to get values is:
However, to get something, you need to set it first. It appears you can only set known key values, i.e. those that actively mean something to lxd:
... and then you can retrieve it:
Devices appear to be special; the regular get/set access the "config" sub-field of the profile, but you need to use special commands to manipulate devices: