Re: [lxc-users] LXD on EC2/AWS - containers not getting IP addresses?

2017-03-22 Thread Stéphane Graber
On Thu, Mar 23, 2017 at 01:09:05PM +0900, Tomasz Chmielewski wrote:
> On 2017-03-23 13:00, Tomasz Chmielewski wrote:
> > I've just launched a Ubuntu 16.04 instance on EC2.
> > 
> > Unfortunately, LXD containers are not getting an IP address.
> 
> (...)
> 
> > What step did I miss?
> 
> I see that I've run "dpkg-reconfigure -p medium lxd" too late (after the
> container was created), and because of this eth0 was set to manual (in
> /etc/network/interfaces.d/):
> 
> 
> auto eth0
> iface eth0 inet manual
> 
> 
> New containers have it properly set to dhcp.
> 
> 
> So - problem solved! :)

Ah indeed, that would be another problem :)

Glad you figured it out.

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com


signature.asc
Description: PGP signature
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] LXD on EC2/AWS - containers not getting IP addresses?

2017-03-22 Thread Tomasz Chmielewski

On 2017-03-23 13:00, Tomasz Chmielewski wrote:

I've just launched a Ubuntu 16.04 instance on EC2.

Unfortunately, LXD containers are not getting an IP address.


(...)


What step did I miss?


I see that I've run "dpkg-reconfigure -p medium lxd" too late (after the 
container was created), and because of this eth0 was set to manual (in 
/etc/network/interfaces.d/):



auto eth0
iface eth0 inet manual


New containers have it properly set to dhcp.


So - problem solved! :)


Tomasz Chmielewski
https://lxadm.com
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] LXD on EC2/AWS - containers not getting IP addresses?

2017-03-22 Thread Stéphane Graber
On Thu, Mar 23, 2017 at 01:00:00PM +0900, Tomasz Chmielewski wrote:
> I've just launched a Ubuntu 16.04 instance on EC2.
> 
> Unfortunately, LXD containers are not getting an IP address.
> 
> 
> # lxc launch ubuntu:16.04 website01
> 
> # lxc list
> +---+-+--+--++---+
> |   NAME|  STATE  | IPV4 | IPV6 |TYPE| SNAPSHOTS |
> +---+-+--+--++---+
> | website01 | RUNNING |  |  | PERSISTENT | 0 |
> +---+-+--+--++---+
> 
> 
> # dpkg-reconfigure -p medium lxd
> (set IPv4 network)
> 
> 
> # reboot
> 
> 
> Still no IP address in the container:
> 
> # lxc list
> +---+-+--+--++---+
> |   NAME|  STATE  | IPV4 | IPV6 |TYPE| SNAPSHOTS |
> +---+-+--+--++---+
> | website01 | RUNNING |  |  | PERSISTENT | 0 |
> +---+-+--+--++---+
> 
> 
> 
> dhclient is running:
> 
> root  1023  0.0  0.0  16124   864 ?Ss   03:50   0:00
> /sbin/dhclient -1 -v -pf /run/dhclient.eth0.pid -lf
> /var/lib/dhcp/dhclient.eth0.leases -I -df
> /var/lib/dhcp/dhclient6.eth0.leases eth0
> 
> 
> lxdbr0 is present:
> 
> lxdbr0Link encap:Ethernet  HWaddr fe:3e:3b:09:3d:e4
>   inet addr:10.76.6.1  Bcast:0.0.0.0  Mask:255.255.255.0
>   inet6 addr: fe80::8091:8dff:fe30:bfb3/64 Scope:Link
>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>   RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000
>   RX bytes:536 (536.0 B)  TX bytes:570 (570.0 B)
> 
> 
> # brctl show
> bridge name bridge id   STP enabled interfaces
> lxdbr0  8000.fe3e3b093de4   no  vethHHJNCH
> 
> # dpkg -l|grep lxd
> ii  lxd  2.0.9-0ubuntu1~16.04.2
> amd64Container hypervisor based on LXC - daemon
> ii  lxd-client   2.0.9-0ubuntu1~16.04.2
> amd64Container hypervisor based on LXC - client
> 
> 
> What step did I miss?

A somewhat common mistake which leads to the behavior you described is
when your chosen subnet doesn't match your chose DHCP range.

"ps aux | grep dnsmasq" on the host would confirm if that's the case.

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com


signature.asc
Description: PGP signature
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

[lxc-users] LXD on EC2/AWS - containers not getting IP addresses?

2017-03-22 Thread Tomasz Chmielewski

I've just launched a Ubuntu 16.04 instance on EC2.

Unfortunately, LXD containers are not getting an IP address.


# lxc launch ubuntu:16.04 website01

# lxc list
+---+-+--+--++---+
|   NAME|  STATE  | IPV4 | IPV6 |TYPE| SNAPSHOTS |
+---+-+--+--++---+
| website01 | RUNNING |  |  | PERSISTENT | 0 |
+---+-+--+--++---+


# dpkg-reconfigure -p medium lxd
(set IPv4 network)


# reboot


Still no IP address in the container:

# lxc list
+---+-+--+--++---+
|   NAME|  STATE  | IPV4 | IPV6 |TYPE| SNAPSHOTS |
+---+-+--+--++---+
| website01 | RUNNING |  |  | PERSISTENT | 0 |
+---+-+--+--++---+



dhclient is running:

root  1023  0.0  0.0  16124   864 ?Ss   03:50   0:00 
/sbin/dhclient -1 -v -pf /run/dhclient.eth0.pid -lf 
/var/lib/dhcp/dhclient.eth0.leases -I -df 
/var/lib/dhcp/dhclient6.eth0.leases eth0



lxdbr0 is present:

lxdbr0Link encap:Ethernet  HWaddr fe:3e:3b:09:3d:e4
  inet addr:10.76.6.1  Bcast:0.0.0.0  Mask:255.255.255.0
  inet6 addr: fe80::8091:8dff:fe30:bfb3/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:8 errors:0 dropped:0 overruns:0 frame:0
  TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:536 (536.0 B)  TX bytes:570 (570.0 B)


# brctl show
bridge name bridge id   STP enabled interfaces
lxdbr0  8000.fe3e3b093de4   no  vethHHJNCH

# dpkg -l|grep lxd
ii  lxd  2.0.9-0ubuntu1~16.04.2 
amd64Container hypervisor based on LXC - daemon
ii  lxd-client   2.0.9-0ubuntu1~16.04.2 
amd64Container hypervisor based on LXC - client



What step did I miss?


Tomasz Chmielewski
https://lxadm.com
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users