|
...
|
...
|
@@ -65,6 +65,12 @@ set +o xtrace
|
|
65
|
65
|
# Quantum Network Configuration
|
|
66
|
66
|
# -----------------------------
|
|
67
|
67
|
|
|
|
68
|
+# Gateway and subnet defaults, in case they are not customized in localrc
|
|
|
69
|
+NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
|
|
|
70
|
+PUBLIC_NETWORK_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.225}
|
|
|
71
|
+PRIVATE_SUBNET_NAME=${PRIVATE_SUBNET_NAME:-"private-subnet"}
|
|
|
72
|
+PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"}
|
|
|
73
|
+
|
|
68
|
74
|
# Set up default directories
|
|
69
|
75
|
QUANTUM_DIR=$DEST/quantum
|
|
70
|
76
|
QUANTUMCLIENT_DIR=$DEST/python-quantumclient
|
|
...
|
...
|
@@ -304,11 +310,11 @@ function create_quantum_initial_network() {
|
|
304
|
304
|
sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE
|
|
305
|
305
|
done
|
|
306
|
306
|
NET_ID=$(quantum net-create $PHYSICAL_NETWORK --tenant_id $TENANT_ID --provider:network_type flat --provider:physical_network "$PHYSICAL_NETWORK" | grep ' id ' | get_field 2)
|
|
307
|
|
- SUBNET_ID=$(quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --gateway $NETWORK_GATEWAY $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
|
|
|
307
|
+ SUBNET_ID=$(quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
|
|
308
|
308
|
sudo ifconfig $OVS_PHYSICAL_BRIDGE up
|
|
309
|
309
|
else
|
|
310
|
310
|
NET_ID=$(quantum net-create --tenant_id $TENANT_ID "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
|
|
311
|
|
- SUBNET_ID=$(quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 --gateway $NETWORK_GATEWAY $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
|
|
|
311
|
+ SUBNET_ID=$(quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
|
|
312
|
312
|
fi
|
|
313
|
313
|
|
|
314
|
314
|
if [[ "$Q_L3_ENABLED" == "True" ]]; then
|
|
...
|
...
|
@@ -323,7 +329,7 @@ function create_quantum_initial_network() {
|
|
323
|
323
|
quantum router-interface-add $ROUTER_ID $SUBNET_ID
|
|
324
|
324
|
# Create an external network, and a subnet. Configure the external network as router gw
|
|
325
|
325
|
EXT_NET_ID=$(quantum net-create "$PUBLIC_NETWORK_NAME" -- --router:external=True | grep ' id ' | get_field 2)
|
|
326
|
|
- EXT_GW_IP=$(quantum subnet-create --ip_version 4 ${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} $EXT_NET_ID $FLOATING_RANGE -- --enable_dhcp=False | grep 'gateway_ip' | get_field 2)
|
|
|
326
|
+ EXT_GW_IP=$(quantum subnet-create --ip_version 4 ${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} --gateway $PUBLIC_NETWORK_GATEWAY --name $PUBLIC_SUBNET_NAME $EXT_NET_ID $FLOATING_RANGE -- --enable_dhcp=False | grep 'gateway_ip' | get_field 2)
|
|
327
|
327
|
quantum router-gateway-set $ROUTER_ID $EXT_NET_ID
|
|
328
|
328
|
|
|
329
|
329
|
if is_service_enabled q-l3; then
|