Ubuntu 17.10 and contextualization


I recently tried to boot the official cloud-image from Ubuntu for 17.10 version and I think there are some problems with the Opennebula contextualization packages. Few issues I found:

  • 17.10 uses Netplan and the interfaces come with DHCP activated. Besides uninstalling cloud-init, I had to manually edit some config file in netplan to set the interface to static config (no dhcp)
  • 17.10 uses systemd-resolvd for name resolution, if you still want to use it, the DNS server has to be configured in a config file of systemd-resolvd (not in resolv.conf that is pointing to

Is there any plan to include support for ubuntu 17.10 in the contextualization packages?
If you could, please, update also the customization scripts (how to deinstall properly cloud-init (that is becoming harder day by day :(), etc.) for the official cloud-images, it would be awesome.



Hi @apoz,

latest Linux contextualization packages enforce the ifupdown package, so that it works as you were used to. Packages are available on GH https://github.com/OpenNebula/addon-context-linux/releases/tag/v5.4.2, steps to remove cloud-init and install the contextualization packages are described here http://docs.opennebula.org/5.4/operation/vm_setup/kvm.html#id3 .

Best regards,

Hi Vlastimil,

the problem I found was not about ifupdown not installed by default (cool you included as a dependency for the context package, thanks!), but with some side effects of the new stuff in that Ubuntu version. Let me try to explain the 2 things I found that come to my head (I did the apt-get purge -y cloud-init before installing the contextualization packages):

  • This 17.10 seems to use Netplan, and there’s this file (even after purging cloud-init) that forces the interfaces to use DHCP intead the static configuration required by context management. I had to change that setting manually, otherwise it takes a lot to boot (until dhcp times-out, and I don’t remember if it defaulted to static aftewards…)

    user@ubuntu:/etc/netplan$ 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}
    version: 2
    dhcp4: true
    macaddress: 02:00:0a:5f:54:72
    set-name: ens3

  • For the DNS configuration to be taken into account (and still use systemd-resolved, may be I coud’ve uninstalled that package and avoid using it), I had to include the DNS server in the following file:
    sysadmin@ubuntu:/etc/systemd$ cat resolved.conf
    # This file is part of systemd.
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2.1 of the License, or
    # (at your option) any later version.
    # Entries in this file show the compile time defaults.
    # You can change settings by editing this file.
    # Defaults can be restored by simply deleting this file.
    # See resolved.conf(5) for details

I think just purging cloud-init and installing the contextualization package is not enough to have the cloud-image of Ubuntu 17.10.




understand, it’s usually better to contextualize 3rd party image without actually letting it boot, e.g. via libguestfs tools. I have added Netplan configurations cleanup into the package postinstall script (
Cleanup any Netplan configuration · OpenNebula/addon-context-linux@8f74136 · GitHub). Thank you.

Hmm, I’m not sure about that. /etc/resolv.conf is managed by systemd-resolved as a symlink somewhere into it’s location. But, the DNS contextualization breaks this symlink and still manages the configuration on it’s own (Unlink systemd-resolved symlink /etc/resolv.conf · OpenNebula/addon-context-linux@7dad8bc · GitHub). So, the configuration set by the ONE contextualization should be used, no matter if systemd-resolved is installed/running. Am I wrong?

Thank you,


about the DNS thing, I’m not sure (you’re the expert :smiley:). I made the dns change when I was having the other problem, so your probably right.

Great job, thanks!