Can we change 'lxc list' defaults?

I think the answer is “no”, but just in case I’m missing something, can we change the defaults (maybe via an environment variable or configuration file) of “lxc list”? Right now, I just keep recalling the old version from command history, but when I lose history, I need to recreate it and it’s annoying. :wink:

And, just for the reasoning, I am running multiple BOSH instances (with multiple VMs) across multiple projects and the “customization” ability would make it easier to look at things without getting distracted by the minutia…

$ lxc list -c nsed4tS --all-projects
+-----------------------------------------+---------+-----------+-----------------+-------------------+-----------------+-----------+
|                  NAME                   |  STATE  |  PROJECT  |   DESCRIPTION   |       IPV4        |      TYPE       | SNAPSHOTS |
+-----------------------------------------+---------+-----------+-----------------+-------------------+-----------------+-----------+
| vm-04a11c69-1510-4171-68e1-8d9c7add4ad7 | RUNNING | hydradev  | bosh/0          | 10.0.5.4 (eth0)   | VIRTUAL-MACHINE | 0         |
+-----------------------------------------+---------+-----------+-----------------+-------------------+-----------------+-----------+
| vm-64b77a67-d11a-4d4e-5e69-a12b2414b1dd | RUNNING | hydraprod | bosh/0          | 10.0.4.4 (eth0)   | VIRTUAL-MACHINE | 0         |
+-----------------------------------------+---------+-----------+-----------------+-------------------+-----------------+-----------+
... etc...

Looking at the listing, I just realized I forgot to have the host in there. See?! :joy:

Thanks!
-Rob

I doubt we can alter lxc list’s default behavior easily but you might find it useful to define a custom alias:

lxc alias add la 'list -c nsed4tS --all-projects @ARGS@'

This should do what you want… you just need to get used to typing lxc la :wink:

1 Like

What type of magic is that? I didn’t realize that even existed!
-Rob

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.