Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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?