How to pass description as a parameter


Seems I’m failing to find a solution to a simple issue.

I’d like to pass the description in the initial creation of an object (container, storage, project) or to set it later with set but don’t know how to do it.

The only way I know as of now is to edit the configuration with lxc config edit or similar, that doesn’t really get along with scripting and automation.


If you want to use the “description” key looks like you might have to use the method described here;

Or you could use user.comment(I think a well used sub-key) to set it pragmatically without exporting, editing, and reimporting the YAML.

Might be a more modern way but doesn’t look like it at first glance :smile:

Thanks for the feedback @turtle0x1.

Didn0’t know aboyt user.commet, it could be an option, but it is not visible in a list statement.

What I’m looking for is something like

lxc <object> set description "My Nice Object"

That would generally work for all the objects: storages, networks, projects, profiles, containers…

Maybe an enhancement to be considered?

You could also use the API directly.


Is it possible to use the command line as well?

Only using How to pass description as a parameter - #3 by pmarini that you posted earlier.

I think its missing

lxc config set c1 description "wow"
Error: Invalid config: Unknown configuration key: description

Or right yes, silly me. You can only do it using the API or via lxc {object} edit

I have created a feature request:

1 Like