Andy Bavier | b146f7f | 2016-02-12 10:03:35 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Andy Bavier | 2c108de | 2016-02-18 16:55:00 -0500 | [diff] [blame] | 3 | TESTING=false |
| 4 | |
| 5 | while [[ $# > 0 ]] |
| 6 | do |
| 7 | key="$1" |
| 8 | |
| 9 | case $key in |
| 10 | --testing) |
| 11 | TESTING=true |
| 12 | ;; |
| 13 | *) |
| 14 | ;; |
| 15 | esac |
| 16 | shift |
| 17 | done |
| 18 | |
Andy Bavier | b146f7f | 2016-02-12 10:03:35 -0500 | [diff] [blame] | 19 | function 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 Bavier | 2c108de | 2016-02-18 16:55:00 -0500 | [diff] [blame] | 27 | 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 Bavier | b437b5c | 2016-02-23 11:50:30 -0500 | [diff] [blame] | 34 | # uvt-kvm wait --insecure $NAME |
Andy Bavier | b146f7f | 2016-02-12 10:03:35 -0500 | [diff] [blame] | 35 | fi |
| 36 | } |
| 37 | |
Andy Bavier | b437b5c | 2016-02-23 11:50:30 -0500 | [diff] [blame] | 38 | function wait-for-vm { |
| 39 | NAME=$1 |
| 40 | uvt-kvm wait --insecure $NAME |
| 41 | } |
| 42 | |
Andy Bavier | b146f7f | 2016-02-12 10:03:35 -0500 | [diff] [blame] | 43 | create-vm juju 1 2048 20 |
| 44 | create-vm mysql 2 4096 40 |
| 45 | create-vm rabbitmq-server 2 4096 40 |
| 46 | create-vm keystone 2 4096 40 |
| 47 | create-vm glance 2 4096 160 |
| 48 | create-vm nova-cloud-controller 2 4096 40 |
Andy Bavier | b146f7f | 2016-02-12 10:03:35 -0500 | [diff] [blame] | 49 | create-vm neutron-api 2 4096 40 |
| 50 | create-vm openstack-dashboard 1 2048 20 |
| 51 | create-vm ceilometer 1 2048 20 |
| 52 | create-vm nagios 1 2048 20 |
Andy Bavier | 2c108de | 2016-02-18 16:55:00 -0500 | [diff] [blame] | 53 | |
| 54 | create-vm xos 2 4096 40 |
| 55 | create-vm onos-cord 2 4096 40 |
| 56 | if $TESTING |
| 57 | then |
| 58 | create-vm nova-compute 2 4096 100 |
| 59 | fi |
Andy Bavier | b437b5c | 2016-02-23 11:50:30 -0500 | [diff] [blame] | 60 | |
| 61 | # Wait for everything to get set up |
| 62 | wait-for-vm juju |
| 63 | wait-for-vm mysql |
| 64 | wait-for-vm rabbitmq-server |
| 65 | wait-for-vm keystone |
| 66 | wait-for-vm glance |
| 67 | wait-for-vm nova-cloud-controller |
| 68 | wait-for-vm neutron-api |
| 69 | wait-for-vm openstack-dashboard |
| 70 | wait-for-vm ceilometer |
| 71 | wait-for-vm nagios |
| 72 | |
| 73 | wait-for-vm xos |
| 74 | wait-for-vm onos-cord |
| 75 | if $TESTING |
| 76 | then |
| 77 | wait-for-vm nova-compute |
| 78 | fi |