Skip to content

Instantly share code, notes, and snippets.

@etoews
Last active December 13, 2016 19:46
Show Gist options
  • Save etoews/6557924 to your computer and use it in GitHub Desktop.
Save etoews/6557924 to your computer and use it in GitHub Desktop.
DevStack Workshop
ssh root@<ip-address>
apt-get install -y git
git clone https://github.com/openstack-dev/devstack.git -b stable/grizzly devstack/
cd devstack/
curl -sO https://gist.github.com/everett-toews/6235684/raw/531ef32f7f55fdb5af56f01c4155e52416a18c51/localrc
nano localrc
./stack.sh
# Wait...time for Q&A
# Go to the dashboard http://<ip-address>
# Username: demo
# Password: devstack
source /opt/stack/python-novaclient/tools/nova.bash_completion
source openrc demo demo
nova list
nova secgroup-create test test
nova secgroup-add-rule test TCP 22 22 0.0.0.0/0
nova keypair-add test > test.pem
chmod 400 test.pem
nova image-list
nova flavor-list
nova boot --flavor 1 --image <image-id> --key-name test --security-groups test test-vm
nova list
ssh -i test.pem cirros@10.0.0.2
ls -al
exit
# Go to the Rackspace Python SDK (pyrax) at http://developer.rackspace.com/#python
sudo pip install pyrax
sudo pip install bpython
# To get the tenant id, paste it over <tenant-id> below
source openrc admin admin
keystone tenant-get demo
sudo nano ~/.pyrax.cfg
[private]
identity_type = keystone
region = RegionOne
auth_endpoint = http://localhost:5000/v2.0/
tenant_id = <tenant-id>
debug = True
bpython
import pyrax
pyrax.set_credentials("demo", "devstack")
pyrax.cloudservers.list()
pyrax.cloudservers.list_images()
@goshlanguage
Copy link

There was a question about what image id to use, you might edit the nova image-list command to avoid confusion:
nova image-list|egrep -v "ramdisk|kernel"

You could even use awk to strip the output to just the ID itself, using something like
nova image-list|egrep -v "ramdisk|kernel"|awk -F" '{print $2}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment