[lxc-users] LXD Newb questions

Will Dennis wdennis at nec-labs.com
Wed Mar 16 02:06:17 UTC 2016


On Tue Mar 15 22:38:23 UTC 2016 Tycho Andersen wrote:
> Depending on what you mean by management, yes. LXD has the concept of
> remotes, where you can start/stop/copy images from/push files to/etc.
> The CLI experience is designed to be very close to git remotes.

What I'd like to see is a cross-machine container inventory...

For instance, I now have two machines running LXD, one being ‘xenial-01’ and the other being ‘xenial-02’. I have added the remote ‘xenial-01’ on ‘xenial-02’, so that a “lxc remote list” produces:

+-----------------+------------------------------------------+---------------+--------+--------+
|      NAME       |                   URL                    |   PROTOCOL    | PUBLIC | STATIC |
+-----------------+------------------------------------------+---------------+--------+--------+
| images          | https://images.linuxcontainers.org       | lxd           | YES    | NO     |
+-----------------+------------------------------------------+---------------+--------+--------+
| local (default) | unix://                                  | lxd           | NO     | YES    |
+-----------------+------------------------------------------+---------------+--------+--------+
| ubuntu          | https://cloud-images.ubuntu.com/releases | simplestreams | YES    | YES    |
+-----------------+------------------------------------------+---------------+--------+--------+
| ubuntu-daily    | https://cloud-images.ubuntu.com/daily    | simplestreams | YES    | YES    |
+-----------------+------------------------------------------+---------------+--------+--------+
| xenial-01       | https://xenial-01:3146                   | lxd           | NO     | NO     |
+-----------------+------------------------------------------+---------------+--------+--------+

If I list the containers on each of my LXD hosts, I see the following:

root at xenial-02:~# lxc list
+----------+---------+-------------------+------+------------+-----------+
|   NAME   |  STATE  |       IPV4        | IPV6 |    TYPE    | SNAPSHOTS |
+----------+---------+-------------------+------+------------+-----------+
| u1404-01 | RUNNING | 10.0.3.221 (eth0) |      | PERSISTENT | 0         |
+----------+---------+-------------------+------+------------+-----------+
| u1404-02 | RUNNING | 10.0.3.75 (eth0)  |      | PERSISTENT | 0         |
+----------+---------+-------------------+------+------------+-----------+
root at xenial-02:~# lxc list xenial-01:
+----------+---------+-------------------+------+------------+-----------+
|   NAME   |  STATE  |       IPV4        | IPV6 |    TYPE    | SNAPSHOTS |
+----------+---------+-------------------+------+------------+-----------+
| u1404-03 | RUNNING | 10.0.3.134 (eth0) |      | PERSISTENT | 0         |
+----------+---------+-------------------+------+------------+-----------+

What I’m looking for (for a container listing anyways) would be something like:

root at xenial-02:~# lxc list all
+-----------+----------+---------+-------------------+------+------------+-----------+
|   HOST    |   NAME   |  STATE  |       IPV4        | IPV6 |    TYPE    | SNAPSHOTS |
+-----------+----------+---------+-------------------+------+------------+-----------+
| xenial-01 | u1404-03 | RUNNING | 10.0.3.134 (eth0) |      | PERSISTENT | 0         |
+-----------+----------+---------+-------------------+------+------------+-----------+
| xenial-02 | u1404-01 | RUNNING | 10.0.3.221 (eth0) |      | PERSISTENT | 0         |
+-----------+----------+---------+-------------------+------+------------+-----------+
| xenial-02 | u1404-02 | RUNNING | 10.0.3.75 (eth0)  |      | PERSISTENT | 0         |
+-----------+----------+---------+-------------------+------+------------+-----------+

So do you have to query the hosts one by one, or is there something to give you a holistic view of all your container hosts and containers on them?



More information about the lxc-users mailing list