Newton updates

This changeset contains updates for Newton.

Notable changes include:
- Ubuntu 14.04 LTS (trusty) replaced by Ubuntu 16.04 LTS (xenial)
- Higher RAM requirements, the controller VM needs 5120 MB
- Script order changed (install-guide changes)
- By default, mariadb does not use a root password but socket auth (sudo)
- Nova does not configure any default flavors anymore; we create m1.nano
  and that's all there is when the cluster is built.
- Remaining differences to install-guide marked in the source code
- As always, new races fixed

Change-Id: Id59e145140252c4384584a3899e01a38e8a57158
This commit is contained in:
Roger Luethi
2016-10-02 19:08:14 +02:00
committed by Pranav Salunke
parent e229aea8ab
commit c5fdafc900
38 changed files with 615 additions and 513 deletions

View File

@@ -11,7 +11,7 @@ source "$CONFIG_DIR/credentials"
#------------------------------------------------------------------------------
# OpenStack client environment scripts
# http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-openrc.html
# http://docs.openstack.org/newton/install-guide-ubuntu/keystone-openrc.html
#------------------------------------------------------------------------------
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
@@ -20,7 +20,4 @@ export OS_USERNAME=$ADMIN_USER_NAME
export OS_PASSWORD=$ADMIN_PASS
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
#------------------------------------------------------------------------------
# http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-verify.html
#------------------------------------------------------------------------------
export OS_IMAGE_API_VERSION=2

View File

@@ -20,7 +20,7 @@ NET_IF_2="manual 203.0.113.0"
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment.html
#------------------------------------------------------------------------------
# Controller node is running many services.
VM_MEM=4096
VM_MEM=5120
# Override number of virtual CPUs (default is 1)
# To edit uncomment the line below

View File

@@ -11,7 +11,7 @@ source "$CONFIG_DIR/credentials"
#------------------------------------------------------------------------------
# OpenStack client environment scripts
# http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-openrc.html
# http://docs.openstack.org/newton/install-guide-ubuntu/keystone-openrc.html
#------------------------------------------------------------------------------
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
@@ -20,7 +20,4 @@ export OS_USERNAME=$DEMO_USER_NAME
export OS_PASSWORD=$DEMO_PASS
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
#------------------------------------------------------------------------------
# http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-verify.html
#------------------------------------------------------------------------------
export OS_IMAGE_API_VERSION=2

View File

@@ -15,7 +15,7 @@
# centos-7-x86_64
#DISTRO=ubuntu-12.04.4-server-amd64
#DISTRO=centos-7-x86_64
: ${DISTRO:=ubuntu-14.04-server-amd64}
: ${DISTRO:=ubuntu-16.04-server-amd64}
# PROVIDER: virtualbox or kvm (defaults to virtualbox)
# KVM tends to give better performance (on Linux), but may be harder to set up

View File

@@ -1,8 +1,10 @@
# This file contains OpenStack configuration data. It is used by both
# host (osbash, Windows batch) and VM guest scripts.
# one of: mitaka, mitaka-proposed, mitaka-staging
: ${OPENSTACK_RELEASE:=mitaka}
# newton (production release; cloud-archive:newton)
# newton-proposed (pre-release testing: cloud-archive:newton-proposed)
# newton-staging (ppa:openstack-ubuntu-testing/newton)
: ${OPENSTACK_RELEASE:=newton}
# CirrOS image URL
if [ "$(uname -m)" = "x86_64" ]; then
@@ -29,12 +31,12 @@ NETWORK_2="provider 203.0.113.0"
PXE_INITIAL_NODE_IP="10.0.0.240"
#------------------------------------------------------------------------------
# http://docs.openstack.org/mitaka/install-guide-ubuntu/launch-instance-networks-public.html
# http://docs.openstack.org/newton/install-guide-ubuntu/launch-instance-networks-provider.html
#------------------------------------------------------------------------------
# Public network
: ${PUBLIC_NETWORK_CIDR:=203.0.113.0/24}
: ${PUBLIC_NETWORK_GATEWAY:=203.0.113.1}
: ${PROVIDER_NETWORK_CIDR:=203.0.113.0/24}
: ${PROVIDER_NETWORK_GATEWAY:=203.0.113.1}
# Floating IP addresses
: ${START_IP_ADDRESS:=203.0.113.101}
: ${END_IP_ADDRESS:=203.0.113.200}
@@ -44,8 +46,8 @@ PXE_INITIAL_NODE_IP="10.0.0.240"
#------------------------------------------------------------------------------
# Private demo network
: ${PRIVATE_NETWORK_CIDR:=172.16.1.0/24}
: ${PRIVATE_NETWORK_GATEWAY:=172.16.1.1}
: ${SELFSERVICE_NETWORK_CIDR:=172.16.1.0/24}
: ${SELFSERVICE_NETWORK_GATEWAY:=172.16.1.1}
# DNS name server used by instance VMs.
# Default is Google Public DNS (8.8.4.4).

View File

@@ -7,45 +7,56 @@ cmd queue etc_hosts.sh
cmd queue osbash/enable_osbash_ssh_keys.sh
cmd snapshot_cycle -n controller controller_node_init
# Environment
cmd queue ubuntu/apt_install_mysql.sh
cmd queue ubuntu/apt_nosql_database.sh
cmd queue ubuntu/install_rabbitmq.sh
cmd queue ubuntu/install_memcached.sh
cmd snapshot_cycle -n controller pre-openstack_installed
# Identity
cmd queue ubuntu/setup_keystone.sh
cmd queue test/get_auth_token.sh
cmd snapshot_cycle -n controller keystone_installed
# Image
cmd queue ubuntu/setup_glance.sh
cmd snapshot_cycle -n controller glance_installed
# Compute
cmd queue ubuntu/setup_nova_controller.sh
cmd snapshot_cycle -n controller nova-controller_installed
# Networking
cmd queue ubuntu/setup_neutron_controller.sh
cmd queue ubuntu/setup_self-service_controller.sh
cmd queue ubuntu/setup_neutron_controller_part_2.sh
cmd snapshot_cycle -n controller neutron-controller_installed
cmd queue ubuntu/setup_cinder_controller.sh
cmd snapshot_cycle -n controller cinder_installed
# Dashboard
cmd queue ubuntu/setup_horizon.sh
cmd snapshot_cycle -n controller horizon_installed
# FIXME Our LBaaS support for kilo is broken; the configuration edits
# Block Storage
cmd queue ubuntu/setup_cinder_controller.sh
cmd snapshot_cycle -n controller cinder_installed
# Orchestration
cmd queue ubuntu/setup_heat_controller.sh
cmd snapshot_cycle -n controller heat_controller_installed
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Telemetry (currently unsupported)
# NoSQL DB (mongo) needed for Telemetry
#cmd queue ubuntu/apt_nosql_database.sh
# Note: Disable Telemetry service if it overloads the cluster.
#cmd queue ubuntu/setup_telemetry_controller.sh
#cmd snapshot_cycle -n controller telemetry-controller_installed
# FIXME Our LBaaS support is broken; the configuration edits
# in setup_lbaas_controller.sh break neutron
#cmd queue ubuntu/setup_lbaas_controller.sh
#cmd snapshot_cycle -n controller lbaas-controller_installed
# Ceilometer; disable if necessary, fix comments in this file
# Note: Disable Telemetry service if it overloads the cluster.
cmd queue ubuntu/setup_telemetry_controller.sh
cmd snapshot_cycle -n controller telemetry-controller_installed
cmd queue ubuntu/setup_heat_controller.sh
cmd snapshot_cycle -n controller heat_controller_installed
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cmd boot -n controller
#==============================================================================
@@ -57,21 +68,25 @@ cmd queue etc_hosts.sh
cmd queue osbash/enable_osbash_ssh_keys.sh
cmd snapshot_cycle -n compute1 compute1_node_init
# Compute
cmd queue ubuntu/setup_nova_compute.sh
cmd snapshot_cycle -n compute1 nova-compute1_installed
# Networking
cmd queue ubuntu/setup_neutron_compute.sh
cmd queue ubuntu/setup_self-service_compute.sh
cmd queue ubuntu/setup_neutron_compute_part_2.sh
cmd snapshot_cycle -n compute1 neutron-compute_installed
# Block Storage
cmd queue ubuntu/setup_cinder_volumes.sh
cmd snapshot_cycle -n compute1 cinder-volume_installed
cmd queue ubuntu/setup_telemetry_compute.sh
cmd snapshot_cycle -n compute1 telemetry-compute_installed
cmd boot -n compute1
# Telemetry
#cmd queue ubuntu/setup_telemetry_compute.sh
#cmd snapshot_cycle -n compute1 telemetry-compute_installed
cmd boot -n compute1
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Take snapshot of database changes on controller VM, too
cmd shutdown -n controller
@@ -81,5 +96,6 @@ cmd snapshot -n controller controller_-_compute1_node_installed
cmd queue config_public_network.sh
cmd queue config_private_network.sh
cmd snapshot_cycle -n controller public_private_networks
#==============================================================================
cmd boot -n controller

View File

