Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread Fajar A. Nugraha
On Thu, May 3, 2018 at 8:09 PM, David Favor  wrote:
> This is tricky... Netplan forced abuse is similar to systemd... No one
> likes systemd + it works abysmally + it was crammed down everyone's
> throat.
>
> It appears Netplan will be the same.
>
> Eventually some update will likely wipe out old networking + force upgrade
> to Netplan.

From what I can tell so far, netplan is similar to network-manager, in
the sense that both can manage network, and both can be uninstalled
just fine (obviously with some functionality loss, but perfectly fine
for minimal server install running zfs + lxd). It was that way in
16.04 (the network-manager part, that is), and it's that way currently
in 18.04.

I find it hard to see ubuntu breaking that functionality on LTS
release. On the next releases, perhaps.

Of course, if you have a reference that says otherwise, do share the link.


>>> LXD via SNAP (which is only LXD install option on Bionic).
>>
>>
>> Not true. It's not the ONLY option.
>>
>> # apt policy lxd
>> lxd:
>>   Installed: 3.0.0-0ubuntu4
>>   Candidate: 3.0.0-0ubuntu4
>>   Version table:
>>  *** 3.0.0-0ubuntu4 500
>> 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
>> 100 /var/lib/dpkg/status
>>
>
> Currently APT packages are being maintained for backwards compatibility.
>
> And be aware. The APT packages no longer receive updates, so for example
> the patches produced this week fixing many LXD bugs will only be available
> to you, if you switch to SNAP.
>
> LXD 3.0 initial (no patches) is the last APT supported LXD release.
>
> This is covered somewhere on the LXD site.

Is there a link?

I know of the PPA deprecation (not ubuntu official repository, but the
ppa), i.e. 
https://www.mail-archive.com/lxc-users@lists.linuxcontainers.org/msg07938.html

https://linuxcontainers.org/lxd/getting-started-cli/ says apt with official repo
https://help.ubuntu.com/lts/serverguide/lxd.html also says apt
(although to be fair, the page hierarcy starts with 'ubuntu 18.04',
but the page content still has 16.04)

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread David Favor

Fajar A. Nugraha wrote:

On Thu, May 3, 2018 at 7:57 PM, Tomasz Chmielewski  wrote:

Indeed, I can confirm it's some netplan-related issue with
/etc/netplan/10-lxc.yaml.

Working version for bionic containers set up before 2018-May-02:

network:
  ethernets:
eth0: {dhcp4: true}
  version: 2



Broken version for bionic containers set up after 2018-May-02:

network:
  ethernets:
eth0: {dhcp4: true}
version: 2


Please note that the broken one has no indentation (two spaces) before
"version: 2", this is the only thing that differs and which breaks DHCPv4.


Ah, sorry, I was not thorough enough when comparing my resulting
/etc/netplan/10-lxc.yaml. It looks like this now:

# cat /etc/netplan/10-lxc.yaml
network:
  version: 2
  ethernets:
eth0: {dhcp4: true}

So the new image update apparently fixed the bug.



This must be some custom Netplan setup.

This file is best generated via cloud-init or subtle trouble will likely ensue.

Default cloud-init generated file is...

lxd: net10-template-ubuntu-bionic-lamp # cat 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
eth0:
dhcp4: true

Which is identical to your file, it's just that using a /etc/netplan/10-lxc.yaml
may conflict with future cloud-init updates.

Be sure if you do use a custom file, you follow the 50-cloud-init.yaml 
instructions
to disable cloud-init generating it's own file, which is where conflicts may 
arise
in the future.
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread David Favor

Fajar A. Nugraha wrote:

On Thu, May 3, 2018 at 10:14 AM, David Favor  wrote:

Be aware there is a bug in Bionic packaging, so if you upgrade
machine level OS from any previous OS version to Bionic, LXD
networking becomes broken... so badly... no Ubuntu or LXD developer
has figured out a fix.


Wait, what?

