[libvirt] LXC: autostart feature does set all interfaces to state up.

Richard Weinberger richard at nod.at
Thu Jul 4 20:45:45 UTC 2013


Hi,

Am 03.07.2013 12:04, schrieb Gao feng:
> Hi,
> On 07/01/2013 03:45 PM, Richard Weinberger wrote:
>> Hi!
>>
>> If you have multiple LXC containers with networking and the autostart feature enabled libvirtd fails to
>> up some veth interfaces on the host side.
>>
>> Most of the time only the first veth device is in state up, all others are down.
>>
>> Reproducing is easy.
>> 1. Define a few containers (5 in my case)
>> 2. Run "virsh autostart ..." on each one.
>> 3. stop/start libvirtd
>>
>> You'll observe that all containers are running, but "ip a" will report on the host
>> side that not all veth devices are up and are not usable within the containers.
>>
>> This is not userns related, just retested with libvirt of today.
> 
> I can not reproduce this problem on my test bed...

Strange.

> maybe you should wait some seconds for the starting of these containers.

Please see the attached shell script. Using it I'm able to trigger the issue on all of
my test machines.
run.sh creates six very minimal containers and enables autostart. Then it kills and restarts libvirtd.
After the script is done you'll see that only one or two veth devices are up.

On the over hand, if I start them manually using a command like this one:
for cfg in a b c d e f ; do /opt/libvirt/bin/virsh -c lxc:/// start test-$cfg ; done
All veths are always up.

Thanks,
//richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run.sh
Type: application/x-sh
Size: 1008 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130704/b77cc288/attachment-0001.sh>


More information about the libvir-list mailing list