Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
executable file 69 lines (46 sloc) 1.79 kb
#!/usr/bin/env bash
# Sample ```` for user-configurable tasks to run automatically
# at the successful conclusion of ````.
# NOTE: Copy this file to the root DevStack directory for it to work properly.
# This is a collection of some of the things we have found to be useful to run
# after ```` to tweak the OpenStack configuration that DevStack produces.
# These should be considered as samples and are unsupported DevStack code.
# Keep track of the DevStack directory
TOP_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $TOP_DIR/functions
# Use openrc + stackrc + localrc for settings
source $TOP_DIR/stackrc
# Destination path for installation ``DEST``
if is_service_enabled nova; then
# Import ssh keys
# ---------------
# Import keys from the current user into the default OpenStack user (usually
# ``demo``)
# Get OpenStack user auth
source $TOP_DIR/openrc
# Add first keypair found in localhost:$HOME/.ssh
for i in $HOME/.ssh/ $HOME/.ssh/; do
if [[ -r $i ]]; then
nova keypair-add --pub_key=$i `hostname`
# Create A Flavor
# ---------------
# Get OpenStack admin auth
source $TOP_DIR/openrc admin admin
# Name of new flavor
# set in ``local.conf`` with ``DEFAULT_INSTANCE_TYPE=m1.micro``
# Create micro flavor if not present
if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then
nova flavor-create $MI_NAME 6 128 0 1
# Other Uses
# ----------
# Add tcp/22 and icmp to default security group
nova secgroup-add-rule default tcp 22 22
nova secgroup-add-rule default icmp -1 -1
Jump to Line
Something went wrong with that request. Please try again.