Running the Amphora agent on a Centos (Cooked image with the diskimage-create script) instance, I got the following error:
IOError: [Errno 2] No such file or directory: '/etc/network/interfaces.d/eth1.cfg'
--> See attached log for full Trace
Looks like the amphora agent is not aware of the OS flavor it's running on.
Interface file path and names indicate that the code assumes it is running on Ubuntu.
agent_server_network_dir (octavia.conf --> [amphora_agent]) is /etc/network/interfaces.d/ by default.
This by itself is not a bug since it is configurable (Although it would have been nicer if it was able to auto-adapt itself to the OS flavor).
Yet, if you change it to the proper path (/etc/sysconfig/network-scripts) it will still fail.
Looking at octavia.amphorae.backends.agent.api_server.util:
def get_network_interface_file(interface):
if CONF.amphora_agent.agent_server_network_file:
return CONF.amphora_agent.agent_server_network_file
return os.path.join(CONF.amphora_agent.agent_server_network_dir,
interface + '.cfg')
It shows that the name NIC name convention is hardcoded to ethX.cfg, whereas in Centos, Fedora and RHEL it's ifcfg-ethX --> Issue #1.
To workaround this, I changed agent_server_network_file to /etc/sysconfig/network-scripts/ifcfg-eth0.
This raised Issue #2:
DEBUG octavia.amphorae.backends.agent.api_server.plug [-] Failed to if up Command '['ifup', 'eth1']' returned non-zero exit status 1 _bring_if_up /usr/lib/python2.7/site-packages/octavia/amphorae/backends/agent/api_server/plug.py:147
The amphora agent did not create ifcfg-eth1, hence it failed to start the interface.
Moreover, The ifcfg-eth0 was misconfigured by the template /ctavia/amphorae/backends/agent/api_server/templates/plug_vip_ethX.conf.j2
# Generated by Octavia agent
auto eth1 eth1:0
iface eth1 inet dhcp
iface eth1:0 inet static
address 10.0.0.19
broadcast 10.0.0.255
netmask 255.255.255.0
This template fits Ubuntu, not Centos.
The agent should use a different Template when it is running on Centos, Fedora or RHEL.
I will not get to this bug for at least two week.
Removing myself from 'Assigned' at the moment in case someone else wish to submit a fix.