@@ -270,8 +270,9 @@ $option = $value
function mysql_exe {
local cmd="$1"
echo "MySQL cmd: $cmd."
mysql -u "root" -p"$DATABASE_PASSWORD" -e "$cmd"
echo "mysql cmd: $cmd."
# XXX install-guide uses password, but distro install uses socket auth
sudo mysql -u "root" -e "$cmd"
}
function setup_database {
@@ -295,14 +296,15 @@ function setup_database {
# process, the neutron server sometimes fails to come up. We restart the
# neutron server if it does not reply for too long.
function wait_for_neutron {
(
source $CONFIG_DIR/demo-openstackrc.sh
echo -n "Waiting for neutron to come up."
local cnt=0
local auth="source $CONFIG_DIR/demo-openstackrc.sh"
until openstack network list >/dev/null 2>&1; do
if [ "$cnt" -eq 10 ]; then
echo
echo "ERROR No response from neutron. Restarting neutron-server."
node_ssh controller "$auth; sudo service neutron-server restart"
node_ssh controller "sudo service neutron-server restart"
echo -n "Waiting for neutron to come up."
elif [ "$cnt" -eq 20 ]; then
echo
@@ -314,6 +316,7 @@ function wait_for_neutron {
cnt=$((cnt + 1))
done
echo
)
}
# Wait for keystone to come up
@@ -329,19 +332,6 @@ function wait_for_keystone {
)
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Service-specific users in keystone
function service_to_user_name {
local service_name=$1
echo "${service_name}"
}
function service_to_user_password {
local service_name=$1
echo "${service_name}_pass"
}
#-------------------------------------------------------------------------------
# Network configuration
#-------------------------------------------------------------------------------
@@ -367,6 +357,27 @@ function set_iface_list {
echo "Set IF_NAMES to ${IF_NAMES[*]}"
}
# Return the nth network interface name (not counting loopback; 0 -> eth0)
function ifnum_to_ifname {
local if_num=$1
# Skip loopback and start counting with next interface
local iface=${IF_NAMES[$((if_num + 1))]}
echo >&2 "ifnum_to_ifname: interface $if_num is $iface"
echo "$iface"
}
# Get all network interfaces (e.g. eth0, p2p1, ens0, enp0s3) into an array
function set_iface_list {
unset IF_NAMES
local iface
for iface in $(ip -o link show|awk '/: / {print $2}'|tr -d ':'); do
IF_NAMES+=($iface)
done
echo "Set IF_NAMES to ${IF_NAMES[*]}"
}
function hostname_to_ip {
local host_name=$1
getent hosts "$host_name"|awk '{print $1}'

View File

@@ -0,0 +1,89 @@
# Ubuntu 16.04 LTS amd64 server
# Default scripts for all Ubuntu installs
: ${BASE_INSTALL_SCRIPTS:=scripts.ubuntu_base}
#-------------------------------------------------------------------------------
# Installation from ISO image
#-------------------------------------------------------------------------------
readonly ISO_URL_BASE=http://releases.ubuntu.com/16.04/
ISO_URL=$ISO_URL_BASE/ubuntu-16.04.1-server-amd64.iso
#ISO_MD5=23e97cd5d4145d4105fbf29878534049
ISO_MD5=d2d939ca0e65816790375f6826e4032f
readonly _PS_ssh=http://git.openstack.org/cgit/openstack/training-labs/plain/labs/osbash/lib/osbash/netboot/preseed-ssh-v4.cfg
readonly _PS_vbadd=http://git.openstack.org/cgit/openstack/training-labs/plain/labs/osbash/lib/osbash/netboot/preseed-vbadd-v3.cfg
readonly _PS_all=http://git.openstack.org/cgit/openstack/training-labs/plain/labs/osbash/lib/osbash/netboot/preseed-all-v2.cfg
# Arguments for ISO image installer
readonly _BOOT_ARGS="/install/vmlinuz
noapic
preseed/url=%s
debian-installer=en_US
auto=true
locale=en_US
hostname=osbash
fb=false
debconf/frontend=noninteractive
keyboard-configuration/modelcode=SKIP
initrd=/install/initrd.gz
console-setup/ask_detect=false"
# file=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet ---
# Fallback function to find current ISO image in case the file in ISO_URL is
# neither on the disk nor at the configured URL.
# This mechanism was added because old Ubuntu ISOs are removed from the server
# as soon as a new ISO appears.
function update_iso_variables {
# Get matching line from distro repo's MD5SUMS file, e.g.
# "9e5fecc94b3925bededed0fdca1bd417 *ubuntu-14.04.3-server-amd64.iso"
local distro_info=$(wget -O - "$ISO_URL_BASE/MD5SUMS"|grep server-amd64)
# First part (removing everything after first space) is the md5sum
ISO_MD5=${distro_info%% *}
# Second part (keeping everything after ' *') is the ISO file name
local iso_file=${distro_info#* \*}
ISO_URL=$ISO_URL_BASE/$iso_file
echo -e >&2 "${CStatus:-}New ISO_URL: ${CData:-}$ISO_URL${CReset:-}"
}
# ostype used by VirtualBox to choose icon and flags (64-bit, IOAPIC)
VBOX_OSTYPE=Ubuntu_64
# Boot the ISO image operating system installer
function distro_start_installer {
local vm_name=$1
# pick a _PS_* file
local preseed=_PS_$VM_ACCESS
echo "Using $preseed ${!preseed}"
local boot_args=$(printf "$_BOOT_ARGS" "${!preseed}")
if [ -n "${VM_PROXY:-""}" ]; then
echo >&2 "Using proxy $VM_PROXY."
boot_args="$boot_args mirror/http/proxy=$VM_PROXY http_proxy=$VM_PROXY"
fi
keyboard_send_enter "$vm_name"
keyboard_send_f6 "$vm_name"
keyboard_send_escape "$vm_name"
for i in $(seq 1 83); do
keyboard_send_backspace "$vm_name"
done
echo -e "${CStatus:-}Pushing boot command line${CReset:-}"
keyboard_send_string "$vm_name" "$boot_args"
echo "Initiating boot sequence"
keyboard_send_enter "$vm_name"
}
# vim: set ai ts=4 sw=4 et ft=sh:

View File

@@ -10,7 +10,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Create private network
# http://docs.openstack.org/mitaka/install-guide-ubuntu/launch-instance-networks-private.html
# http://docs.openstack.org/newton/install-guide-ubuntu/launch-instance-networks-selfservice.html
#------------------------------------------------------------------------------
echo -n "Waiting for first DHCP namespace."
@@ -28,6 +28,9 @@ until [ "$(/sbin/brctl show | grep -c -o "^brq[a-z0-9-]*")" -gt 0 ]; do
done
echo
# Wait for neutron to start
wait_for_neutron
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create the self-service network
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -36,20 +39,17 @@ echo
echo "Sourcing the demo credentials."
source "$CONFIG_DIR/demo-openstackrc.sh"
# Wait for neutron to start
wait_for_neutron
echo "Creating the private network."
neutron net-create selfservice
echo "Creating a subnet on the tenant network."
echo "Creating a subnet on the private network."
neutron subnet-create --name selfservice \
--dns-nameserver "$DNS_RESOLVER" --gateway "$PRIVATE_NETWORK_GATEWAY" \
selfservice "$PRIVATE_NETWORK_CIDR"
--dns-nameserver "$DNS_RESOLVER" --gateway "$SELFSERVICE_NETWORK_GATEWAY" \
selfservice "$SELFSERVICE_NETWORK_CIDR"
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
echo -n "Waiting for second DHCP namespace."
until [ "$(ip netns | grep -c -o "^qdhcp-[a-z0-9-]*")" -gt 1 ]; do
sleep 1
@@ -87,13 +87,16 @@ echo "Creating a router."
neutron router-create router
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
function wait_for_agent {
local agent=$1
echo -n "Waiting for neutron agent $agent."
(
source "$CONFIG_DIR/admin-openstackrc.sh"
while neutron agent-list|grep "$agent" | grep "xxx" >/dev/null; do
while neutron agent-list | grep "$agent" | grep "xxx" >/dev/null; do
sleep 1
echo -n .
done
@@ -107,12 +110,15 @@ echo "linuxbridge-agent and dhcp-agent must be up before we can add interfaces."
wait_for_agent neutron-linuxbridge-agent
wait_for_agent neutron-dhcp-agent
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(
source "$CONFIG_DIR/demo-openstackrc.sh"
echo "Adding the private network subnet as an interface on the router."
neutron router-interface-add router selfservice
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
# The following tests for router namespace, qr-* interface and bridges are just
# for show. They are not needed to prevent races.
@@ -129,15 +135,15 @@ until sudo ip netns exec "$nsrouter" ip addr|grep -Po "(?<=: )qr-.*(?=:)"; do
echo -n "."
sleep 1
done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(
source "$CONFIG_DIR/demo-openstackrc.sh"
echo "Setting a gateway on the public network on the router."
neutron router-gateway-set router provider
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
# The following test for qg-* is just for show.
echo -n "Waiting for interface qg-* in router namespace."
@@ -188,7 +194,7 @@ cnt=0
until ping -c1 "$PUBLIC_ROUTER_IP" > /dev/null; do
cnt=$((cnt + 1))
if [ $cnt -eq 20 ]; then
echo "ERROR no reply from public router IP in 20 s, exiting."
echo "ERROR No reply from public router IP in 20 seconds, aborting."
exit 1
fi
sleep 1

View File

@@ -10,7 +10,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Create the provier (external) network and a subnet on it
# http://docs.openstack.org/mitaka/install-guide-ubuntu/launch-instance-networks-provider.html
# http://docs.openstack.org/newton/install-guide-ubuntu/launch-instance-networks-provider.html
#------------------------------------------------------------------------------
echo "Sourcing the admin credentials."
@@ -54,9 +54,11 @@ echo "Creating a subnet on the public network."
neutron subnet-create --name provider \
--allocation-pool start="$START_IP_ADDRESS,end=$END_IP_ADDRESS" \
--dns-nameserver "$DNS_RESOLVER" \
--gateway "$PUBLIC_NETWORK_GATEWAY" \
provider "$PUBLIC_NETWORK_CIDR"
--gateway "$PROVIDER_NETWORK_GATEWAY" \
provider "$PROVIDER_NETWORK_CIDR"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
echo -n "Waiting for DHCP namespace."
until [ "$(ip netns | grep -c -o "^qdhcp-[a-z0-9-]*")" -gt 0 ]; do
sleep 1
@@ -73,3 +75,4 @@ done
echo
/sbin/brctl show
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -11,4 +11,4 @@ exec_logfile
echo "Shutting down"
# Shutdown some time after returning so our caller has time to finish
sudo -b sh -c 'sleep 2; /sbin/shutdown -P now'
sudo -b sh -c 'sleep 2; systemctl poweroff'

View File

@@ -45,10 +45,14 @@ check_for_other_vms
echo "Creating a test heat template."
# FIXME mykey is created in launch_instance_private_net.sh
# Note: unlike install-guide, we use m1.nano (default flavors like m1.tiny
# are no longer installed)
node_ssh controller "cat > demo-template.yml" << HEAT
heat_template_version: 2015-10-15
description: Launch a basic instance with CirrOS image using the
``m1.tiny`` flavor, ``mykey`` key, and one network.
``m1.nano`` flavor, ``mykey`` key, and one network.
parameters:
NetID:
@@ -60,7 +64,7 @@ resources:
type: OS::Nova::Server
properties:
image: cirros
flavor: m1.tiny
flavor: m1.nano
key_name: mykey
networks:
- network: { get_param: NetID }
@@ -74,6 +78,29 @@ outputs:
value: { get_attr: [ server, first_address ] }
HEAT
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create m1.nano flavor
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Newton does no longer create default flavors:
# http://docs.openstack.org/releasenotes/nova/unreleased.html 2016-09-25
(
echo
source "$CONFIG_DIR/admin-openstackrc.sh"
if openstack flavor list | grep m1.nano; then
echo "Proceeding, m1.nano flavor exists."
else
echo "Creating m1.nano flavor which is just big enough for CirrOS."
openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
fi
echo "Current flavors:"
openstack flavor list
echo
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create a stack
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -82,19 +109,21 @@ TEST_STACK_NAME=stack
DEMO_NET=provider
NET_ID=$(node_ssh controller "$AUTH; openstack network list" | awk "/ $DEMO_NET / { print \$2 }")
node_ssh controller "$AUTH; heat stack-create -f demo-template.yml \
-P 'NetID=$NET_ID' $TEST_STACK_NAME"
echo "NET_ID: $NET_ID"
node_ssh controller "$AUTH; openstack stack create -t demo-template.yml \
--parameter 'NetID=$NET_ID' $TEST_STACK_NAME"
echo "Verifying successful creation of stack."
cnt=0
echo "heat stack-list"
until node_ssh controller "$AUTH; heat stack-list" 2>/dev/null | grep "CREATE_COMPLETE"; do
echo "openstack stack list"
until node_ssh controller "$AUTH; openstack stack list" 2>/dev/null | grep "CREATE_COMPLETE"; do
cnt=$((cnt + 1))
if [ $cnt -eq 60 ]; then
# Print current stack list to help with debugging
echo
node_ssh controller "$AUTH; heat stack-list"
node_ssh controller "$AUTH; openstack stack list"
echo "Heat stack creation failed. Exiting."
echo "[Warning]: Please debug heat services on the
controller node. Heat may not work."
@@ -106,15 +135,15 @@ until node_ssh controller "$AUTH; heat stack-list" 2>/dev/null | grep "CREATE_CO
done
echo "Showing the name and IP address of the instance."
node_ssh controller "$AUTH; heat output-show --all $TEST_STACK_NAME; nova list"
node_ssh controller "$AUTH; openstack stack output show --all $TEST_STACK_NAME; nova list"
echo "Deleting the test stack."
heat_stack_id=$(node_ssh controller "$AUTH; heat stack-list" | awk "/ $TEST_STACK_NAME / {print \$2}")
heat_stack_id=$(node_ssh controller "$AUTH; openstack stack list" | awk "/ $TEST_STACK_NAME / {print \$2}")
node_ssh controller "$AUTH; heat stack-delete $heat_stack_id"
node_ssh controller "$AUTH; openstack stack delete $heat_stack_id"
echo -n "Waiting for test stack to disappear."
while node_ssh controller "$AUTH; heat stack-list|grep $heat_stack_id" >/dev/null 2>&1; do
while node_ssh controller "$AUTH; openstack stack list|grep $heat_stack_id" >/dev/null 2>&1; do
sleep 1
echo -n .
done

View File

@@ -67,7 +67,7 @@ function wait_for_service {
local cnt=0
echo -n "Node $node, service $service:"
until ssh_no_chk_node "$node" service "$service" status | \
grep -q "start/running"; do
grep -q "active (running)"; do
cnt=$((cnt + 1))
if [ $((cnt % 150)) -eq 0 ]; then
echo " does not seem to come up. Forcing restart."
@@ -152,14 +152,6 @@ function wait_for_nova_services {
done
echo
echo -n " nova-cert"
until openstack compute service list --service nova-cert | \
grep -q '| up '; do
sleep 1
echo -n .
done
echo
echo -n " nova-scheduler"
until openstack compute service list --service nova-scheduler | \
grep -q '| up '; do
@@ -259,6 +251,9 @@ echo
echo "Check if m1.nano flavor is existing or else, create the flavor."
source "$CONFIG_DIR/admin-openstackrc.sh"
echo "Current flavors:"
openstack flavor list
if openstack flavor list | grep m1.nano; then
echo "Proceeding, m1.nano flavor exists."
else
@@ -415,8 +410,8 @@ function check_for_other_vms {
check_for_other_vms
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NOVA_SCHED_LOG=/var/log/upstart/nova-scheduler.log
NOVA_API_LOG=/var/log/upstart/nova-api.log
NOVA_SCHED_LOG=/var/log/nova/nova-scheduler.log
NOVA_API_LOG=/var/log/nova/nova-api.log
VM_LAUNCHES=0
@@ -704,12 +699,12 @@ openstack console url show "$DEMO_INSTANCE_NAME"
echo
echo "Creating a floating IP address on the public network."
floating_ip=$(openstack ip floating create provider | awk '/ ip / {print $4}')
floating_ip=$(openstack floating ip create provider | awk '/ floating_ip_address / {print $4}')
openstack ip floating list
echo
echo "Associating the floating IP address with our instance."
openstack ip floating add "$floating_ip" "$DEMO_INSTANCE_NAME"
openstack server add floating ip "$DEMO_INSTANCE_NAME" "$floating_ip"
echo
echo "Checking the status of your floating IP address."

View File

@@ -151,18 +151,22 @@ NET_ID=$(grep "provider" $OUTPUT_FILE3 | \
echo "The provider NET_ID is $NET_ID"
#######
# The following part is broken.
# The same DATA section works on the previous requests so either the
# REFERER or the IMG_URL (not likely) have changed since Mitaka
IMG_URL="http://$IP/horizon/project/images/"
DATA="login_region='http://controller:5000/v3'&login_domain=default&\
csrfmiddlewaretoken=$TOKEN&sessionid=$SESSIONID"
#IMG_URL="http://$IP/horizon/project/images/"
#DATA="login_region='http://controller:5000/v3'&login_domain=default&\
#csrfmiddlewaretoken=$TOKEN&sessionid=$SESSIONID"
# Step 4: Load the page with the available images
echo "Loading the images tab and parsing the image ID for cirros."
request_cmd "$IMG_URL" $OUTPUT_FILE4 "$DATA" "$REFERER"
# Parse (cirros) image ID
IMAGE_ID=$(grep "cirros" $OUTPUT_FILE4 | \
awk -F"obj_id=" '{print $2}' | \
awk -F'"' '{print $1}')
echo "The cirros IMAGE_ID is $IMAGE_ID"
## Step 4: Load the page with the available images
#echo "Loading the images tab and parsing the image ID for cirros."
#request_cmd "$IMG_URL" $OUTPUT_FILE4 "$DATA" "$REFERER"
#
## Parse (cirros) image ID
#IMAGE_ID=$(grep "cirros" $OUTPUT_FILE4 | \
# awk -F"obj_id=" '{print $2}' | \
# awk -F'"' '{print $1}')
#
#echo "The cirros IMAGE_ID is $IMAGE_ID"

View File

@@ -37,56 +37,49 @@ set_apt_proxy
# Get apt index files
sudo apt-get update
function ubuntu_cloud_archive {
# cloud-keyring to verify packages from ubuntu-cloud repo
sudo apt-get install ubuntu-cloud-keyring
# ---------------------------------------------------------------------------
# Enable the OpenStack repository
# http://docs.openstack.org/newton/install-guide-ubuntu/environment-packages.html
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# NOTE: Using pre-release staging ppa is not documented in install-guide
# https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/newton-staging
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# Enable the OpenStack repository
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment-packages.html
#--------------------------------------------------------------------------
echo "Installing packages needed for add-apt-repository."
sudo apt-get -y install software-properties-common
# Install packages needed for add-apt-repository
sudo apt-get -y install software-properties-common \
python-software-properties
sudo add-apt-repository -y "cloud-archive:$OPENSTACK_RELEASE"
}
function ubuntu_cloud_staging {
#--------------------------------------------------------------------------
# Enable the OpenStack repository
# https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/mitaka-staging
#
# NOTE: Using pre-release staging ppa is not documented in install-guide
#--------------------------------------------------------------------------
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9F68104E
cat << DEB |sudo tee /etc/apt/sources.list.d/cloudarchive-$OPENSTACK_RELEASE.list
deb http://ppa.launchpad.net/ubuntu-cloud-archive/$OPENSTACK_RELEASE/ubuntu trusty main
deb-src http://ppa.launchpad.net/ubuntu-cloud-archive/$OPENSTACK_RELEASE/ubuntu trusty main
DEB
}
# precise needs the cloud archive, and so does trusty for non-Icehouse releases
if grep -qs DISTRIB_CODENAME=precise /etc/lsb-release ||
[ "$OPENSTACK_RELEASE" != "icehouse" ]; then
if [[ "$OPENSTACK_RELEASE" =~ staging ]]; then
echo "Enabling the Ubuntu cloud staging ppa."
ubuntu_cloud_staging
else
echo "Enabling the Ubuntu cloud archive."
ubuntu_cloud_archive
fi
# Get index files only for ubuntu-cloud repo but keep standard lists
src_list=cloudarchive-$OPENSTACK_RELEASE.list
if [ -f "/etc/apt/sources.list.d/$src_list" ]; then
sudo apt-get update \
-o Dir::Etc::sourcelist="sources.list.d/$src_list" \
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
else
echo "ERROR: apt source not found: /etc/apt/sources.list.d/$src_list"
case "$OPENSTACK_RELEASE" in
newton)
REPO=cloud-archive:newton
SRC_FILE=cloudarchive-newton.list
;;
newton-proposed)
REPO=cloud-archive:newton-proposed
SRC_FILE=cloudarchive-newton-proposed.list
;;
newton-staging)
REPO=ppa:ubuntu-cloud-archive/newton-staging
SRC_FILE=ubuntu-cloud-archive-ubuntu-newton-staging-xenial.list
;;
*)
echo >&2 "Unknown OpenStack release: $OPENSTACK_RELEASE. Aborting."
exit 1
fi
;;
esac
echo "Adding cloud repo: $REPO"
sudo add-apt-repository "$REPO"
# Get index files only for ubuntu-cloud repo but keep standard lists
if [ -f "/etc/apt/sources.list.d/$SRC_FILE" ]; then
sudo apt-get update \
-o Dir::Etc::sourcelist="sources.list.d/$SRC_FILE" \
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
else
echo "ERROR: apt source not found: /etc/apt/sources.list.d/$SRC_FILE"
exit 1
fi
# Disable automatic updates (they compete with our scripts for the dpkg lock)
sudo systemctl disable apt-daily.service
sudo systemctl disable apt-daily.timer

View File

@@ -16,38 +16,47 @@ indicate_current_auto
# Controller setup
#-------------------------------------------------------------------------------
DB_IP=$(get_node_ip_in_network "$(hostname)" "mgmt")
echo "Will bind MySQL server to $DB_IP."
#------------------------------------------------------------------------------
# Install and configure the database server
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment-sql-database.html
# http://docs.openstack.org/newton/install-guide-ubuntu/environment-sql-database.html
#------------------------------------------------------------------------------
echo "Sourced MySQL password from credentials: $DATABASE_PASSWORD"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '$DATABASE_PASSWORD''
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '$DATABASE_PASSWORD''
#sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '$DATABASE_PASSWORD''
#sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '$DATABASE_PASSWORD''
echo "Installing MySQL (MariaDB)."
sudo apt-get install -y mariadb-server python-mysqldb
conf=/etc/mysql/conf.d/mysqld_openstack.cnf
# Not in the install-guide
echo "Sanity check: distro default is socket auth."
sudo mysql -u root -e quit
# Not in install-guide
# To drop socket auth for root user and use root password:
# sudo mysql -u "root" -e "use mysql; update user set plugin='' where user='root'; update user set password=PASSWORD('$DATABASE_PASSWORD') where user='root'; flush privileges;"
conf=/etc/mysql/mariadb.conf.d/99-openstack.cnf
echo "Creating $conf."
echo '[mysqld]' | sudo tee $conf
echo "Configuring MySQL to accept requests from management network."
echo "Configuring MySQL to accept requests from management network ($DB_IP)."
iniset_sudo $conf mysqld bind-address "$DB_IP"
# Enable InnoDB
iniset_sudo $conf mysqld default-storage-engine innodb
iniset_sudo $conf mysqld innodb_file_per_table ""
# Enable UTF-8 character set and UTF-8 collation by default
iniset_sudo $conf mysqld max_connections 4096
iniset_sudo $conf mysqld collation-server utf8_general_ci
iniset_sudo $conf mysqld init-connect "'SET NAMES utf8'"
iniset_sudo $conf mysqld character-set-server utf8
echo "Restarting MySQL service."
# Close the file descriptor or the script will hang due to open ssh connection
sudo service mysql restart 2>/dev/null
# Difference to install-guide: not running mysql_secure_installation

View File

@@ -14,11 +14,13 @@ exec_logfile
indicate_current_auto
#------------------------------------------------------------------------------
# Install the NoSQL (Mongo) service
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment-nosql-database.html
# NoSQL database for Ubuntu
# http://docs.openstack.org/project-install-guide/telemetry/newton/database/environment-nosql-database-ubuntu.html
#------------------------------------------------------------------------------
echo "Setting up NoSQL database (MongoDB) for telemetry."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and configure components
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing the MongoDB packages."
sudo apt-get install -y mongodb-server mongodb-clients python-pymongo
@@ -32,7 +34,7 @@ echo "Stopping mongodb."
sudo service mongodb stop
echo "Removing initial journal files (if any)."
sudo rm -f /var/lib/mongodb/journal/prealloc.*
sudo rm -vf /var/lib/mongodb/journal/prealloc.*
echo "Starting mongodb."
sudo service mongodb start
@@ -42,3 +44,4 @@ while sudo service mongodb status 2>/dev/null | grep "stop"; do
sleep 2
echo -n .
done
echo

View File

@@ -36,8 +36,8 @@ apt_download keystone python-openstackclient apache2 \
apt_download glance python-glanceclient
# Nova Controller
apt_download nova-api nova-cert nova-conductor nova-consoleauth \
nova-novncproxy nova-scheduler python-novaclient
apt_download nova-api nova-conductor nova-consoleauth \
nova-novncproxy nova-scheduler
# Neutron Controller
apt_download neutron-server neutron-plugin-ml2 \

View File

@@ -20,7 +20,10 @@ exec_logfile
# Note: We assume that apt_init.sh set up repos and updated the apt index files
# Upgrade installed packages and the kernel
sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
# Keep our changes to /etc/sudoers from tripping up apt-get
sudo DEBIAN_FRONTEND=noninteractive apt-get \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
-y upgrade
sudo apt-get -y dist-upgrade
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -14,14 +14,14 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Memcached
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment-memcached.html
# http://docs.openstack.org/newton/install-guide-ubuntu/environment-memcached.html
#------------------------------------------------------------------------------
echo "Installing memcache packages."
sudo apt-get install -y memcached python-memcache
MGMT_IP=$(get_node_ip_in_network "$(hostname)" "mgmt")
echo "Will bind memcached server to $MGMT_IP."
echo "Binding memcached server to $MGMT_IP."
conf=/etc/memcached.conf
sudo sed -i "s/^-l 127.0.0.1/-l $MGMT_IP/" $conf

View File

@@ -14,14 +14,29 @@ indicate_current_auto
#-------------------------------------------------------------------------------
# Install the message broker service (RabbitMQ).
# http://docs.openstack.org/mitaka/install-guide-ubuntu/environment-messaging.html
# http://docs.openstack.org/newton/install-guide-ubuntu/environment-messaging.html
#-------------------------------------------------------------------------------
echo "Installing RabbitMQ."
sudo apt-get install -y rabbitmq-server
echo -n "Waiting for RabbitMQ to start."
while ! sudo rabbitmqctl status >/dev/null; do
sleep 1
echo -n .
done
echo
echo ---------------------------------------------------------------
echo "sudo rabbitmqctl status"
sudo rabbitmqctl status
echo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "sudo rabbitmqctl report"
sudo rabbitmqctl report
echo ---------------------------------------------------------------
echo "Adding openstack user to messaging service."
sudo rabbitmqctl add_user openstack "$RABBIT_PASS"
echo "Permit configuration, write and read access for the openstack user."
echo "Permitting configuration, write and read access for the openstack user."
sudo rabbitmqctl set_permissions openstack ".*" ".*" ".*"

View File

@@ -14,7 +14,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up Block Storage service controller (cinder controller node)
# http://docs.openstack.org/mitaka/install-guide-ubuntu/cinder-controller-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/cinder-controller-install.html
#------------------------------------------------------------------------------
echo "Setting up database for cinder."
@@ -22,7 +22,7 @@ setup_database cinder "$CINDER_DB_USER" "$CINDER_DBPASS"
source "$CONFIG_DIR/admin-openstackrc.sh"
cinder_admin_user=$(service_to_user_name cinder)
cinder_admin_user=cinder
# Wait for keystone to come up
wait_for_keystone
@@ -47,7 +47,7 @@ openstack service create \
openstack service create \
--name cinderv2 \
--description "OpenStack Block Storage v2" \
--description "OpenStack Block Storage" \
volumev2
openstack endpoint create \
@@ -112,6 +112,7 @@ iniset_sudo $conf DEFAULT auth_strategy keystone
# Configure [keystone_authtoken] section.
iniset_sudo $conf keystone_authtoken auth_uri http://controller:5000
iniset_sudo $conf keystone_authtoken auth_url http://controller:35357
iniset_sudo $conf keystone_authtoken memcached_servers controller:11211
iniset_sudo $conf keystone_authtoken auth_type password
iniset_sudo $conf keystone_authtoken project_domain_name default
iniset_sudo $conf keystone_authtoken user_domain_name default
@@ -123,20 +124,30 @@ iniset_sudo $conf DEFAULT my_ip "$(hostname_to_ip controller)"
iniset_sudo $conf oslo_concurrency lock_path /var/lib/cinder/tmp
echo "Creating the database tables for cinder."
echo "Populating the Block Storage database."
sudo cinder-manage db sync
echo "Configuring nova.conf"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Configure Compute to use Block Storage
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Configuring Compute to use Block Storage."
conf=/etc/nova/nova.conf
iniset_sudo $conf cinder os_region_name "$REGION"
echo "Restart Compute API service."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Finalize installation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Restarting the Compute API service."
sudo service nova-api restart
echo "Restarting cinder service."
echo "Restarting the Block Storage services."
sudo service cinder-scheduler restart
sudo service cinder-api restart
echo "Removing unused SQLite database file (if any)."
sudo rm -f /var/lib/cinder/cinder.sqlite
# Not in the install-guide:
echo "Removing unused SQLite database file."
sudo rm -v /var/lib/cinder/cinder.sqlite

View File

@@ -14,8 +14,8 @@ exec_logfile
indicate_current_auto
#------------------------------------------------------------------------------
# Set up Block Storage service (cinder).
# http://docs.openstack.org/mitaka/install-guide-ubuntu/cinder-storage-install.html
# Install and configure a storage node
# http://docs.openstack.org/newton/install-guide-ubuntu/cinder-storage-install.html
#------------------------------------------------------------------------------
MY_MGMT_IP=$(get_node_ip_in_network "$(hostname)" "mgmt")
@@ -35,16 +35,29 @@ echo "Configuring LVM physical and logical volumes."
cinder_dev=sdb
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide
# Avoid error due to service not running
# XXX Alternatively, in /etc/lvm/lvm.conf, set use_lvmetad = 0
sudo systemctl enable lvm2-lvmetad.service
sudo systemctl enable lvm2-lvmetad.socket
sudo systemctl start lvm2-lvmetad.service
sudo systemctl start lvm2-lvmetad.socket
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sudo pvcreate /dev/$cinder_dev
sudo vgcreate cinder-volumes /dev/$cinder_dev
conf=/etc/lvm/lvm.conf
echo "Setting LVM filter line in $conf to only allow /dev/$cinder_dev:"
sudo sed -i '/^[[:space:]]\{1,\}filter/ s|= .*|= [ "a/'$cinder_dev'/", "r/.*/"]|' $conf
echo "Setting LVM filter line in $conf to only allow /dev/$cinder_dev."
sudo sed -i '0,/# filter = / {s|# filter = .*|filter = [ "a/'$cinder_dev'/", "r/.*/"]|}' $conf
echo "Verifying LVM filter."
grep "^[[:space:]]\{1,\}filter" $conf
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and configure Cinder Volumes
# Install and configure components
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing cinder."
@@ -61,7 +74,7 @@ function get_database_url {
}
database_url=$(get_database_url)
cinder_admin_user=$(service_to_user_name cinder)
cinder_admin_user=cinder
echo "Setting database connection: $database_url."
iniset_sudo $conf database connection "$database_url"
@@ -78,6 +91,7 @@ iniset_sudo $conf DEFAULT auth_strategy keystone
# Configure [keystone_authtoken] section.
iniset_sudo $conf keystone_authtoken auth_uri http://controller:5000
iniset_sudo $conf keystone_authtoken auth_url http://controller:35357
iniset_sudo $conf keystone_authtoken memcached_servers controller:11211
iniset_sudo $conf keystone_authtoken auth_type password
iniset_sudo $conf keystone_authtoken project_domain_name default
iniset_sudo $conf keystone_authtoken user_domain_name default
@@ -87,26 +101,30 @@ iniset_sudo $conf keystone_authtoken password "$CINDER_PASS"
iniset_sudo $conf DEFAULT my_ip "$MY_MGMT_IP"
iniset_sudo $conf lvm volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver
iniset_sudo $conf lvm volume_group cinder-volumes
iniset_sudo $conf lvm iscsi_protocol iscsi
iniset_sudo $conf lvm iscsi_helper tgtadm
iniset_sudo $conf DEFAULT volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver
iniset_sudo $conf DEFAULT volume_group cinder-volumes
iniset_sudo $conf DEFAULT iscsi_protocol iscsi
iniset_sudo $conf DEFAULT iscsi_helper tgtadm
iniset_sudo $conf DEFAULT enabled_backends lvm
iniset_sudo $conf DEFAULT glance_api_servers http://controller:9292
iniset_sudo $conf oslo_concurrency lock_path /var/lib/cinder/tmp
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Finalize installation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Restarting cinder service."
sudo service tgt restart
sudo service cinder-volume restart
sudo rm -f /var/lib/cinder/cinder.sqlite
# Not in the install-guide:
sudo rm -v /var/lib/cinder/cinder.sqlite
#------------------------------------------------------------------------------
# Verify the Block Storage installation
# http://docs.openstack.org/mitaka/install-guide-ubuntu/cinder-verify.html
# http://docs.openstack.org/newton/install-guide-ubuntu/cinder-verify.html
#------------------------------------------------------------------------------
echo "Verifying Block Storage installation on controller node."
@@ -114,17 +132,21 @@ echo "Verifying Block Storage installation on controller node."
echo "Sourcing the admin credentials."
AUTH="source $CONFIG_DIR/admin-openstackrc.sh"
# It takes time for Cinder to be aware of its services status.
# Force restart cinder API and wait for 20 seconds.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
echo "Restarting Cinder API."
node_ssh controller "sudo service cinder-api restart"
echo "Restarting restarting cinder-scheduler."
node_ssh controller "sudo service cinder-scheduler restart"
echo -n "Waiting for cinder to start."
until node_ssh controller "$AUTH; cinder service-list" >/dev/null 2>&1; do
echo -n .
sleep 1
done
echo
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "cinder service-list is available:"
node_ssh controller "$AUTH; cinder service-list"
@@ -165,6 +187,12 @@ function check_cinder_services {
echo -n "Waiting for all cinder services to start."
check_cinder_services
#------------------------------------------------------------------------------
# Verify the Block Storage installation
# http://docs.openstack.org/newton/install-guide-ubuntu/launch-instance-cinder.html
# (partial implementation without instance)
#------------------------------------------------------------------------------
echo "Sourcing the demo credentials."
AUTH="source $CONFIG_DIR/demo-openstackrc.sh"

View File

@@ -14,7 +14,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Install the Image Service (glance).
# http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/glance-install.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -27,7 +27,7 @@ setup_database glance "$GLANCE_DB_USER" "$GLANCE_DBPASS"
echo "Sourcing the admin credentials."
source "$CONFIG_DIR/admin-openstackrc.sh"
glance_admin_user=$(service_to_user_name glance)
glance_admin_user=glance
# Wait for keystone to come up
wait_for_keystone
@@ -43,11 +43,10 @@ openstack role add \
--user "$glance_admin_user" \
"$ADMIN_ROLE_NAME"
# Create glance user
echo "Registering glance with keystone so that other services can locate it."
openstack service create \
--name glance \
--description "OpenStack Image Service" \
--description "OpenStack Image" \
image
# Create glance endpoints.
@@ -132,17 +131,11 @@ echo "Restarting glance service."
sudo service glance-registry restart
sudo service glance-api restart
echo "Removing default SQLite database."
sudo rm -f /var/lib/glance/glance.sqlite
#------------------------------------------------------------------------------
# Verify the Image Service installation
# http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-verify.html
# http://docs.openstack.org/newton/install-guide-ubuntu/glance-verify.html
#------------------------------------------------------------------------------
# Our openstackrc.sh files already set OS_IMAGE_API_VERSION, we can skip this
# step in the install-guide.
echo -n "Waiting for glance to start."
until openstack image list >/dev/null 2>&1; do
sleep 1
@@ -150,7 +143,7 @@ until openstack image list >/dev/null 2>&1; do
done
echo
echo "Adding CirrOS image as $CIRROS_IMG_NAME to glance."
echo "Adding pre-downloaded CirrOS image as $CIRROS_IMG_NAME to glance."
openstack image create "$CIRROS_IMG_NAME" \
--file "$HOME/img/$(basename $CIRROS_URL)" \

View File

@@ -12,9 +12,12 @@ exec_logfile
indicate_current_auto
# Wait for keystone to come up
wait_for_keystone
#------------------------------------------------------------------------------
# Install the Orchestration Service (heat).
# http://docs.openstack.org/mitaka/install-guide-ubuntu/heat-install.html
# Install the Orchestration Service (heat)
# http://docs.openstack.org/project-install-guide/orchestration/newton/install-ubuntu.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -27,7 +30,7 @@ setup_database heat "$HEAT_DB_USER" "$HEAT_DBPASS"
echo "Sourcing the admin credentials."
source "$CONFIG_DIR/admin-openstackrc.sh"
heat_admin_user=$(service_to_user_name heat)
heat_admin_user=heat
# Wait for keystone to come up
wait_for_keystone
@@ -92,6 +95,7 @@ openstack user create \
openstack role add \
--domain heat \
--user-domain heat \
--user heat_domain_admin \
"$ADMIN_ROLE_NAME"
@@ -112,6 +116,7 @@ openstack role create "heat_stack_user"
echo "Installing heat."
# Not in install-guide:
# Prevent start of heat services here so they don't get confused by the default
# configuration files. Otherwise, it takes up to 3 minutes for the heat
# stack-list to appear after the heat services restart below.
@@ -157,7 +162,7 @@ iniset_sudo $conf keystone_authtoken username "$heat_admin_user"
iniset_sudo $conf keystone_authtoken password "$HEAT_PASS"
# Configure [trustee] section.
iniset_sudo $conf trustee auth_plugin password
iniset_sudo $conf trustee auth_type password
iniset_sudo $conf trustee auth_url http://controller:35357
iniset_sudo $conf trustee username "$heat_admin_user"
iniset_sudo $conf trustee password "$HEAT_PASS"
@@ -185,7 +190,7 @@ sudo heat-manage db_sync
# Finalize installation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Re-enable automatic start of heat services
# Not in install-guide: Re-enable automatic start of heat services
sudo rm /etc/init/heat-api.override
sudo rm /etc/init/heat-api-cfn.override
sudo rm /etc/init/heat-engine.override
@@ -196,21 +201,18 @@ sudo service heat-api restart
sudo service heat-api-cfn restart
sudo service heat-engine restart
echo -n "Waiting for heat stack-list."
until heat stack-list; do
echo -n "Waiting for openstack stack list."
until openstack stack list; do
sleep 1
echo -n .
done
ENDTIME=$(date +%s)
echo "Restarting heat servies took $((ENDTIME - STARTTIME)) seconds."
echo "Removing default SQLite database."
sudo rm -f /var/lib/heat/heat.sqlite
#------------------------------------------------------------------------------
# Verify operation of Orchestration Service (heat).
# http://docs.openstack.org/mitaka/install-guide-ubuntu/heat-verify.html
# http://docs.openstack.org/project-install-guide/orchestration/newton/verify.html
#------------------------------------------------------------------------------
echo "Listing service components."
heat service-list
openstack orchestration service list

View File

@@ -13,13 +13,19 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack Dashboard (horizon)
# http://docs.openstack.org/mitaka/install-guide-ubuntu/horizon-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/horizon-install.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and configure components
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Note: Installing the dashboard here reloads the apache configuration.
# Below, we are also changing the configuration and reloading it once we
# are done. This race can result in a stopped apache (which also means
# stopped keystone services). We can either sleep for a second
# after the "apt-get install" call below or do a restart instead
# of a reload when we are done changing the configuration files.
echo "Installing horizon."
sudo apt-get install -y openstack-dashboard
@@ -30,7 +36,7 @@ auth_host=controller
echo "Setting OPENSTACK_HOST = \"$auth_host\"."
iniset_sudo_no_section $conf "OPENSTACK_HOST" "\"$auth_host\""
echo "Allowing all hosts to access the dashboard: "
echo "Allowing all hosts to access the dashboard:"
iniset_sudo_no_section $conf "ALLOWED_HOSTS" "['*', ]"
echo "Telling horizon to use the cache for sessions."
@@ -38,7 +44,7 @@ iniset_sudo_no_section $conf "SESSION_ENGINE" "'django.contrib.sessions.backends
echo "Setting interface location of memcached."
sudo sed -i "/LOCATION/ s/127.0.0.1/controller/" $conf
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Comparing $conf to memcached.conf."
memcached_conf=/etc/memcached.conf
# Port is a number on line starting with "-p "
@@ -62,6 +68,7 @@ fi
echo "CACHES configuration in $conf:"
awk '/^CACHES =/,/^}/' $conf
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Enabling Identity API version 3."
iniset_sudo_no_section $conf "OPENSTACK_KEYSTONE_URL" '"http://%s:5000/v3" % OPENSTACK_HOST'
@@ -92,7 +99,7 @@ echo "Setting timezone to UTC."
iniset_sudo_no_section $conf "TIME_ZONE" '"UTC"'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Customize Horizon
# Customize Horizon (not in install-guide)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Removing default Ubuntu theme."
@@ -103,4 +110,5 @@ sudo apt-get remove --auto-remove -y openstack-dashboard-ubuntu-theme
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Reloading the web server configuration."
sudo service apache2 reload
# Restarting instead of reloading for reasons explained in comment above.
sudo service apache2 restart

View File

@@ -15,31 +15,29 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up keystone for controller node
# http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/keystone-install.html
#------------------------------------------------------------------------------
echo "Setting up database for keystone."
setup_database keystone "$KEYSTONE_DB_USER" "$KEYSTONE_DBPASS"
# Create a "shared secret" used as OS_TOKEN, together with OS_URL, before
# keystone can be used for authentication
echo -n "Using openssl to generate a random admin token: "
ADMIN_TOKEN=$(openssl rand -hex 10)
echo "$ADMIN_TOKEN"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Not in install-guide:
echo "Sanity check: local auth should work."
mysql -u keystone -p"$KEYSTONE_DBPASS" keystone -e quit
echo "Sanity check: remote auth should work."
mysql -u keystone -p"$KEYSTONE_DBPASS" keystone -h controller -e quit
echo "Disabling the keystone service from starting automatically after installation."
# Will not be re-enabled because apache2 wsgi serves these ports now
echo "manual" | sudo tee /etc/init/keystone.override
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and configure components
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing keystone packages."
sudo apt-get install -y keystone apache2 libapache2-mod-wsgi
echo "Installing keystone."
sudo apt-get install -y keystone
conf=/etc/keystone/keystone.conf
echo "Configuring [DEFAULT] section in $conf."
echo "Setting admin_token to bootstrap authentication."
iniset_sudo $conf DEFAULT admin_token "$ADMIN_TOKEN"
echo "Editing $conf."
function get_database_url {
local db_user=$KEYSTONE_DB_USER
@@ -50,8 +48,6 @@ function get_database_url {
database_url=$(get_database_url)
echo "Configuring [database] section in /etc/keystone/keystone.conf."
echo "Setting database connection: $database_url."
iniset_sudo $conf database connection "$database_url"
@@ -61,72 +57,43 @@ iniset_sudo $conf token provider fernet
echo "Creating the database tables for keystone."
sudo keystone-manage db_sync
echo "Initializing Fernet keys."
echo "Initializing Fernet key repositories."
sudo keystone-manage fernet_setup \
--keystone-user keystone \
--keystone-group keystone
# Configure Apache HTTP server.
sudo keystone-manage credential_setup \
--keystone-user keystone \
--keystone-group keystone
echo "Bootstrapping the Identity service."
sudo keystone-manage bootstrap --bootstrap-password "$ADMIN_PASS" \
--bootstrap-admin-url http://controller:35357/v3/ \
--bootstrap-internal-url http://controller:35357/v3/ \
--bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id "$REGION"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Configure the Apache HTTP server
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
conf=/etc/apache2/apache2.conf
echo "Configuring ServerName option in $conf to reference controller node."
echo "ServerName controller" | sudo tee -a $conf
echo "Creating /etc/apache2/sites-available/wsgi-keystone.conf."
cat << WSGI | sudo tee -a /etc/apache2/sites-available/wsgi-keystone.conf
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog /var/log/apache2/keystone.log
CustomLog /var/log/apache2/keystone_access.log combined
conf=/etc/apache2/sites-enabled/keystone.conf
if [ -f $conf ]; then
echo "Identity service virtual hosts enabled already."
else
echo "Enabling the Identity service virtual hosts."
sudo ln -s /etc/apache2/sites-available/keystone.conf \
/etc/apache2/sites-enabled
fi
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog /var/log/apache2/keystone.log
CustomLog /var/log/apache2/keystone_access.log combined
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
</VirtualHost>
WSGI
echo "Enabling the identity service virtual hosts."
sudo ln -s /etc/apache2/sites-available/wsgi-keystone.conf /etc/apache2/sites-enabled
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Finalize the installation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Restarting apache."
sudo service apache2 restart
@@ -134,72 +101,23 @@ sudo service apache2 restart
echo "Removing default SQLite database."
sudo rm -f /var/lib/keystone/keystone.db
#------------------------------------------------------------------------------
# Create the service entity and API endpoints
# http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-services.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Prerequisites
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Using OS_TOKEN, OS_URL for authentication."
export OS_TOKEN=$ADMIN_TOKEN
export OS_URL=http://controller:35357/v3
# Set environment variables for authentication
export OS_USERNAME=$ADMIN_USER_NAME
export OS_PASSWORD=$ADMIN_PASS
export OS_PROJECT_NAME=$ADMIN_PROJECT_NAME
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create the service entity and API endpoints
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Creating keystone service."
openstack service create \
--name keystone \
--description "OpenStack Identity" \
identity
echo "Creating endpoints for keystone."
openstack endpoint create --region "$REGION" \
identity public http://controller:5000/v3
openstack endpoint create --region "$REGION" \
identity internal http://controller:5000/v3
openstack endpoint create --region "$REGION" \
identity admin http://controller:35357/v3
#------------------------------------------------------------------------------
# Create projects, users, and roles
# http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-users.html
# Create a domain, projects, users, and roles
# http://docs.openstack.org/newton/install-guide-ubuntu/keystone-users.html
#------------------------------------------------------------------------------
# Wait for keystone to come up
wait_for_keystone
echo "Creating default domain."
openstack domain create \
--description "Default Domain" \
default
echo "Creating admin project."
openstack project create --domain default \
--description "Admin Project" \
"$ADMIN_PROJECT_NAME"
echo "Creating admin user."
openstack user create --domain default \
--password "$ADMIN_PASS" \
"$ADMIN_USER_NAME"
echo "Creating admin role."
openstack role create "$ADMIN_ROLE_NAME"
echo "Adding admin role to admin project."
openstack role add \
--project "$ADMIN_PROJECT_NAME" \
--user "$ADMIN_USER_NAME" \
"$ADMIN_ROLE_NAME"
echo "Creating service project."
openstack project create --domain default \
--description "Service Project" \
@@ -227,23 +145,21 @@ openstack role add \
#------------------------------------------------------------------------------
# Verify operation
# http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-verify.html
# http://docs.openstack.org/newton/install-guide-ubuntu/keystone-verify.html
#------------------------------------------------------------------------------
echo "Verifying keystone installation."
# Disable temporary authentication token mechanism
# Disable the temporary authentication token mechanism
conf=/etc/keystone/keystone-paste.ini
echo "Removing admin_token_auth from pipelines."
sudo ls -l $conf
sudo sed -i '/^pipeline = / s/admin_token_auth //' $conf
sudo ls -l $conf
for section in pipeline:public_api pipeline:admin_api pipeline:api_v3; do
if ini_has_option_sudo $conf $section admin_token_auth; then
echo "Disabling admin_token_auth in section $section."
inicomment_sudo $conf $section admin_token_auth
fi
done
# XXX still in install-guide, but no longer necessary
# From this point on, we are going to use keystone for authentication
unset OS_TOKEN OS_URL
unset OS_URL
echo "Requesting an authentication token as an admin user."
openstack \
@@ -256,39 +172,6 @@ openstack \
--os-password "$ADMIN_PASS" \
token issue
#echo "Requesting project list."
#openstack \
# --os-auth-url http://controller:35357 \
# --os-project-domain-name default \
# --os-user-domain-name default \
# --os-project-name "$ADMIN_PROJECT_NAME" \
# --os-username "$ADMIN_USER_NAME" \
# --os-auth-type password \
# --os-password "$ADMIN_PASS" \
# project list
#
#echo "Requesting user list."
#openstack \
# --os-auth-url http://controller:35357/v3 \
# --os-project-domain-name default \
# --os-user-domain-name default \
# --os-project-name "$ADMIN_PROJECT_NAME" \
# --os-username "$ADMIN_USER_NAME" \
# --os-auth-type password \
# --os-password "$ADMIN_PASS" \
# user list
#
#echo "Requesting role list."
#openstack \
# --os-auth-url http://controller:35357/v3 \
# --os-project-domain-name default \
# --os-user-domain-name default \
# --os-project-name "$ADMIN_PROJECT_NAME" \
# --os-username "$ADMIN_USER_NAME" \
# --os-auth-type password \
# --os-password "$ADMIN_PASS" \
# role list
echo "Requesting an authentication token for the demo user."
openstack \
--os-auth-url http://controller:5000/v3 \
@@ -299,22 +182,3 @@ openstack \
--os-auth-type password \
--os-password "$DEMO_PASS" \
token issue
#echo "Verifying that an admin-only request by the demo user is denied."
#openstack \
# --os-auth-url http://controller:5000/v3 \
# --os-project-domain-name default \
# --os-user-domain-name default \
# --os-project-name "$DEMO_PROJECT_NAME" \
# --os-username "$DEMO_USER_NAME" \
# --os-auth-type password \
# --os-password "$DEMO_PASS" \
# user list || rc=$?
#
#echo rc=$rc
#if [ $rc -eq 0 ]; then
# echo "The request was not denied. This is an error. Exiting."
# exit 1
#else
# echo "The request was correctly denied."
#fi

View File

@@ -15,7 +15,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for compute node.
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-compute-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-compute-install.html
#------------------------------------------------------------------------------
echo "Installing networking components for compute node."
@@ -40,7 +40,7 @@ iniset_sudo $conf oslo_messaging_rabbit rabbit_password "$RABBIT_PASS"
# Configuring [DEFAULT] section
iniset_sudo $conf DEFAULT auth_strategy keystone
neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_user=neutron
# Configuring [keystone_authtoken] section
iniset_sudo $conf keystone_authtoken auth_uri http://controller:5000

View File

@@ -15,23 +15,20 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for compute node.
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-compute-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-compute-install.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Configure Compute to use Networking
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_user=neutron
echo "Configuring Compute to use Networking."
conf=/etc/nova/nova.conf
iniset_sudo $conf neutron url http://controller:9696
iniset_sudo $conf neutron auth_url http://controller:35357
# No complaints without auth_type
#iniset_sudo $conf neutron auth_type password
# without this auth_plugin, launch vm failed (image not found, flavor not found etc.)
iniset_sudo $conf neutron auth_plugin password
iniset_sudo $conf neutron auth_type password
iniset_sudo $conf neutron project_domain_name default
iniset_sudo $conf neutron user_domain_name default
iniset_sudo $conf neutron region_name "$REGION"
@@ -51,13 +48,13 @@ sudo service neutron-linuxbridge-agent restart
#------------------------------------------------------------------------------
# Networking Option 2: Self-service networks
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-verify-option2.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-verify-option2.html
#------------------------------------------------------------------------------
echo "Sourcing the admin credentials."
source "$CONFIG_DIR/admin-openstackrc.sh"
echo "List agents to verify successful launch of the neutron agents."
echo "Listing agents to verify successful launch of the neutron agents."
echo "neutron agent-list"
neutron agent-list

View File

@@ -14,7 +14,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for controller node.
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-controller-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-controller-install.html
#------------------------------------------------------------------------------
echo "Setting up database for neutron."
@@ -22,7 +22,7 @@ setup_database neutron "$NEUTRON_DB_USER" "$NEUTRON_DBPASS"
source "$CONFIG_DIR/admin-openstackrc.sh"
neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_user=neutron
# Wait for keystone to come up
wait_for_keystone

View File

@@ -14,12 +14,12 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for controller node.
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-controller-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-controller-install.html
#------------------------------------------------------------------------------
source "$CONFIG_DIR/admin-openstackrc.sh"
neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_user=neutron
# Wait for keystone to come up
wait_for_keystone
@@ -30,18 +30,7 @@ wait_for_keystone
echo "Configuring the metadata agent."
conf=/etc/neutron/metadata_agent.ini
iniset_sudo $conf DEFAULT auth_uri http://controller:5000
iniset_sudo $conf DEFAULT auth_url http://controller:35357
iniset_sudo $conf DEFAULT auth_region "$REGION"
iniset_sudo $conf DEFAULT auth_type password
iniset_sudo $conf DEFAULT project_domain_name default
iniset_sudo $conf DEFAULT user_domain_name default
iniset_sudo $conf DEFAULT project_name "$SERVICE_PROJECT_NAME"
iniset_sudo $conf DEFAULT username "$neutron_admin_user"
iniset_sudo $conf DEFAULT password "$NEUTRON_PASS"
iniset_sudo $conf DEFAULT nova_metadata_ip controller
iniset_sudo $conf DEFAULT metadata_proxy_shared_secret "$METADATA_SECRET"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -52,19 +41,13 @@ echo "Configuring Compute to use Networking."
conf=/etc/nova/nova.conf
iniset_sudo $conf neutron url http://controller:9696
iniset_sudo $conf neutron auth_url http://controller:35357
# no complaints without auth_type
#iniset_sudo $conf neutron auth_type password
# without this auth_plugin line, we get
# Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
# <class 'neutronclient.common.exceptions.Unauthorized'> (HTTP 500) (Request-ID: req-1ac10a31-4da0-4bdc-8f9f-7d941b408072)
iniset_sudo $conf neutron auth_plugin password
iniset_sudo $conf neutron auth_type password
iniset_sudo $conf neutron project_domain_name default
iniset_sudo $conf neutron user_domain_name default
iniset_sudo $conf neutron region_name "$REGION"
iniset_sudo $conf neutron project_name "$SERVICE_PROJECT_NAME"
iniset_sudo $conf neutron username "$neutron_admin_user"
iniset_sudo $conf neutron password "$NEUTRON_PASS"
iniset_sudo $conf neutron service_metadata_proxy True
iniset_sudo $conf neutron metadata_proxy_shared_secret "$METADATA_SECRET"
@@ -72,6 +55,7 @@ iniset_sudo $conf neutron metadata_proxy_shared_secret "$METADATA_SECRET"
# Finalize installation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Populating the database."
sudo neutron-db-manage \
--config-file /etc/neutron/neutron.conf \
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini \
@@ -98,17 +82,16 @@ if type neutron-l3-agent; then
sudo service neutron-l3-agent restart
fi
echo "Removing default SQLite database."
sudo rm -f /var/lib/neutron/neutron.sqlite
#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for controller node.
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-verify.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-verify.html
#------------------------------------------------------------------------------
echo "Verifying operation."
echo -n "Verifying operation."
until neutron ext-list >/dev/null 2>&1; do
sleep 1
echo -n .
done
echo
neutron ext-list

View File

@@ -14,18 +14,17 @@ exec_logfile
indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack Compute (nova) for compute node.
# http://docs.openstack.org/mitaka/install-guide-ubuntu/nova-compute-install.html
# Install and configure a compute node
# http://docs.openstack.org/newton/install-guide-ubuntu/nova-compute-install.html
#------------------------------------------------------------------------------
echo "Installing nova for compute node."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# NOTE We deviate slightly from the install-guide here because inside our VMs,
# we cannot use KVM inside VirtualBox.
# TODO Add option to use nova-compute instead if we are inside a VM that allows
# using KVM.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing nova for compute node."
sudo apt-get install -y nova-compute-qemu
echo "Configuring nova for compute node."
@@ -34,6 +33,7 @@ conf=/etc/nova/nova.conf
echo "Configuring $conf."
# Configure [DEFAULT] section.
iniset_sudo $conf DEFAULT enabled_apis osapi_compute,metadata
iniset_sudo $conf DEFAULT rpc_backend rabbit
# Configure [oslo_messaging_rabbit] section.
@@ -44,7 +44,7 @@ iniset_sudo $conf oslo_messaging_rabbit rabbit_password "$RABBIT_PASS"
# Configuring [DEFAULT] section.
iniset_sudo $conf DEFAULT auth_strategy keystone
nova_admin_user=$(service_to_user_name nova)
nova_admin_user=nova
MY_MGMT_IP=$(get_node_ip_in_network "$(hostname)" "mgmt")
@@ -100,5 +100,16 @@ echo "Config: $(sudo grep virt_type $conf)"
echo "Restarting nova services."
sudo service nova-compute restart
# Not in install-guide:
# Remove SQLite database created by Ubuntu package for nova.
sudo rm -v /var/lib/nova/nova.sqlite
#------------------------------------------------------------------------------
# Verify operation
# http://docs.openstack.org/newton/install-guide-ubuntu/nova-verify.html
#------------------------------------------------------------------------------
echo "Verifying operation of the Compute service."
echo "openstack compute service list"
openstack compute service list

View File

@@ -14,7 +14,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Install Compute controller services
# http://docs.openstack.org/mitaka/install-guide-ubuntu/nova-controller-install.html
# http://docs.openstack.org/newton/install-guide-ubuntu/nova-controller-install.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -30,7 +30,7 @@ setup_database nova_api "$NOVA_DB_USER" "$NOVA_DBPASS"
echo "Sourcing the admin credentials."
source "$CONFIG_DIR/admin-openstackrc.sh"
nova_admin_user=$(service_to_user_name nova)
nova_admin_user=nova
# Wait for keystone to come up
wait_for_keystone
@@ -70,8 +70,8 @@ openstack endpoint create \
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing nova for controller node."
sudo apt-get install -y nova-api nova-cert nova-conductor \
nova-consoleauth nova-novncproxy nova-scheduler
sudo apt-get install -y nova-api nova-conductor nova-consoleauth \
nova-novncproxy nova-scheduler
conf=/etc/nova/nova.conf
@@ -128,9 +128,11 @@ iniset_sudo $conf glance api_servers http://controller:9292
iniset_sudo $conf oslo_concurrency lock_path /var/lib/nova/tmp
# Delete logdir line
# According to install-guide, "Due to a packaging bug, remove the logdir option
# from the [DEFAULT] section."
sudo sed -i "/^logdir/ d" $conf
echo "Creating the database tables for nova."
echo "Populating the Compute databases."
sudo nova-manage api_db sync
sudo nova-manage db sync
@@ -139,33 +141,28 @@ sudo nova-manage db sync
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Restarting nova services."
declare -a nova_services=(nova-api nova-cert nova-consoleauth \
nova-scheduler nova-conductor nova-novncproxy)
declare -a nova_services=(nova-api nova-consoleauth nova-scheduler \
nova-conductor nova-novncproxy)
for nova_service in "${nova_services[@]}"; do
echo "Restarting $nova_service."
sudo service "$nova_service" restart
done
# Not in install-guide:
echo "Removing default SQLite database."
sudo rm -f /var/lib/nova/nova.sqlite
sudo rm -v /var/lib/nova/nova.sqlite
#------------------------------------------------------------------------------
# Verify the Compute controller installation
# Verify the Compute controller installation (not in install-guide)
#------------------------------------------------------------------------------
echo "Verify nova service status."
echo "Checking nova services."
loop=0
echo -n "Verifying operation of the Compuyte service."
until openstack service list 2>/dev/null; do
echo -n .
loop=$((loop+1))
if ((loop%10 == 0)); then
echo
echo still checking
fi
sleep 1
echo -n .
done
echo
echo "Checking nova endpoints."
openstack catalog list

View File

@@ -14,7 +14,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Networking Option 2: Self-service networks
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-compute-install-option2.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-compute-install-option2.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -36,9 +36,6 @@ iniset_sudo $conf vxlan enable_vxlan True
iniset_sudo $conf vxlan local_ip $OVERLAY_INTERFACE_IP_ADDRESS
iniset_sudo $conf vxlan l2_population True
# Edit the [agent] section.
iniset_sudo $conf agent prevent_arp_spoofing True
# Edit the [securitygroup] section.
iniset_sudo $conf securitygroup enable_security_group True
iniset_sudo $conf securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

View File

@@ -15,7 +15,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Networking Option 2: Self-service networks
# http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-controller-install-option2.html
# http://docs.openstack.org/newton/install-guide-ubuntu/neutron-controller-install-option2.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -38,11 +38,9 @@ function get_database_url {
database_url=$(get_database_url)
# Get neutron service info.
neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_user=neutron
# Get nova service info.
nova_admin_user=$(service_to_user_name nova)
nova_admin_user=nova
echo "Setting database connection: $database_url."
conf=/etc/neutron/neutron.conf
@@ -79,7 +77,6 @@ iniset_sudo $conf keystone_authtoken password "$NEUTRON_PASS"
# Configure nova related parameters
iniset_sudo $conf DEFAULT notify_nova_on_port_status_changes True
iniset_sudo $conf DEFAULT notify_nova_on_port_data_changes True
iniset_sudo $conf DEFAULT nova_url http://controller:8774/v2
# Configure [nova] section.
iniset_sudo $conf nova auth_url http://controller:35357
@@ -131,9 +128,6 @@ iniset_sudo $conf vxlan enable_vxlan True
iniset_sudo $conf vxlan local_ip $OVERLAY_INTERFACE_IP_ADDRESS
iniset_sudo $conf vxlan l2_population True
# Edit the [agent] section.
iniset_sudo $conf agent prevent_arp_spoofing True
# Edit the [securitygroup] section.
iniset_sudo $conf securitygroup enable_security_group True
iniset_sudo $conf securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
@@ -160,6 +154,7 @@ iniset_sudo $conf DEFAULT interface_driver neutron.agent.linux.interface.BridgeI
iniset_sudo $conf DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
iniset_sudo $conf DEFAULT enable_isolated_metadata True
# Not in install-guide:
iniset_sudo $conf DEFAULT dnsmasq_config_file /etc/neutron/dnsmasq-neutron.conf
cat << DNSMASQ | sudo tee /etc/neutron/dnsmasq-neutron.conf

View File

@@ -15,13 +15,17 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Enable Compute service meters
# http://docs.openstack.org/mitaka/install-guide-ubuntu/ceilometer-nova.html
# http://docs.openstack.org/project-install-guide/telemetry/newton/configure_services/nova/install-nova-ubuntu.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and configure components
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Installing ceilometer."
sudo apt-get install -y ceilometer-agent-compute
ceilometer_admin_user=$(service_to_user_name ceilometer)
ceilometer_admin_user=ceilometer
conf=/etc/ceilometer/ceilometer.conf
echo "Configuring $conf."
@@ -49,15 +53,19 @@ iniset_sudo $conf keystone_authtoken username "$ceilometer_admin_user"
iniset_sudo $conf keystone_authtoken password "$CEILOMETER_PASS"
# Configure [service_credentials] section.
iniset_sudo $conf service_credentials os_auth_url http://controller:5000/v2.0
iniset_sudo $conf service_credentials os_username "$ceilometer_admin_user"
iniset_sudo $conf service_credentials os_tenant_name "$SERVICE_PROJECT_NAME"
iniset_sudo $conf service_credentials os_password "$CEILOMETER_PASS"
iniset_sudo $conf service_credentials auth_url http://controller:5000
iniset_sudo $conf service_credentials project_domain_id default
iniset_sudo $conf service_credentials user_domain_id default
iniset_sudo $conf service_credentials auth_type password
iniset_sudo $conf service_credentials username "$ceilometer_admin_user"
iniset_sudo $conf service_credentials project_name "$SERVICE_PROJECT_NAME"
iniset_sudo $conf service_credentials password "$CEILOMETER_PASS"
iniset_sudo $conf service_credentials interface internalURL
iniset_sudo $conf service_credentials region_name "$REGION"
# Marked "optional" in install-guide
iniset_sudo $conf DEFAULT verbose True
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Configure Compute to use Telemetry
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Configuring nova.conf."
conf=/etc/ceilometer/ceilometer.conf
@@ -66,7 +74,12 @@ conf=/etc/ceilometer/ceilometer.conf
iniset_sudo $conf DEFAULT instance_usage_audit True
iniset_sudo $conf DEFAULT instance_usage_audit_period hour
iniset_sudo $conf DEFAULT notify_on_state_change vm_and_task_state
iniset_sudo $conf DEFAULT notification_driver messagingv2
iniset_sudo $conf oslo_messaging_notifications driver messagingv2
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Finalize installation
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Restarting telemetry service."
sudo service ceilometer-agent-compute restart
@@ -76,7 +89,7 @@ sudo service nova-compute restart
#------------------------------------------------------------------------------
# Enable Block Storage meters
# http://docs.openstack.org/mitaka/install-guide-ubuntu/ceilometer-cinder.html
# http://docs.openstack.org/project-install-guide/telemetry/newton/configure_services/cinder/install-cinder-ubuntu.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -88,12 +101,12 @@ echo "Configuring $conf."
iniset_sudo $conf oslo_messaging_notifications driver messagingv2
echo "Restarting cinder-volumes service."
echo "Restarting the Block Storage services."
sudo service cinder-volume restart
#------------------------------------------------------------------------------
# Verify operation
# http://docs.openstack.org/mitaka/install-guide-ubuntu/ceilometer-verify.html
# http://docs.openstack.org/project-install-guide/telemetry/newton/verify.html
#------------------------------------------------------------------------------
echo "Verifying the Telemetry installation."

View File

@@ -15,7 +15,7 @@ indicate_current_auto
#------------------------------------------------------------------------------
# Install the Telemetry service
# http://docs.openstack.org/mitaka/install-guide-ubuntu/ceilometer-install.html
# http://docs.openstack.org/project-install-guide/telemetry/newton/install-base-ubuntu.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -23,7 +23,7 @@ indicate_current_auto
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create Ceilometer user and database.
ceilometer_admin_user=$(service_to_user_name ceilometer)
ceilometer_admin_user=ceilometer
mongodb_user=$CEILOMETER_DB_USER
@@ -117,24 +117,54 @@ iniset_sudo $conf keystone_authtoken username "$ceilometer_admin_user"
iniset_sudo $conf keystone_authtoken password "$CEILOMETER_PASS"
# Configure [service_credentials] section.
iniset_sudo $conf service_credentials os_auth_url http://controller:5000/v2.0
iniset_sudo $conf service_credentials os_username "$ceilometer_admin_user"
iniset_sudo $conf service_credentials os_tenant_name "$SERVICE_PROJECT_NAME"
iniset_sudo $conf service_credentials os_password "$CEILOMETER_PASS"
iniset_sudo $conf service_credentials auth_type password
iniset_sudo $conf service_credentials os_auth_url http://controller:5000/v3
iniset_sudo $conf service_credentials project_domain_name default
iniset_sudo $conf service_credentials user_domain_name default
iniset_sudo $conf service_credentials project_name "$SERVICE_PROJECT_NAME"
iniset_sudo $conf service_credentials username "$ceilometer_admin_user"
iniset_sudo $conf service_credentials password "$CEILOMETER_PASS"
iniset_sudo $conf service_credentials interface internalURL
iniset_sudo $conf service_credentials region_name "$REGION"
iniset_sudo $conf DEFAULT verbose True
# FIXME /var/www/cgi-bin/ceilometer/app does not exist
echo "Creating /etc/apache2/sites-available/wsgi-ceilometer.conf"
cat << WSGI | sudo tee -a /etc/apache2/sites-available/wsgi-ceilometer.conf
Listen 8777
<VirtualHost *:8777>
WSGIDaemonProcess ceilometer-api processes=2 threads=10 user=ceilometer group=ceilometer display-name=%{GROUP}
WSGIProcessGroup ceilometer-api
WSGIScriptAlias / "/var/www/cgi-bin/ceilometer/app"
WSGIApplicationGroup %{GLOBAL}
ErrorLog /var/log/apache2/ceilometer_error.log
CustomLog /var/log/apache2/ceilometer_access.log combined
</VirtualHost>
WSGISocketPrefix /var/run/apache2
WSGI
echo "Enabling the Telemetry service virtual hosts."
# FIXME The documentation uses ceilometer here
# https://bugs.launchpad.net/ceilometer/+bug/1631629
sudo a2ensite wsgi-ceilometer
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and configure components
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Reloading the Apache HTTP server."
sudo service apache2 reload
echo "Restarting telemetry service."
sudo service ceilometer-agent-central restart
sudo service ceilometer-agent-notification restart
sudo service ceilometer-api restart
sudo service ceilometer-collector restart
#------------------------------------------------------------------------------
# Enable Image service meters
# http://docs.openstack.org/mitaka/install-guide-ubuntu/ceilometer-glance.html
# http://docs.openstack.org/project-install-guide/telemetry/newton/configure_services/glance/install-glance-ubuntu.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -169,12 +199,13 @@ iniset_sudo $conf oslo_messaging_rabbit rabbit_host controller
iniset_sudo $conf oslo_messaging_rabbit rabbit_userid openstack
iniset_sudo $conf oslo_messaging_rabbit rabbit_password "$RABBIT_PASS"
echo "Restarting the Image service."
sudo service glance-registry restart
sudo service glance-api restart
#------------------------------------------------------------------------------
# Enable Block Storage meters
# http://docs.openstack.org/mitaka/install-guide-ubuntu/ceilometer-cinder.html
# http://docs.openstack.org/project-install-guide/telemetry/newton/configure_services/cinder/install-cinder-ubuntu.html
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -185,8 +216,8 @@ conf=/etc/cinder/cinder.conf
echo "Configuring $conf."
# Configure [oslo_messaging_notifications] section.
iniset_sudo $conf oslo_messaging_notifications notification_driver messagingv2
iniset_sudo $conf oslo_messaging_notifications driver messagingv2
echo "Restarting cinder services."
echo "Restarting the Block Storage services on the controller node."
sudo service cinder-api restart
sudo service cinder-scheduler restart

0
labs/osbash/tools/repeat-test.sh Normal file → Executable file
View File