Not being able to start new containers

Hi there,

I am facing a strange issue when creating lxc container. The containers are being created, but they doesn’t start, and sometime when they do start, they don’t get an IP. And there are no warning/error messages.

This is how I created the container:
lxc launch ubuntu:22.04 newserver

And this is the lxc list:

+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
|        NAME         |  STATE  |        IPV4         |                     IPV6                      |    TYPE    | SNAPSHOTS |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| angelo              | RUNNING | 10.77.37.178 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe93:49df (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| configurationserver | RUNNING | 10.77.37.181 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe2c:4640 (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| localstorageserver  | RUNNING | 10.77.37.234 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe46:eccb (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| messagebroker       | RUNNING | 10.77.37.180 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe56:461c (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| newserver           | STOPPED |                     |                                               | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| recorderserver      | RUNNING | 10.77.37.127 (eth0) | fd42:29c9:b4b7:a028:216:3eff:feda:1c6a (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| timeserver          | RUNNING | 10.77.37.119 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe96:759c (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+

When I tried to stop one of the running containers and started the new container, everything works fine:

ubuntu@tegra-vm:~/fmello$ lxc stop angelo
ubuntu@tegra-vm:~/fmello$ lxc start newserver
ubuntu@tegra-vm:~/fmello$ lxc list
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
|        NAME         |  STATE  |        IPV4         |                     IPV6                      |    TYPE    | SNAPSHOTS |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| angelo              | STOPPED |                     |                                               | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| configurationserver | RUNNING | 10.77.37.181 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe2c:4640 (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| localstorageserver  | RUNNING | 10.77.37.234 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe46:eccb (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| messagebroker       | RUNNING | 10.77.37.180 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe56:461c (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| newserver           | RUNNING | 10.77.37.224 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe6b:aa41 (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| recorderserver      | RUNNING | 10.77.37.127 (eth0) | fd42:29c9:b4b7:a028:216:3eff:feda:1c6a (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| timeserver          | RUNNING | 10.77.37.119 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe96:759c (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+

Seems like a limit of running instances. Does anyone has a tip of what might be happening?

Thanks in advance,

Flávio Mello

Hi @Flavio_Luis_de_Mello ,
Can you try with lxc launch images:ubuntu/22.04 newserver
P.S. if you have any limit for project it warns you.
Regards.

I worked, but I didn’t understand why. What’s the difference this and lxc launch ubuntu:22.04 newserver

ubuntu@tegra-vm:~$ lxc launch images:ubuntu/22.04 newserver
Creating newserver
Starting newserver                          
ubuntu@tegra-vm:~$ lxc list
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
|        NAME         |  STATE  |        IPV4         |                     IPV6                      |    TYPE    | SNAPSHOTS |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| angelo              | RUNNING | 10.77.37.178 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe93:49df (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| configurationserver | RUNNING | 10.77.37.181 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe2c:4640 (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| localstorageserver  | RUNNING | 10.77.37.234 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe46:eccb (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| messagebroker       | RUNNING | 10.77.37.180 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe56:461c (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| newserver           | RUNNING | 10.77.37.122 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe3f:1295 (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| recorderserver      | RUNNING | 10.77.37.127 (eth0) | fd42:29c9:b4b7:a028:216:3eff:feda:1c6a (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+
| timeserver          | RUNNING | 10.77.37.119 (eth0) | fd42:29c9:b4b7:a028:216:3eff:fe96:759c (eth0) | PERSISTENT | 0         |
+---------------------+---------+---------------------+-----------------------------------------------+------------+-----------+

I have tested with the version 20.04 and get ip without problem, maybe 22.04 official ubuntu image has problem, you can trigger by hand if you want 22.04 image, in the container dhclient eth0
Regards.

Check your host’s firewall too:

I have tested firewall, and it is disabled. The behavior is somewhat erratic. Sometimes it starts and gets an IPv4, sometimes it doesn’t. There were 2 times that the container didn’t started. Is it possible that the hardware resource are being a bottle neck? Too many containers (10) for few processors (4) and RAM (16GB)?