|
...
|
...
|
@@ -115,6 +115,9 @@ Q_NOTIFY_NOVA_PORT_DATA_CHANGES=${Q_NOTIFY_NOVA_PORT_DATA_CHANGES:-True}
|
|
115
|
115
|
VIF_PLUGGING_IS_FATAL=${VIF_PLUGGING_IS_FATAL:-True}
|
|
116
|
116
|
VIF_PLUGGING_TIMEOUT=${VIF_PLUGGING_TIMEOUT:-300}
|
|
117
|
117
|
|
|
|
118
|
+## Provider Network Information
|
|
|
119
|
+PROVIDER_SUBNET_NAME=${PROVIDER_SUBNET_NAME:-"provider_net"}
|
|
|
120
|
+
|
|
118
|
121
|
# The next two variables are configured by plugin
|
|
119
|
122
|
# e.g. _configure_neutron_l3_agent or lib/neutron_plugins/*
|
|
120
|
123
|
#
|
|
...
|
...
|
@@ -395,6 +398,14 @@ function create_neutron_initial_network {
|
|
395
|
395
|
die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $TENANT_ID"
|
|
396
|
396
|
sudo ifconfig $OVS_PHYSICAL_BRIDGE up
|
|
397
|
397
|
sudo route add default gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE
|
|
|
398
|
+ elif is_provider_network; then
|
|
|
399
|
+ die_if_not_set $LINENO SEGMENTATION_ID "A SEGMENTATION_ID is required to use provider networking"
|
|
|
400
|
+ die_if_not_set $LINENO PROVIDER_NETWORK_TYPE "You must specifiy the PROVIDER_NETWORK_TYPE"
|
|
|
401
|
+ NET_ID=$(neutron net-create $PHYSICAL_NETWORK --tenant_id $TENANT_ID --provider:network_type $PROVIDER_NETWORK_TYPE --provider:physical_network "$PHYSICAL_NETWORK" --provider:segmentation_id "$SEGMENTATION_ID" --router:external=true --shared | grep ' id ' | get_field 2)
|
|
|
402
|
+ SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --name $PROVIDER_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
|
|
|
403
|
+ sudo ip link set $OVS_PHYSICAL_BRIDGE up
|
|
|
404
|
+ sudo ip link set br-int up
|
|
|
405
|
+ sudo ip link set $PUBLIC_INTERFACE up
|
|
398
|
406
|
else
|
|
399
|
407
|
NET_ID=$(neutron net-create --tenant-id $TENANT_ID "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
|
|
400
|
408
|
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK $TENANT_ID"
|
|
...
|
...
|
@@ -495,6 +506,13 @@ function start_neutron_agents {
|
|
495
|
495
|
|
|
496
|
496
|
L3_CONF_FILES="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE"
|
|
497
|
497
|
|
|
|
498
|
+ if is_provider_network; then
|
|
|
499
|
+ sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
|
|
|
500
|
+ sudo ip link set $OVS_PHYSICAL_BRIDGE up
|
|
|
501
|
+ sudo ip link set br-int up
|
|
|
502
|
+ sudo ip link set $PUBLIC_INTERFACE up
|
|
|
503
|
+ fi
|
|
|
504
|
+
|
|
498
|
505
|
if is_service_enabled q-fwaas; then
|
|
499
|
506
|
L3_CONF_FILES="$L3_CONF_FILES --config-file $Q_FWAAS_CONF_FILE"
|
|
500
|
507
|
VPN_CONF_FILES="$VPN_CONF_FILES --config-file $Q_FWAAS_CONF_FILE"
|
|
...
|
...
|
@@ -999,6 +1017,13 @@ function check_neutron_third_party_integration {
|
|
999
|
999
|
_neutron_third_party_do check
|
|
1000
|
1000
|
}
|
|
1001
|
1001
|
|
|
|
1002
|
+function is_provider_network {
|
|
|
1003
|
+ if [ "$Q_USE_PROVIDER_NETWORKING" == "True" ] && [ "$Q_L3_ENABLED" == "False" ]; then
|
|
|
1004
|
+ return 0
|
|
|
1005
|
+ fi
|
|
|
1006
|
+ return 1
|
|
|
1007
|
+}
|
|
|
1008
|
+
|
|
1002
|
1009
|
|
|
1003
|
1010
|
# Restore xtrace
|
|
1004
|
1011
|
$XTRACE
|