I've upgraded three physical machines (and a custom AWS AMI) from
16.04 (somewhat minimal install, with lxd) to 18.04. All have lxdbr0
working fine. Of course that also means I don't have netplan installed
(since 16.04 doesn't have it, and the upgrade process doesn't install
it), which is perfect for me. I like old fashioned
/etc/network/interfaces.d/*.cfg.


This is tricky... Netplan forced abuse is similar to systemd... No one
likes systemd + it works abysmally + it was crammed down everyone's
throat.

It appears Netplan will be the same.

Eventually some update will likely wipe out old networking + force upgrade
to Netplan.

To avoid the side effects, likely best to just stop/move all your containers
to a new machine. Then do a fresh Bionic install. Since Bionic is LTS, you
can run Bionic for 5 years.

After you have your fresh Bionic install working, then just move all
your containers back.

Note: Be sure you read text of this bug before starting this process:

   https://github.com/lxc/lxd/issues/4522

   Which includes a fix for maintaining correct uid/gid mapping
   when moving containers between machines.

   In short, you must actually start/stop containers on all machines
   where containers are moved, else uid/gid mapping get lost.

This might not apply if you've done a complete remove of APT LXD + then
done a fresh install of LXD via SNAP...

   On both machines.


Not sure about 17.04/17.10 to 18.04 though.


LXD via SNAP (which is only LXD install option on Bionic).


Not true. It's not the ONLY option.

# apt policy lxd
lxd:
  Installed: 3.0.0-0ubuntu4
  Candidate: 3.0.0-0ubuntu4
  Version table:
 *** 3.0.0-0ubuntu4 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status



Currently APT packages are being maintained for backwards compatibility.

And be aware. The APT packages no longer receive updates, so for example
the patches produced this week fixing many LXD bugs will only be available
to you, if you switch to SNAP.

LXD 3.0 initial (no patches) is the last APT supported LXD release.

This is covered somewhere on the LXD site.

I host 100s of high traffic, high speed, WordPress sites, so having all
LXD updates (bug fixes) is essential.

If updates aren't essential for you, running LXD which will never update
might be acceptable.
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread Tomasz Chmielewski

On 2018-05-03 21:57, Fajar A. Nugraha wrote:



I can confirm this. Seeing the same issue.


BTW. It's the /etc/netplan/10-lxc.yaml

Not working (current) version:
network:
  ethernets:
eth0: {dhcp4: true}
version: 2


Working version (for me):
network:
  version: 2
  ethernets:
eth0:
  dhcp4: true



Works for me. Both with images:ubuntu/bionic (which has
/etc/netplan/10-lxc.yaml, identical to your 'not working' one) and
ubuntu:bionic (which has /etc/netplan/50-cloud-init.yaml).

Then again the images:ubuntu/bionic one has '20180503_11:06' in its
description, so it's possible that the bug was fixed recently.


Indeed, the bug seems now fixed in the bionic image and new containers 
are getting IPv4 via DHCP again:


|   | 88a22ac497ad | no | Ubuntu bionic amd64 (20180503_03:49)   
   | x86_64 | 104.71MB | May 3, 2018 at 8:51am (UTC)  |




This one was producing broken /etc/netplan/10-lxc.yaml:

|   | 87b5c0fec8ff | no | Ubuntu bionic amd64 (20180502_09:49) | 
x86_64 | 118.15MB | May 3, 2018 at 2:39am (UTC) |



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

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread Fajar A. Nugraha
On Thu, May 3, 2018 at 7:57 PM, Tomasz Chmielewski  wrote:
> Indeed, I can confirm it's some netplan-related issue with
> /etc/netplan/10-lxc.yaml.
>
> Working version for bionic containers set up before 2018-May-02:
>
> network:
>   ethernets:
> eth0: {dhcp4: true}
>   version: 2
>
>
>
> Broken version for bionic containers set up after 2018-May-02:
>
> network:
>   ethernets:
> eth0: {dhcp4: true}
> version: 2
>
>
> Please note that the broken one has no indentation (two spaces) before
> "version: 2", this is the only thing that differs and which breaks DHCPv4.

Ah, sorry, I was not thorough enough when comparing my resulting
/etc/netplan/10-lxc.yaml. It looks like this now:

# cat /etc/netplan/10-lxc.yaml
network:
  version: 2
  ethernets:
eth0: {dhcp4: true}

So the new image update apparently fixed the bug.

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread Tomasz Chmielewski

On 2018-05-03 15:28, Kees Bos wrote:



I can confirm this. Seeing the same issue.


BTW. It's the /etc/netplan/10-lxc.yaml

Not working (current) version:
network:
  ethernets:
eth0: {dhcp4: true}
version: 2


Working version (for me):
network:
  version: 2
  ethernets:
eth0:
  dhcp4: true


Indeed, I can confirm it's some netplan-related issue with 
/etc/netplan/10-lxc.yaml.


Working version for bionic containers set up before 2018-May-02:

network:
  ethernets:
eth0: {dhcp4: true}
  version: 2



Broken version for bionic containers set up after 2018-May-02:

network:
  ethernets:
eth0: {dhcp4: true}
version: 2


Please note that the broken one has no indentation (two spaces) before 
"version: 2", this is the only thing that differs and which breaks 
DHCPv4.



What's responsible for this?


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

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread Fajar A. Nugraha
On Thu, May 3, 2018 at 1:28 PM, Kees Bos  wrote:
> On Thu, 2018-05-03 at 08:09 +0200, Kees Bos wrote:
>> On Thu, 2018-05-03 at 12:58 +0900, Tomasz Chmielewski wrote:
>> >
>> > Reproducing is easy:
>> >
>> > # lxc launch images:ubuntu/bionic/amd64 bionic-broken-dhcp
>> >
>> >
>> > Then wait a few secs until it starts - "lxc list" will show it has
>> > IPv6
>> > address (if your bridge was configured to provide IPv6), but not
>> > IPv4
>> > (and you can confirm by doing "lxc shell", too):
>> >
>> > # lxc list
>> >
>> >
>>
>> I can confirm this. Seeing the same issue.
>
> BTW. It's the /etc/netplan/10-lxc.yaml
>
> Not working (current) version:
> network:
>   ethernets:
> eth0: {dhcp4: true}
> version: 2
>
>
> Working version (for me):
> network:
>   version: 2
>   ethernets:
> eth0:
>   dhcp4: true


Works for me. Both with images:ubuntu/bionic (which has
/etc/netplan/10-lxc.yaml, identical to your 'not working' one) and
ubuntu:bionic (which has /etc/netplan/50-cloud-init.yaml).

Then again the images:ubuntu/bionic one has '20180503_11:06' in its
description, so it's possible that the bug was fixed recently.

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] bionic image not getting IPv4 address

2018-05-03 Thread Fajar A. Nugraha
On Thu, May 3, 2018 at 10:14 AM, David Favor  wrote:
> Be aware there is a bug in Bionic packaging, so if you upgrade
> machine level OS from any previous OS version to Bionic, LXD
> networking becomes broken... so badly... no Ubuntu or LXD developer
> has figured out a fix.

Wait, what?

I've upgraded three physical machines (and a custom AWS AMI) from
16.04 (somewhat minimal install, with lxd) to 18.04. All have lxdbr0
working fine. Of course that also means I don't have netplan installed
(since 16.04 doesn't have it, and the upgrade process doesn't install
it), which is perfect for me. I like old fashioned
/etc/network/interfaces.d/*.cfg.


Not sure about 17.04/17.10 to 18.04 though.

> LXD via SNAP (which is only LXD install option on Bionic).

Not true. It's not the ONLY option.

# apt policy lxd
lxd:
  Installed: 3.0.0-0ubuntu4
  Candidate: 3.0.0-0ubuntu4
  Version table:
 *** 3.0.0-0ubuntu4 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users