Ask Your Question
0

post creation failing

asked 2014-08-06 08:41:37 -0500

ashu gravatar image

updated 2014-08-06 15:36:35 -0500

SamYaple gravatar image

Hi

I am trying to run a post creation script on cirros instance on devstack.Below is the command which I'm using ..

nova boot --flavor m1.tiny --image $(nova image-list | grep cirros-0.3.1-x86_64-uec'\s' | awk '{print $2}') --nic net-id=$(neutron net-list | grep private | awk '{print $2}') admin-private11 --user-data ./sd.sh --availability-zone availability-zone:vvdn

Here are the contents of my script sd.sh:-

#!/bin/bash
sudo mkdir myfolder

The neutron metadata service is also up and is running.

ps -ef | grep metadata
root       420     1  0 18:52 ?        00:00:00 /usr/bin/python /usr/local/bin/neutron-ns-metadata-proxy --pid_file=/opt/stack/data/neutron/external/pids/71badf67-a53b-466f-98eb-f57dc618ed07.pid --metadata_proxy_socket=/opt/stack/data/neutron/metadata_proxy --router_id=71badf67-a53b-466f-98eb-f57dc618ed07 --state_path=/opt/stack/data/neutron --metadata_port=9697 --debug --verbose
vvdn     31415  6678  0 19:05 pts/3    00:00:00 grep --color=auto metadata
vvdn     32581 32580  0 18:51 pts/14   00:00:00 python /usr/local/bin/neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file=/etc/neutron/metadata_agent.ini

But the directory doesn't get created. What possibly could be going wrong ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-08-08 12:23:27 -0500

mpetason gravatar image

It should already be running as root. You won't need to sudo. You have to wait for everything to finish with cloud-init then watch the console output to see when the directory gets added. It should run this after everything else finishes:

#!/bin/bash mkdir myfolder

On the previous launches you should be able to find an error message when it runs the post scripts.

nova console-log {uuid}

This will give you the output. Look for the ending of Cloud-init "finished" and see what errors come up after that.

You could test this through Horizon too. It should pretty much be the same thing.

edit flag offensive delete link more

Comments

Hi ...

    Thanks for the reply,

    Here is the output of nova console-log 

     nova console-log b68d36d8-2259-4d83-b090-85ad6de29f70
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Linux version 3.2.0-37-virtual (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #58-Ubuntu SMP Thu Jan 24 15:48:03 UTC 2013 (Ubuntu 3.2.0-37.58-virtual 3.2.35)
    [    0.000000] Command line: root=/dev/vda console=tty0 console=ttyS0
    [    0.000000] KERNEL supported cpus:
    [    0.000000]   Intel GenuineIntel
    [    0.000000]   AMD AuthenticAMD
    [    0.000000]   Centaur CentaurHauls
    [    0.000000] BIOS-provided physical RAM map:
    [    0.000000]  BIOS-e820: 0000000000000000 - 000000000009dc00 (usable)
    [    0.000000]  BIOS-e820: 000000000009dc00 - 00000000000a0000 (reserved)
    [    0.000000]  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
    [    0.000000]  BIOS-e820: 0000000000100000 - 000000001fffd000 (usable)
    [    0.000000]  BIOS-e820: 000000001fffd000 - 0000000020000000 (reserved)
    [    0.000000]  BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
    [    0.000000] NX (Execute Disable) protection: active
    [    0.000000] DMI 2.4 present.
    [    0.000000] No ...
(more)
ashu gravatar imageashu ( 2014-08-11 04:15:26 -0500 )edit

Metadata is failing on the Instance.

checking http://169.254.169.254/2009-04-04/ins...
failed 1/20: up 206.86. request failed
failed 2/20: up 209.84. request failed

You'll want to troubleshoot the metadata service. This has some helpful information on network troubleshooting:

http://docs.openstack.org/openstack-o...

mpetason gravatar imagempetason ( 2014-08-11 08:39:56 -0500 )edit

Thanks for the help.

The route to the metadata server 169.254.169.254 is missing.
I'm currently testing this with cirros image.Is it the wright way or should I switch to some othe test image.
ashu gravatar imageashu ( 2014-08-12 09:04:57 -0500 )edit

Cirros is good for testing. It's the lowest overhead in size and launching. The routes should be provided by OpenStack, not native to the Cirros image.

mpetason gravatar imagempetason ( 2014-08-12 10:43:01 -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: 2014-08-06 08:41:37 -0500

Seen: 950 times

Last updated: Aug 08 '14