Ask Your Question
2

Instance can not access Openstack metadata service

asked 2015-05-08 07:18:21 -0500

I have created an Openstack compatible image (QCOW2) from RHEL 5.8 basically using following guide [1]. I am using Openstack juno on CentOS 7.

Creation was successful and when i uploaded it to the Glance and spawn instance out of it , it hangs on metedata accessing part, after few seconds it get started. I cloud login to the instance using the IP assigned by the openstack with the root user which I used at the time of image creation.
So as I could login Network part is working , when i try to curl http://169.254.169.254 it also not reachable.

I have tried uploading Ubuntu image and spawn instance with out any issues and could access metedata service with out any issues.

What am i doing wrong in image creation process? Help is appreciated.

[1].http://www.ravellosystems.com/blog/kvm-for-cloud-linux-image/

Thanks, Chamara

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-05-13 01:56:13 -0500

HI,

I have used the virt-manager and created the QCOW image and installed the required packages (cloud-init). After that I added following entry which prevent adding 169.254.0.0 route which causes the issue of prevent accessing metadata service earlier. Uploaded to the glace and work fine except could not find tools to grow the disk according to the selected flavor. (As I found from RHEL 6.x there are tools available , but not for RHEl 5.x)

echo "NOZEROCONF=yes" >> /etc/sysconfig/network
edit flag offensive delete link more
0

answered 2015-05-08 15:21:58 -0500

On your controller node/network node run ip netns list you are looking for something that looks like your router UUID with qrouter- prefix in front of it. Once you've found the router's network namespace you can execute commands inside of it. Try the following to get a better understanding and see if your neturon metadata proxy service is running.

This shows you the redirect rule 169.254.169.254 on port 80 , your port may differ from mine.

[root@node-1 ~]# ip netns exec qrouter-cc476665-254e-4f16-9ea4-498f63d41769 iptables-save  | grep -i redirect
-A neutron-l3-agent-PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8775

[root@node-1 ~]# ip netns exec qrouter-cc476665-254e-4f16-9ea4-498f63d41769 netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:8775                0.0.0.0:*                   LISTEN      22142/python

You can execute the curl command directly from the router

ip netns exec qrouter-cc476665-254e-4f16-9ea4-498f63d41769 curl http://169.254.169.254

Now you know what port it's redirecting on and with the netstat command you know the PID.

This gives you a location of the log file, the pid, and port all good info.

  [root@node-1 ~]# ps -f --pid 22142 | fold -s -w 82
    UID        PID  PPID  C STIME TTY          TIME CMD
    root     22142     1  0 18:47 ?        00:00:00 /usr/bin/python
    /usr/bin/neutron-ns-metadata-proxy
    --pid_file=/var/lib/neutron/external/pids/cc476665-254e-4f16-9ea4-498f63d41769.pid
     --metadata_proxy_socket=/var/lib/neutron/metadata_proxy
    --router_id=cc476665-254e-4f16-9ea4-498f63d41769 --state_path=/var/lib/neutron
    --metadata_port=8775 --verbose
    --log-file=neutron-ns-metadata-proxy-cc476665-254e-4f16-9ea4-498f63d41769.log
    --log-dir=/var/log/neutron
edit flag offensive delete link more

Comments

Thank You for the reply. As mentioned above I could not access metadata service from qrouter namespace but could access the metadata service from the qdhcp namespace.

# ip netns exec  qdhcp-a98f1337-e350-4491-aed4-30a39a7ded75 curl http://169.254.169.254
1.0
2007-01-19
2007-03-01
chamaraT gravatar imagechamaraT ( 2015-05-09 08:37:05 -0500 )edit

As I could spawn Ubuntu instances and it was working well , also metedata service was accessible. I was thinking whats wrong with the way i create RHEL images ?

chamaraT gravatar imagechamaraT ( 2015-05-09 08:40:00 -0500 )edit

I also used oz-install tool and created the RHEL5.8, and its also gives the same error as above.

2015-05-10 10:57:13,362 - DataSourceEc2.py[WARNING]: 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [3/120s]: url error [[Errno 113] No route to hos
chamaraT gravatar imagechamaraT ( 2015-05-10 10:00:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-05-08 07:18:21 -0500

Seen: 6,300 times

Last updated: May 13 '15