neutron agents registering as 'localhost'

Asked by James Luhrsen

Hello,

In my current setup my agents are registering with my server with the name 'localhost'. my hostnames are short one liners with no "delimiting dots". for example: democomputenode

however, my quantum agent-list output is showing me:

+--------------------------------------+--------------------+------------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+------------+-------+----------------+
| 7fb186eb-3297-4037-bc1e-9dda177aaf76 | L3 agent | localhost | :-) | True |
| a0938264-81a1-4d30-84d8-de9d70f351e6 | DHCP agent | localhost | :-) | True |
| ce7e534b-3e8c-4cdf-9636-eaabd9b8e2d1 | Open vSwitch agent | localhost | :-) | True |
+--------------------------------------+--------------------+------------+-------+----------------+

however, if i change my hostname to something like 'democomputenode.domain01' it will register with that
full hostname.

+--------------------------------------+--------------------+-------------------------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+-------------------------+-------+----------------+
| 7fb186eb-3297-4037-bc1e-9dda177aaf76 | L3 agent | localhost | :-) | True |
| a0938264-81a1-4d30-84d8-de9d70f351e6 | DHCP agent | localhost | :-) | True |
| ce7e534b-3e8c-4cdf-9636-eaabd9b8e2d1 | Open vSwitch agent | democomputenode.domain01 | xxx | True |
+--------------------------------------+--------------------+-------------------------+-------+----------------+

A colleague of mine is not seeing this issue, for some reason.

I'm wondering what I might have broken in my setup, or if I've hit some corner case bug.

This becomes a real problem when I have lots of nodes all registering their agents as 'localhost'
the agent-list will only list a single entry for these agents and there is no way to tell if any are
having trouble (with the 'xxx' alive status) if just one remains up.

any thoughts?

Thanks,
JamO

Question information

Language:
English Edit question
Status:
Answered
For:
neutron Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
yong sheng gong (gongysh) said :
#1

two solutions:
1. make sure your hostname works
2. add host=<anydifferentvlaue> into your neutron.conf

Revision history for this message
James Luhrsen (jamo) said :
#2

Thanks for the reply.

I think I figured it out. I must not have had an entry in /etc/hosts to begin with and my initial
agent registered with default of localhost. And, only adding an entry to /etc/hosts is not good
enough. you have to also issue the "hostname <name>" cmd -or- reboot for the new hostname
to be used.

Revision history for this message
James Luhrsen (jamo) said :
#3

I take it back. I'm still seeing this issue in my setup with a valid hostname in use. However, if I use the "host" variable defined
in my quantum.conf file it will use that name when registering. I can't track down what's broken when I expect the agents
to just use the hostname for registering it's agents.

I build a new openstack cloud from scratch and ended up in the same state where my neutron agents are registering as localhost. Now, I'm seeing it regardless of "delimiting dots". AFAIK my hostname configuration is proper. Here is a log of what I have using the l3-agent as an example:

STOP SERVICE ON NN:

root@demonetworknodea:~# service quantum-l3-agent stop

IT'S DOWN ON QUANTUM SERVER:

root@democloudcontroller:~# quantum agent-list
+--------------------------------------+--------------------+-----------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+-----------+-------+----------------+
| 0d7004dd-b692-4e59-89c7-7f99974610d0 | L3 agent | localhost | xxx | True |
| addd44d6-83c0-49e7-bad0-30d5991b4c07 | DHCP agent | localhost | :-) | True |
| baac0249-8896-4065-bbf3-5e76d8e2c7d1 | Open vSwitch agent | localhost | :-) | True |
+--------------------------------------+--------------------+-----------+-------+----------------+

HOSTNAME CHECKS ON NN SEEM PROPER:

root@demonetworknodea:~# hostname
demonetworknodea
root@demonetworknodea:~# cat /etc/hostname
demonetworknodea
root@demonetworknodea:~# egrep `cat /etc/hostname` /etc/hosts
127.0.0.1 demonetworknodea

START L3 AGENT ON NN:

root@demonetworknodea:~# service quantum-l3-agent start

IT'S UP AND REGISTERED AS LOCALHOST:

root@democloudcontroller:~# quantum agent-list
+--------------------------------------+--------------------+-----------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+-----------+-------+----------------+
| 0d7004dd-b692-4e59-89c7-7f99974610d0 | L3 agent | localhost | :-) | True |
| addd44d6-83c0-49e7-bad0-30d5991b4c07 | DHCP agent | localhost | :-) | True |
| baac0249-8896-4065-bbf3-5e76d8e2c7d1 | Open vSwitch agent | localhost | :-) | True |
+--------------------------------------+--------------------+-----------+-------+----------------+

CHANGE HOSTNAME ON NN AND RESTART SERVICE:

root@demonetworknodea:~# cat /etc/hostname
demonetworknodea.domain
root@demonetworknodea:~# egrep `cat /etc/hostname` /etc/hosts
127.0.0.1 demonetworknodea.domain
root@demonetworknodea:~# hostname `cat /etc/hostname`
root@demonetworknodea:~# hostname
demonetworknodea.domain
root@demonetworknodea:~# service quantum-l3-agent restart
quantum-l3-agent stop/waiting
quantum-l3-agent start/running, process 25141
root@demonetworknodea:~#

STILL REGISTERED AS LOCALHOST ON CONTROLLER:

root@democloudcontroller:~# quantum agent-list
+--------------------------------------+--------------------+-----------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+-----------+-------+----------------+
| 0d7004dd-b692-4e59-89c7-7f99974610d0 | L3 agent | localhost | :-) | True |
| addd44d6-83c0-49e7-bad0-30d5991b4c07 | DHCP agent | localhost | :-) | True |
| baac0249-8896-4065-bbf3-5e76d8e2c7d1 | Open vSwitch agent | localhost | :-) | True |
+--------------------------------------+--------------------+-----------+-------+----------------+

Revision history for this message
Patrick Vinas (patrickvinas) said :
#4

Have you tried manually changing the host field for the agents in the quantum/neutron database?

Can you help with this problem?

Provide an answer of your own, or ask James Luhrsen for more information if necessary.

To post a message you must log in.