24
20
# If not on bare metal, add extra port to overcloud neutron-gateway and configure charm to use it
25
21
if [[ "${BARE_METAL^^}" != "TRUE" ]]; then
27
# ens6 is a brittle hack for late-landing Xenial net dev name change
28
./bin/post-deploy-config neutron-gateway ens6
23
./bin/post-deploy-config neutron-gateway
31
26
# Configure neutron networking on overcloud
33
./bin/quantum-ext-net --network-type $net_type -g $GATEWAY -c $CIDR_EXT -f $FIP_RANGE ext_net
28
./bin/neutron-ext-net --network-type flat -g $GATEWAY -c $CIDR_EXT -f $FIP_RANGE ext_net
34
29
./bin/quantum-tenant-net --network-type $net_type -t admin -r provider-router -N $NAMESERVER private $CIDR_PRIV
36
# Download images if not already present
38
[ -f ~/images/trusty-server-cloudimg-amd64-root.tar.xz ] || {
39
wget -O ~/images/trusty-server-cloudimg-amd64-root.tar.xz http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-root.tar.xz
41
[ -f ~/images/xenial-server-cloudimg-amd64-root.tar.xz ] || {
42
wget -O ~/images/xenial-server-cloudimg-amd64-root.tar.xz http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.xz
45
# Upload glance images to overcloud
46
glance --os-image-api-version 1 image-create --name="trusty-lxd" --is-public=true --progress \
47
--container-format=bare --disk-format=raw --property hypervisor_type=lxc \
48
--property architecture=x86_64 < ~/images/trusty-server-cloudimg-amd64-root.tar.xz
50
glance --os-image-api-version 1 image-create --name="xenial-lxd" --is-public=true --progress \
51
--container-format=bare --disk-format=raw --property hypervisor_type=lxc \
52
--property architecture=x86_64 < ~/images/xenial-server-cloudimg-amd64-root.tar.xz
54
# Create demo/testing users, tenants and flavor
55
keystone tenant-create --name demo
56
keystone user-create --name demo --tenant demo --pass pass --enabled true --email demo@dev.null
57
keystone user-role-add --user demo --role Member --tenant demo || :
58
keystone tenant-create --name alt_demo
59
keystone user-create --name alt_demo --tenant alt_demo --pass secret --enabled true --email alt_demo@dev.null
60
keystone user-role-add --user alt_demo --role Member --tenant alt_demo || :
62
nova flavor-create m1.cirros 6 64 1 1
63
nova flavor-create m1.tempest 7 256 5 1
64
nova flavor-create m2.tempest 8 512 5 1
31
upload_image cloudimages xenial xenial-server-cloudimg-amd64-root.tar.xz raw
32
upload_image cloudimages trusty trusty-server-cloudimg-amd64-root.tar.xz raw
34
image_id=$(openstack image list | grep trusty | awk '{ print $2 }')
35
image_alt_id=$(openstack image list | grep xenial | awk '{ print $2 }')
39
access=$(openstack --os-username demo --os-password pass --os-tenant-name demo ec2 credentials create | grep access | awk '{ print $4 }')
40
secret=$(openstack ec2 credentials show $access | grep secret | awk '{ print $4 }')
42
create_tempest_flavors
44
function create_exclusive_aggregate {
46
app_hostnames=$(./bin/application-hostnames nova-compute-exclusive-${exclusiveflavor})
47
if [ -n "$app_hostnames" ]; then
48
aggregate_name=exclusive-lxd-${exclusive_flavor}
49
openstack aggregate show ${aggregate_name} || {
50
openstack aggregate create ${aggregate_name}
51
openstack aggregate set --property exclusive-flavor=${exclusive_flavor} ${aggregate_name}
52
openstack aggregate set --property max_instances_per_host=1 ${aggregate_name}
53
for hostname in ${app_hostnames}; do
54
openstack aggregate add host ${aggregate_name} ${hostname}
60
function create_exclusive_flavor {
62
case ${exclusive_flavor} in
79
flavor_name=e1.lxd.${exclusive_flavor}
80
openstack flavor show ${flavor_name} || {
81
openstack flavor create --public --ram ${ram} --disk ${disk} --vcpus ${cpu} ${flavor_name}
82
openstack flavor set --property aggregate_instance_extra_specs:exclusive-flavor=${exclusive_flavor} ${flavor_name}
86
for exclusive_flavor in small medium large; do
87
create_exclusive_aggregate ${exclusive_flavor}
88
create_exclusive_flavor ${exclusive_flavor}
66
91
# Gather vars for tempest template
67
access=$(keystone --os-username demo --os-password pass --os-tenant-name demo ec2-credentials-create | grep access | awk '{ print $4 }')
68
secret=$(keystone ec2-credentials-get --access $access | grep secret | awk '{ print $4 }')
69
image_id=$(glance image-list | grep trusty-server | awk '{ print $2 }')
70
image_alt_id=$(glance image-list | grep trusty-server | awk '{ print $2 }')
71
92
ext_net=$(neutron net-list | grep ext_net | awk '{ print $2 }')
72
93
router=$(neutron router-list | grep provider-router | awk '{ print $2}')
73
94
keystone=$(juju-deployer -f keystone)