Ask Your Question
0

How to automatize Openstack to run a script on VM's first boot?

asked 2017-01-30 19:07:20 -0500

upendra_35 gravatar image

I want to automatize Openstack to run a script on VM's first launch. Eventhough i tried it as much as i can, but i am still unable to make it work.

Here is my command line script for launching VMs'

> for RUN in {1..2}; do
>     echo "Creating VM ${RUN}"
>     nova boot "${OS_PROJECT_NAME}"-WORKER-"${RUN}" \
>         --image "${BOOTIMG}" \
>         --flavor "${FLAVOR}" \
>         --nic net-name="${OS_PROJECT_NAME}"-api-net\
>         --key-name "${KEY}" \
>         --security-groups global-ssh \
>         --user-data user_data.sh

Here is my user_data.sh script

#!/bin/bash
work_queue_worker -N maker_run_test -s /home/upendra/ --debug-rotate-max=0 -d all -o worker.dbg

Can someone tell me what am i doing wrong here?

edit retag flag offensive close merge delete

Comments

Perhaps, but only if you say what doesn't work. In other words: I don't see anything wrong in your VM launch or in your user data, and I don't see any error message or error description. Perhaps your instance doesn't have /bin/bash? Perhaps the work queue worker crashes?

Bernd Bausch gravatar imageBernd Bausch ( 2017-01-31 10:44:42 -0500 )edit

Can you post any console logs or something more on this, so that we can deduce what is going on. May be cloud-init is disabled on that particular image, but without more information, we can only speculate.

rahulunair gravatar imagerahulunair ( 2017-02-28 12:14:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-01 09:59:15 -0500

shasha.tavil gravatar image

updated 2017-02-01 10:00:52 -0500

If you are booting instances using Ubuntu image you need to first install 'work_queue_worker' using your user_data.sh. May include "apt-get update; apt install coop-computing-tools" in your user_data.sh

edit flag offensive delete link more

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: 2017-01-30 19:07:20 -0500

Seen: 484 times

Last updated: Feb 01 '17