Skip to content

Instantly share code, notes, and snippets.

@jorisroovers
Forked from robertstarmer/build.sh
Created November 13, 2013 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorisroovers/7455097 to your computer and use it in GitHub Desktop.
Save jorisroovers/7455097 to your computer and use it in GitHub Desktop.
#!/bin/bash
source ${openrc:-~/openrc}
ext_net=${ext_net:-external}
no_gw=${no_gw:-nogw}
hostname=${1:-test}
key_name=${key_name:-public}
flavor=${flavor:-2}
image=${image:-precise-x86_64}
user_data=${user_data:-~/user.data}
net_id=`neutron net-list | grep ${ext_net} | awk -F' ' '{print $2}'`
nogw_id=`neutron net-list | grep ${no_gw} | awk -F' ' '{print $2}'`
nova boot --config-drive True --user-data ${user_data} --key-name ${key_name} \
--flavor ${flavor} --image ${image} --nic net-id=${net_id} --nic net-id=${nogw_id} $hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment