forked from cloudbase/unattended-setup-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-rdo-example.sh
executable file
·40 lines (29 loc) · 1.22 KB
/
deploy-rdo-example.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
if [ $# -lt 6 ]; then
echo "Usage: $0 <esxi_user> <esxi_host> <scripts_datastore> <templates_datastore> <datastore> <openstack_release> [<use_linked_vmdks>]"
exit 1
fi
ESXI_USER=$1
ESXI_HOST=$2
SCRIPTS_DATASTORE=$3
TEMPLATES_DATASTORE=$4
DATASTORE=$5
OPENSTACK_RELEASE=$6
VMDK_OPTION=$7
RDO_NAME=rdo-test-$RANDOM
ESXI_PUBLIC_SWITCH=vSwitch0
ESXI_PUBLIC_VMNIC=vmnic0
LINUX_TEMPLATE_VMDK=/vmfs/volumes/$TEMPLATES_DATASTORE/centos-6.5-template-100G/centos-6.5-template-100G.vmdk
if [ "$OPENSTACK_RELEASE" == "grizzly" ]; then
HYPERV_TEMPLATE_VMDK=/vmfs/volumes/$TEMPLATES_DATASTORE/hyperv-2012-template-100G/hyperv-2012-template-100G.vmdk
else
HYPERV_TEMPLATE_VMDK=/vmfs/volumes/$TEMPLATES_DATASTORE/hyperv-2012-r2-template-100G/hyperv-2012-r2-template-100G.vmdk
fi
if [ "$VMDK_OPTION" == "use_linked_vmdks" ]; then
LINUX_TEMPLATE_VMDK=${LINUX_TEMPLATE_VMDK%%.vmdk}-000001.vmdk
HYPERV_TEMPLATE_VMDK=${HYPERV_TEMPLATE_VMDK%%.vmdk}-000001.vmdk
fi
BASEDIR=$(dirname $0)
echo "Deploying RDO: $RDO_NAME"
$BASEDIR/deploy-rdo.sh $ESXI_USER $ESXI_HOST "$SCRIPTS_DATASTORE" "$DATASTORE" $OPENSTACK_RELEASE "$RDO_NAME" "$ESXI_PUBLIC_SWITCH" $ESXI_PUBLIC_VMNIC "$LINUX_TEMPLATE_VMDK" "$HYPERV_TEMPLATE_VMDK"