Update init-runonce

This makes some changes to init-runonce to allow using Ansible as well as
updating it to use the openstack-client where applicable since the
keystone-client is not usable with keystone v3 api at all.

Change-Id: I6b9d6beb04df7724b1967638e98042ab03221cd1
Closes-Bug: #1477725
This commit is contained in:
Sam Yaple 2015-07-23 19:17:20 +00:00
parent 922093044e
commit 005ec9ee70
2 changed files with 14 additions and 14 deletions

View File

@ -10,7 +10,7 @@ mechanism_drivers = openvswitch,l2population
#network_vlan_ranges = external:1000:1999 #network_vlan_ranges = external:1000:1999
[ml2_type_flat] [ml2_type_flat]
flat_networks = external flat_networks = physnet1
[ml2_type_gre] [ml2_type_gre]
tunnel_id_ranges = 1:1000 tunnel_id_ranges = 1:1000
@ -32,4 +32,4 @@ arp_responder = true
[ovs] [ovs]
local_ip = {{ hostvars[inventory_hostname]['ansible_' + tunnel_interface]['ipv4']['address'] }} local_ip = {{ hostvars[inventory_hostname]['ansible_' + tunnel_interface]['ipv4']['address'] }}
bridge_mappings = external:{{ neutron_bridge_name }} bridge_mappings = physnet1:{{ neutron_bridge_name }}

View File

@ -35,13 +35,13 @@ if glance image-list | grep -q cirros; then
fi fi
echo Downloading glance image. echo Downloading glance image.
IMAGE_URL=http://download.cirros-cloud.net/0.3.3/ IMAGE_URL=http://download.cirros-cloud.net/0.3.4/
IMAGE=cirros-0.3.3-x86_64-disk.img IMAGE=cirros-0.3.4-x86_64-disk.img
if ! [ -f "$IMAGE" ]; then if ! [ -f "$IMAGE" ]; then
curl -L -o ./$IMAGE $IMAGE_URL/$IMAGE curl -L -o ./$IMAGE $IMAGE_URL/$IMAGE
fi fi
echo Creating glance image. echo Creating glance image.
glance image-create --name cirros --progress --is-public false --disk-format qcow2 --container-format bare --file ./$IMAGE glance image-create --name cirros --progress --disk-format qcow2 --container-format bare --visibility public --progress --file ./$IMAGE
if [[ "${NETWORK_MANAGER}" == "nova" ]] ; then if [[ "${NETWORK_MANAGER}" == "nova" ]] ; then
echo Configuring nova networking. echo Configuring nova networking.
@ -52,7 +52,7 @@ else
echo Configuring neutron. echo Configuring neutron.
neutron net-create public1 --router:external --provider:physical_network physnet1 --provider:network_type flat neutron net-create public1 --router:external --provider:physical_network physnet1 --provider:network_type flat
neutron subnet-create --name 1-subnet --disable-dhcp --allocation-pool start=10.0.2.150,end=10.0.2.199 public1 10.0.2.0/24 --gateway 10.0.2.1 neutron subnet-create --name 1-subnet --disable-dhcp --allocation-pool start=10.0.2.150,end=10.0.2.199 public1 10.0.2.0/24 --gateway 10.0.2.1
neutron net-create demo-net --provider:network_type vxlan --provider:segmentation_id 10 neutron net-create demo-net --provider:network_type vxlan
neutron subnet-create demo-net 10.0.0.0/24 --name demo-subnet --gateway 10.0.0.1 --dns-nameservers list=true 8.8.8.8 neutron subnet-create demo-net 10.0.0.0/24 --name demo-subnet --gateway 10.0.0.1 --dns-nameservers list=true 8.8.8.8
neutron router-create demo-router neutron router-create demo-router
neutron router-interface-add demo-router demo-subnet neutron router-interface-add demo-router demo-subnet
@ -74,17 +74,17 @@ fi
# Increase the quota to allow 40 m1.small instances to be created # Increase the quota to allow 40 m1.small instances to be created
# Get admin user and tenant IDs # Get admin user and tenant IDs
ADMIN_USER=$(keystone user-list | awk '/admin/ {print $2}') ADMIN_USER_ID=$(openstack user list | awk '/admin/ {print $2}')
ADMIN_TENANT=$(keystone tenant-list | awk '/admin/ {print $2}') ADMIN_PROJECT_ID=$(openstack project list | awk '/admin/ {print $2}')
# 40 instances # 40 instances
nova quota-update --instances 40 $ADMIN_TENANT nova quota-update --instances 40 $ADMIN_PROJECT_ID
nova quota-update --user $ADMIN_USER --instances 40 $ADMIN_TENANT nova quota-update --user $ADMIN_USER_ID --instances 40 $ADMIN_PROJECT_ID
# 40 cores # 40 cores
nova quota-update --cores 40 $ADMIN_TENANT nova quota-update --cores 40 $ADMIN_PROJECT_ID
nova quota-update --user $ADMIN_USER --cores 40 $ADMIN_TENANT nova quota-update --user $ADMIN_USER_ID --cores 40 $ADMIN_PROJECT_ID
# 96GB ram # 96GB ram
nova quota-update --ram 96000 $ADMIN_TENANT nova quota-update --ram 96000 $ADMIN_PROJECT_ID
nova quota-update --user $ADMIN_USER --ram 96000 $ADMIN_TENANT nova quota-update --user $ADMIN_USER_ID --ram 96000 $ADMIN_PROJECT_ID