[one-dev] New repository for context packages

Javier Fontan jfontan at opennebula.org
Tue Jul 8 09:19:43 PDT 2014


Hello,

TL;DR: Some ideas to improve the context packages. We need your
feedback and help with them!

I have recently moved the context packages source files from the main
repository to a new one [1]. I think this will make easier to
contribute to it and have out of band releases that addresses problems
and supports more distributions.

There are some changes that we have been thinking about for some time
and I think now is a good time to let you know them and maybe work on
them before 4.8.


Interface names and ifconfig
============================

Right now the network configuration scripts rely on ifconfig and the
assumption that the interfaces are called eth<n>. With recent
distributions it no longer works (for example CentOS 7 or Fedora 20).
ifconfig is deprecated (or has a different output than older versions)
and there is also the Predictable Network Interface Names [2]. This
means that a new system is needed to get information from the
interfaces and cope with the new naming scheme.

To get information about the interfaces we can start using "ip"
command or use some other method you my know. Whatever we use we have
to move from "ifconfig".

For naming I would like to continue to use the context generated so it
is backwards compatible, that is ETH0_IP, etc. My idea is to associate
the variables with the correct interface by looking up its MAC
address. The context generated has a ETH0_MAC with the MAC address
that OpenNebula gave to the interface, this way we can check which
interface has it. It may give problems with multiple interfaces with
the same MAC but I don't think this is a common case in OpenNebula
VMs.


Interface IP from MAC address
=============================

You may know that by default OpenNebula generates the MAC address
using a prefix and the IP address assigned to it (PREFIX+IP). This is
nice as we could use the MAC address to set ebtables filters and such.
It was also used to configure the network when the contextualization
file was not present.

I believe we should drop this system from the context packages:

* context configures more things than just network
* the method adds complexity to the network configuration scripts
* it gives a false working state belief (gateway is not the one I'd configured)

I'm not sure if someone is still using this system. Maybe a better way
is to just disable it by default but I think it is better to take out
the code [3].


Init system
===========

The context packages use the old SysV system to start. It worked more
or less fine but we are already having problems with some
distributions that just don't run it properly or at the right time and
it seems that everyone is moving to systemd. Maybe a new set of start
scripts should be tailored for each distro (and sometimes version).


Separate distribution scripts
=============================

The source for the context packages was made with the idea of reusing
the scripts that go inside it as much as possible. There is a a "base"
directory with the common files for all the packages and "base_rpm"
and "base_deb" to put the specific files for RedHat and Debian based
packages. I still think we should share as much as possible but maybe
some more separation is needed to support more distros.


Post-install actions and dependencies
=====================================

In the current version the post-install scripts do these actions:

* delete udev rules for network and cdrom
* delete network configuration
* add the vmcontext init script to startup

There may be other actions that could be interesting to do
automatically to prepare the image, for example disabling
NetworkManager or deleting the root password.

Also some dependencies can be added to the context package. For
example it could be nice to install acpid daemons so the VM shutsdown
and reboots.


If you reached this far I'm sure you are interested in the context
packages :). We would like to tell us what do you think about these
ideas and give us some others that could be nice to do.

This is also a call for help with the packages. If you think you can
give ideas, help with some developments or test the packages in new
distributions you are more than welcome.

I think that for 4.8 we really need to change the use of "ifconfig" to
"ip" or some other system and at least I am going to open an issue in
the repository about it. If someone has some ideas or working code for
this it would be great. Maybe we can have a broad discussion here and
move the technical things to the repository tickets but we wanted to
hear what do you think about all of this.

Cheers


[1] https://github.com/OpenNebula/addon-context-linux
[2] http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
[3] https://github.com/OpenNebula/addon-context-linux/blob/master/base_rpm/etc/one-context.d/00-network#L37



-- 
Javier Fontán Muiños
Developer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | @OpenNebula | github.com/jfontan


More information about the Dev mailing list