blob: 10c69d8e696ca2f34636f8e7f22249533af6b1fd [file] [log] [blame]
Andy Bavierb146f7f2016-02-12 10:03:35 -05001#!/bin/bash
2
Andy Bavier2c108de2016-02-18 16:55:00 -05003TESTING=false
4
5while [[ $# > 0 ]]
6do
7key="$1"
8
9case $key in
10 --testing)
11 TESTING=true
12 ;;
13 *)
14 ;;
15esac
16shift
17done
18
Andy Bavierb146f7f2016-02-12 10:03:35 -050019function create-vm {
20 NAME=$1
21 CPU=$2
22 MEM_MB=$3
23 DISK_GB=$4
24 uvt-kvm list | grep $1
25 if [ "$?" -ne "0" ]
26 then
Andy Bavier2c108de2016-02-18 16:55:00 -050027 if $TESTING
28 then
29 # Don't use mgmtbr for testing
30 uvt-kvm create $NAME --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB
31 else
32 uvt-kvm create $NAME --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB --bridge mgmtbr
33 fi
Andy Bavierb437b5c2016-02-23 11:50:30 -050034 # uvt-kvm wait --insecure $NAME
Andy Bavierb146f7f2016-02-12 10:03:35 -050035 fi
36}
37
Andy Bavierb437b5c2016-02-23 11:50:30 -050038function wait-for-vm {
Andy Bavier64a18752016-03-01 13:13:11 -050039 NAME=$1
40 until dig $NAME && ssh ubuntu@$NAME "ls"
41 do
42 sleep 1
43 done
Andy Bavierb437b5c2016-02-23 11:50:30 -050044}
45
Andy Bavierb146f7f2016-02-12 10:03:35 -050046create-vm juju 1 2048 20
47create-vm mysql 2 4096 40
48create-vm rabbitmq-server 2 4096 40
49create-vm keystone 2 4096 40
50create-vm glance 2 4096 160
51create-vm nova-cloud-controller 2 4096 40
Andy Bavierb146f7f2016-02-12 10:03:35 -050052create-vm neutron-api 2 4096 40
53create-vm openstack-dashboard 1 2048 20
54create-vm ceilometer 1 2048 20
55create-vm nagios 1 2048 20
Andy Bavier2c108de2016-02-18 16:55:00 -050056
57create-vm xos 2 4096 40
58create-vm onos-cord 2 4096 40
Andy Bavier64a18752016-03-01 13:13:11 -050059create-vm onos-fabric 2 4096 40
Andy Bavier2c108de2016-02-18 16:55:00 -050060if $TESTING
61then
Andy Bavier2bb7eef2016-04-06 15:26:49 -040062 create-vm nova-compute 6 16384 240
Andy Bavier2c108de2016-02-18 16:55:00 -050063fi
Andy Bavierb437b5c2016-02-23 11:50:30 -050064
65# Wait for everything to get set up
66wait-for-vm juju
67wait-for-vm mysql
68wait-for-vm rabbitmq-server
69wait-for-vm keystone
70wait-for-vm glance
71wait-for-vm nova-cloud-controller
72wait-for-vm neutron-api
73wait-for-vm openstack-dashboard
74wait-for-vm ceilometer
75wait-for-vm nagios
76
77wait-for-vm xos
78wait-for-vm onos-cord
Andy Bavier64a18752016-03-01 13:13:11 -050079wait-for-vm onos-fabric
Andy Bavierb437b5c2016-02-23 11:50:30 -050080if $TESTING
81then
82 wait-for-vm nova-compute
83fi