Lxc start * - does something weird

I do not know if it is a bug or a feature…When you do lxc start * it tries to start file names as containers.
Which gives me idea to start all container that are files in a directory as a method to start working containers after after a reboot or other incident. My cluster does not seem to remember when containers where running before a reboot.
Anyway, it seems like a quirk, may be someone can explain it.

Most likely thats your shell expanding the filenames in your current directory as arguments to lxc start

If you were to list all containers with names start with c, you would do something like the following. You need to put quotes, because your shell (likely /bin/bash) will by default try to match filenames in the current directory and not container names. If you use some other special shell, then you do not need to use those quotes.

lxc list "c.*"

Note that you need to use c.* and not c*.

The issue however is that lxc start does not support such filters, therefore you cannot immediately select which containers to start.

You can use Unix commands to the same effect.
To get the list of all container names,

lxc list --format=json | jq --raw-output '.[].name'

To start them all, lxc start allows you to put all names in the command line.
Therefore, you can do the following,

lxc list --format=json | jq --raw-output '.[].name' | xargs lxc start

lxc start --all works too.

This is very useful… Consider making it part of lxc list command… something like lxc list -brief
However, you don’t get what I am saying… try lxc start * and see what it does, it is very different from lxc list *

Indeed. Thanks.

This is something that the developers should look into. That is, as you can use “web-.*” in lxc list, it should also work with lxc start?

Do note however that it is also common in Linux to use commands that perform minimal tasks, and join them together to perform a more complicated task.