Hi guys,
On the LXD 3.8 release announcement I found:
CLI override of default project
Many users reported that interacting with multiple projects can be tedious due to having to constantly use lxc project switch
to switch the client between projects. This is especially true when all you want to do in a particular project is a simple action like starting a container.
LXD 3.8 now has a --project
option available throughout the command line client, which lets you override the project for a particular operation.
However, lxc list –-project project-name returns an empty list
Tested on 3.16
stgraber
(Stéphane Graber)
August 31, 2019, 5:38am
2
stgraber@castiana:~$ lxc project create blah -c features.profiles=false -c features.images=false
Project blah created
stgraber@castiana:~$ lxc launch ubuntu:18.04 c1 --project blah
Creating c1
Starting c1
stgraber@castiana:~$ lxc list
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| centos3 | STOPPED | | | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| centos4 | STOPPED | | | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| keybase | RUNNING | 10.166.11.214 (eth0) | 2001:470:b368:4242:216:3eff:fea6:11f0 (eth0) | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| snapcraft | STOPPED | | | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| steam | STOPPED | | | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| ups-monitor | STOPPED | | | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
| zerotier | STOPPED | | | PERSISTENT | 0 |
+-------------+---------+----------------------+----------------------------------------------+------------+-----------+
stgraber@castiana:~$ lxc list --project blah
+------+---------+----------------------+----------------------------------------------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+----------------------+----------------------------------------------+------------+-----------+
| c1 | RUNNING | 10.166.11.246 (eth0) | 2001:470:b368:4242:216:3eff:feaa:8095 (eth0) | PERSISTENT | 0 |
+------+---------+----------------------+----------------------------------------------+------------+-----------+
stgraber@castiana:~$
Thank you @stgraber It is working today.
No idea what I did wrong yesterday, but i tried several times from different projects and it was returning empty lists from all projects.