Automation on OpenStack, persistent-net.rules missing?


#1

I am trying to integrate VyOS as routers in an OpenStack environment. So far I am able to boot VyOS instances and configure them manually. My end goal is to fully automatically deploy and configure a network topology with multiple routers and routing protocols operating between them.

To bypass the installation process I create an image of a finished installation and create instances based on this image. Here I meet my first problem: eth0 disappears, since the associated MAC address is no longer available (?). Interfaces are named from eth1 onwards. Now, normally to fix this I would make some edits to /etc/udev/rules.d/70-persistent-net.rules, but I am unable to locate it on VyOS. eth0 is not mentioned in the config either, so how does VyOS remember interface names?

I realise that I could create the image without interfaces and bypass this problem, but I may need to do some edits to /etc/udev/rules.d/70-persistent-net.rules for automation of configuration later, so any info is greatly appreciated.

Secondly, I need to configure routing and the interfaces’ ip addresses to enable basic network connectivity (to so use puppet for configuring the rest). I am thinking of either pre-generating the initial configuration and injecting it into the file system before boot, or adding it through a start-up script (which would need to be injected, as cloud-init is not available in Debian6).
All networks will run the DHCP service built-in in OpenStack Neutron, so the interface address configuration will be straight forward.
For the routing protocol’s configuration I need to know which interfaces on each instance correspond to which OS::Neutron::Port (or at least to which network they are connected to), so that I properly define on which interfaces to do routing information exchanges and which networks to route.

For now my theory is that I need to explicitly define MAC-addresses during creation of OS::Neutron::Ports (which correspond to interfaces on VyOS) and manually specify which eth* interface they should correspond to in /etc/udev/rules.d/70-persistent-net.rules, so that I know when I generate the config file/script which interface to configure how.
Alternatively I could generate Ports as usual, query their MAC-addresses through OpenStack and cross-reference them with the contents of /etc/udev/rules.d/70-persistent-net.rules to generate the config. This would mean that I’d have to reboot the routers at least once and somehow access the /etc/udev/rules.d/70-persistent-net.rules file on the router if I use a config file.

Is there any more simple approach that will achieve similar results?


#2

Hi,

Just came across your message and I must say I would be very interested in the progress of this, because I’m doing something similar.

If you are interested, the first issue you are meeting is due to persistence of hw-id of the network interfaces in the config.boot, so, whenever you clone the VM and reinitialise MAC addresses, these won’t match the ones VyOS know, and new interfaces will have to be created.
The interfaces are still there, but they are being shifted in name.
You can find further details on the issue and ways to solve it here:
http://z0b.kapsi.fi/vyatta_vbox.php

The next issue could be probably solved if you could use config drives to upload a config.boot every time you spawn a VyOS instance.
This blog provides a method to do so:
https://undef.io/2014/10/vyos-and-openstack-configuration-drives/

I haven’t tried it yet, but I would like. And if it works, I will definitely publish the VyOS OpenStack appliance for others to use, as currently i see there is none.

A third option would be too look at OS/VX, which is a Ubuntu port of VyOS (not really 100% done yet), that has cloud-init support.
http://www.osvx.net/wiki/

Let me know if you find anything else