summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-04-28 03:07:39 +0000
committerGerrit Code Review <review@openstack.org>2015-04-28 03:07:39 +0000
commit5f1cfa824ff79853ebe39244fc29a6f8add0e6ca (patch)
tree9afc066b7949e71dd78f4d8ae3b8de4d090dc20d /tools
parentca1d1c0fa6e616761247d7ff8fa82b4b13143bf7 (diff)
parent716eeae386cfdad68d4306b080882ea39547a377 (diff)
downloadkolla-5f1cfa824ff79853ebe39244fc29a6f8add0e6ca.tar.gz
kolla-5f1cfa824ff79853ebe39244fc29a6f8add0e6ca.zip
Merge "Add support for configuring via Neutron networking"
Diffstat (limited to 'tools')
-rwxr-xr-xtools/conf-neutronnet63
1 files changed, 63 insertions, 0 deletions
diff --git a/tools/conf-neutronnet b/tools/conf-neutronnet
new file mode 100755
index 000000000..0efea55a2
--- /dev/null
+++ b/tools/conf-neutronnet
@@ -0,0 +1,63 @@
+# This script is meant to be run once after running start for the first
+# time. This script downloads a cirros image and registers it. Then it
+# configures neutron networking and nova quotas to allow 40 m1.small instances
+#to be created.
+
+# Move to top level directory
+REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
+cd "$(dirname "$REAL_PATH")/.."
+
+# Test for credentials set
+if [[ "${OS_USERNAME}" == "" ]]; then
+ echo "No Keystone credentials specified. Try running source openrc"
+ exit
+fi
+
+# Test to ensure configure script is run only once
+if [[ `glance image-list | grep cirros | wc -l` -gt 0 ]]; then
+ echo "This tool should only be run once per deployment."
+ exit
+fi
+
+echo Downloading glance image.
+IMAGE_URL=http://download.cirros-cloud.net/0.3.3/
+IMAGE=cirros-0.3.3-x86_64-disk.img
+if ! [ -f "$IMAGE" ]; then
+ curl -L -o ./$IMAGE $IMAGE_URL/$IMAGE
+fi
+echo Creating glance image.
+glance image-create --name cirros --progress --is-public false --disk-format qcow2 --container-format bare --file ./$IMAGE
+
+## Non Provider Option
+neutron net-create public1 --router:external True --provider:physical_network physnet1 --provider:network_type flat
+neutron subnet-create --name 1-subnet --disable-dhcp --allocation-pool start=192.168.100.150,end=192.168.100.199 public1 192.168.100.0/24 --gateway 192.168.100.1 --dns_nameservers list=true 192.168.100.1
+neutron net-create demo-net --provider:network_type vxlan --provider:segmentation_id 10
+neutron subnet-create demo-net --name demo-subnet --gateway 10.10.10.1 10.10.10.0/24
+neutron router-create demo-router
+neutron router-interface-add demo-router demo-subnet
+neutron router-gateway-set demo-router public1
+
+# Sec Group Config
+neutron security-group-rule-create default --direction ingress --ethertype IPv4 --protocol icmp --remote-ip-prefix 0.0.0.0/0
+neutron security-group-rule-create default --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 22 --port-range-max 22 --remote-ip-prefix 0.0.0.0/0
+
+# Create a keypair
+nova keypair-add --pub-key ~/.ssh/id_rsa.pub mykey
+
+# Increase the quota to allow 40 m1.small instances to be created
+
+# Get admin user and tenant IDs
+ADMIN_USER=$(keystone user-list | awk '/admin/ {print $2'})
+ADMIN_TENANT=$(keystone tenant-list | awk '/admin/ {print $2}')
+
+# 40 instances
+nova quota-update --instances 40 $ADMIN_TENANT
+nova quota-update --user $ADMIN_USER --instances 40 $ADMIN_TENANT
+
+# 40 cores
+nova quota-update --cores 40 $ADMIN_TENANT
+nova quota-update --user $ADMIN_USER --cores 40 $ADMIN_TENANT
+
+# 96GB ram
+nova quota-update --ram 96000 $ADMIN_TENANT
+nova quota-update --user $ADMIN_USER --ram 96000 $ADMIN_TENANT