Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 1 | # lib/neutron |
| 2 | # functions - funstions specific to neutron |
| 3 | |
| 4 | # Dependencies: |
| 5 | # ``functions`` file |
| 6 | # ``DEST`` must be defined |
Stephan Renatus | e578eff | 2013-11-19 13:31:04 +0100 | [diff] [blame] | 7 | # ``STACK_USER`` must be defined |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 8 | |
| 9 | # ``stack.sh`` calls the entry points in this order: |
| 10 | # |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 11 | # - install_neutron |
| 12 | # - install_neutronclient |
| 13 | # - install_neutron_agent_packages |
| 14 | # - install_neutron_third_party |
| 15 | # - configure_neutron |
| 16 | # - init_neutron |
| 17 | # - configure_neutron_third_party |
| 18 | # - init_neutron_third_party |
| 19 | # - start_neutron_third_party |
Emilien Macchi | a677b7f | 2013-11-25 23:40:20 +0100 | [diff] [blame] | 20 | # - create_neutron_cache_dir |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 21 | # - create_nova_conf_neutron |
| 22 | # - start_neutron_service_and_check |
| 23 | # - create_neutron_initial_network |
| 24 | # - setup_neutron_debug |
| 25 | # - start_neutron_agents |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 26 | # |
| 27 | # ``unstack.sh`` calls the entry points in this order: |
| 28 | # |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 29 | # - stop_neutron |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 30 | |
| 31 | # Functions in lib/neutron are classified into the following categories: |
| 32 | # |
| 33 | # - entry points (called from stack.sh or unstack.sh) |
| 34 | # - internal functions |
| 35 | # - neutron exercises |
| 36 | # - 3rd party programs |
| 37 | |
| 38 | |
| 39 | # Neutron Networking |
| 40 | # ------------------ |
| 41 | |
| 42 | # Make sure that neutron is enabled in ``ENABLED_SERVICES``. If you want |
| 43 | # to run Neutron on this host, make sure that q-svc is also in |
| 44 | # ``ENABLED_SERVICES``. |
| 45 | # |
| 46 | # If you're planning to use the Neutron openvswitch plugin, set |
| 47 | # ``Q_PLUGIN`` to "openvswitch" and make sure the q-agt service is enabled |
| 48 | # in ``ENABLED_SERVICES``. If you're planning to use the Neutron |
| 49 | # linuxbridge plugin, set ``Q_PLUGIN`` to "linuxbridge" and make sure the |
| 50 | # q-agt service is enabled in ``ENABLED_SERVICES``. |
| 51 | # |
| 52 | # See "Neutron Network Configuration" below for additional variables |
| 53 | # that must be set in localrc for connectivity across hosts with |
| 54 | # Neutron. |
| 55 | # |
| 56 | # With Neutron networking the NETWORK_MANAGER variable is ignored. |
| 57 | # |
| 58 | # To enable specific configuration options for either the Open vSwitch or |
| 59 | # LinuxBridge plugin, please see the top level README file under the |
| 60 | # Neutron section. |
| 61 | |
| 62 | # Save trace setting |
| 63 | XTRACE=$(set +o | grep xtrace) |
| 64 | set +o xtrace |
| 65 | |
| 66 | |
| 67 | # Neutron Network Configuration |
| 68 | # ----------------------------- |
| 69 | |
| 70 | # Gateway and subnet defaults, in case they are not customized in localrc |
| 71 | NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1} |
Salvatore Orlando | 90234ac | 2013-11-25 05:44:10 -0800 | [diff] [blame] | 72 | PUBLIC_NETWORK_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.1} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 73 | PRIVATE_SUBNET_NAME=${PRIVATE_SUBNET_NAME:-"private-subnet"} |
| 74 | PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"} |
| 75 | |
| 76 | # Set up default directories |
| 77 | NEUTRON_DIR=$DEST/neutron |
| 78 | NEUTRONCLIENT_DIR=$DEST/python-neutronclient |
| 79 | NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron} |
| 80 | |
| 81 | # Support entry points installation of console scripts |
| 82 | if [[ -d $NEUTRON_DIR/bin/neutron-server ]]; then |
| 83 | NEUTRON_BIN_DIR=$NEUTRON_DIR/bin |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 84 | else |
| 85 | NEUTRON_BIN_DIR=$(get_python_exec_prefix) |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 86 | fi |
| 87 | |
| 88 | NEUTRON_CONF_DIR=/etc/neutron |
| 89 | NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf |
| 90 | export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"} |
| 91 | |
| 92 | # Default Neutron Plugin |
Kyle Mestery | 6d23500 | 2013-09-18 20:27:08 +0000 | [diff] [blame] | 93 | Q_PLUGIN=${Q_PLUGIN:-ml2} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 94 | # Default Neutron Port |
| 95 | Q_PORT=${Q_PORT:-9696} |
| 96 | # Default Neutron Host |
| 97 | Q_HOST=${Q_HOST:-$SERVICE_HOST} |
| 98 | # Default admin username |
| 99 | Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-neutron} |
| 100 | # Default auth strategy |
| 101 | Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone} |
| 102 | # Use namespace or not |
| 103 | Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True} |
| 104 | # RHEL's support for namespaces requires using veths with ovs |
| 105 | Q_OVS_USE_VETH=${Q_OVS_USE_VETH:-False} |
| 106 | Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True} |
| 107 | # Meta data IP |
| 108 | Q_META_DATA_IP=${Q_META_DATA_IP:-$SERVICE_HOST} |
| 109 | # Allow Overlapping IP among subnets |
| 110 | Q_ALLOW_OVERLAPPING_IP=${Q_ALLOW_OVERLAPPING_IP:-True} |
| 111 | # Use neutron-debug command |
| 112 | Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False} |
| 113 | # The name of the default q-l3 router |
| 114 | Q_ROUTER_NAME=${Q_ROUTER_NAME:-router1} |
Aaron Rosen | 4540d00 | 2013-10-24 13:59:33 -0700 | [diff] [blame] | 115 | # nova vif driver that all plugins should use |
| 116 | NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} |
| 117 | |
Tomoe Sugihara | afbc631 | 2013-11-14 20:02:47 +0000 | [diff] [blame] | 118 | # The next two variables are configured by plugin |
| 119 | # e.g. _configure_neutron_l3_agent or lib/neutron_plugins/* |
| 120 | # |
| 121 | # The plugin supports L3. |
| 122 | Q_L3_ENABLED=${Q_L3_ENABLED:-False} |
| 123 | # L3 routers exist per tenant |
| 124 | Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-False} |
Aaron Rosen | 4540d00 | 2013-10-24 13:59:33 -0700 | [diff] [blame] | 125 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 126 | # List of config file names in addition to the main plugin config file |
| 127 | # See _configure_neutron_common() for details about setting it up |
| 128 | declare -a Q_PLUGIN_EXTRA_CONF_FILES |
| 129 | |
| 130 | if is_service_enabled neutron; then |
| 131 | Q_RR_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf |
| 132 | if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then |
| 133 | Q_RR_COMMAND="sudo" |
| 134 | else |
| 135 | NEUTRON_ROOTWRAP=$(get_rootwrap_location neutron) |
| 136 | Q_RR_COMMAND="sudo $NEUTRON_ROOTWRAP $Q_RR_CONF_FILE" |
| 137 | fi |
| 138 | |
| 139 | # Provider Network Configurations |
| 140 | # -------------------------------- |
| 141 | |
| 142 | # The following variables control the Neutron openvswitch and |
| 143 | # linuxbridge plugins' allocation of tenant networks and |
| 144 | # availability of provider networks. If these are not configured |
| 145 | # in ``localrc``, tenant networks will be local to the host (with no |
| 146 | # remote connectivity), and no physical resources will be |
| 147 | # available for the allocation of provider networks. |
| 148 | |
| 149 | # To use GRE tunnels for tenant networks, set to True in |
| 150 | # ``localrc``. GRE tunnels are only supported by the openvswitch |
| 151 | # plugin, and currently only on Ubuntu. |
| 152 | ENABLE_TENANT_TUNNELS=${ENABLE_TENANT_TUNNELS:-False} |
| 153 | |
| 154 | # If using GRE tunnels for tenant networks, specify the range of |
| 155 | # tunnel IDs from which tenant networks are allocated. Can be |
| 156 | # overriden in ``localrc`` in necesssary. |
| 157 | TENANT_TUNNEL_RANGES=${TENANT_TUNNEL_RANGE:-1:1000} |
| 158 | |
| 159 | # To use VLANs for tenant networks, set to True in localrc. VLANs |
| 160 | # are supported by the openvswitch and linuxbridge plugins, each |
| 161 | # requiring additional configuration described below. |
| 162 | ENABLE_TENANT_VLANS=${ENABLE_TENANT_VLANS:-False} |
| 163 | |
| 164 | # If using VLANs for tenant networks, set in ``localrc`` to specify |
| 165 | # the range of VLAN VIDs from which tenant networks are |
| 166 | # allocated. An external network switch must be configured to |
| 167 | # trunk these VLANs between hosts for multi-host connectivity. |
| 168 | # |
| 169 | # Example: ``TENANT_VLAN_RANGE=1000:1999`` |
| 170 | TENANT_VLAN_RANGE=${TENANT_VLAN_RANGE:-} |
| 171 | |
| 172 | # If using VLANs for tenant networks, or if using flat or VLAN |
| 173 | # provider networks, set in ``localrc`` to the name of the physical |
| 174 | # network, and also configure ``OVS_PHYSICAL_BRIDGE`` for the |
| 175 | # openvswitch agent or ``LB_PHYSICAL_INTERFACE`` for the linuxbridge |
| 176 | # agent, as described below. |
| 177 | # |
| 178 | # Example: ``PHYSICAL_NETWORK=default`` |
| 179 | PHYSICAL_NETWORK=${PHYSICAL_NETWORK:-} |
| 180 | |
| 181 | # With the openvswitch plugin, if using VLANs for tenant networks, |
| 182 | # or if using flat or VLAN provider networks, set in ``localrc`` to |
| 183 | # the name of the OVS bridge to use for the physical network. The |
| 184 | # bridge will be created if it does not already exist, but a |
| 185 | # physical interface must be manually added to the bridge as a |
| 186 | # port for external connectivity. |
| 187 | # |
| 188 | # Example: ``OVS_PHYSICAL_BRIDGE=br-eth1`` |
| 189 | OVS_PHYSICAL_BRIDGE=${OVS_PHYSICAL_BRIDGE:-} |
| 190 | |
| 191 | # With the linuxbridge plugin, if using VLANs for tenant networks, |
| 192 | # or if using flat or VLAN provider networks, set in ``localrc`` to |
| 193 | # the name of the network interface to use for the physical |
| 194 | # network. |
| 195 | # |
| 196 | # Example: ``LB_PHYSICAL_INTERFACE=eth1`` |
| 197 | LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-} |
| 198 | |
| 199 | # With the openvswitch plugin, set to True in ``localrc`` to enable |
| 200 | # provider GRE tunnels when ``ENABLE_TENANT_TUNNELS`` is False. |
| 201 | # |
| 202 | # Example: ``OVS_ENABLE_TUNNELING=True`` |
| 203 | OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS} |
| 204 | fi |
| 205 | |
| 206 | # Neutron plugin specific functions |
| 207 | # --------------------------------- |
| 208 | |
| 209 | # Please refer to ``lib/neutron_plugins/README.md`` for details. |
| 210 | source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN |
| 211 | |
| 212 | # Agent loadbalancer service plugin functions |
| 213 | # ------------------------------------------- |
| 214 | |
| 215 | # Hardcoding for 1 service plugin for now |
| 216 | source $TOP_DIR/lib/neutron_plugins/services/loadbalancer |
| 217 | |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 218 | # Agent metering service plugin functions |
| 219 | # ------------------------------------------- |
| 220 | |
| 221 | # Hardcoding for 1 service plugin for now |
| 222 | source $TOP_DIR/lib/neutron_plugins/services/metering |
| 223 | |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 224 | # VPN service plugin functions |
| 225 | # ------------------------------------------- |
| 226 | # Hardcoding for 1 service plugin for now |
| 227 | source $TOP_DIR/lib/neutron_plugins/services/vpn |
| 228 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 229 | # Firewall Service Plugin functions |
Adam Spiers | cb96159 | 2013-10-05 12:11:07 +0100 | [diff] [blame] | 230 | # --------------------------------- |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 231 | source $TOP_DIR/lib/neutron_plugins/services/firewall |
| 232 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 233 | # Use security group or not |
| 234 | if has_neutron_plugin_security_group; then |
| 235 | Q_USE_SECGROUP=${Q_USE_SECGROUP:-True} |
| 236 | else |
| 237 | Q_USE_SECGROUP=False |
| 238 | fi |
| 239 | |
| 240 | # Functions |
| 241 | # --------- |
| 242 | |
| 243 | # configure_neutron() |
| 244 | # Set common config for all neutron server and agents. |
| 245 | function configure_neutron() { |
| 246 | _configure_neutron_common |
| 247 | iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT |
| 248 | |
| 249 | # goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES |
| 250 | if is_service_enabled q-lbaas; then |
| 251 | _configure_neutron_lbaas |
| 252 | fi |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 253 | if is_service_enabled q-metering; then |
| 254 | _configure_neutron_metering |
| 255 | fi |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 256 | if is_service_enabled q-vpn; then |
| 257 | _configure_neutron_vpn |
| 258 | fi |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 259 | if is_service_enabled q-fwaas; then |
| 260 | _configure_neutron_fwaas |
| 261 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 262 | if is_service_enabled q-svc; then |
| 263 | _configure_neutron_service |
| 264 | fi |
| 265 | if is_service_enabled q-agt; then |
| 266 | _configure_neutron_plugin_agent |
| 267 | fi |
| 268 | if is_service_enabled q-dhcp; then |
| 269 | _configure_neutron_dhcp_agent |
| 270 | fi |
| 271 | if is_service_enabled q-l3; then |
| 272 | _configure_neutron_l3_agent |
| 273 | fi |
| 274 | if is_service_enabled q-meta; then |
| 275 | _configure_neutron_metadata_agent |
| 276 | fi |
| 277 | |
| 278 | _configure_neutron_debug_command |
| 279 | } |
| 280 | |
| 281 | function create_nova_conf_neutron() { |
Yong Sheng Gong | 032e454 | 2013-08-25 10:21:10 +0800 | [diff] [blame] | 282 | iniset $NOVA_CONF DEFAULT network_api_class "nova.network.neutronv2.api.API" |
| 283 | iniset $NOVA_CONF DEFAULT neutron_admin_username "$Q_ADMIN_USERNAME" |
| 284 | iniset $NOVA_CONF DEFAULT neutron_admin_password "$SERVICE_PASSWORD" |
| 285 | iniset $NOVA_CONF DEFAULT neutron_admin_auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0" |
| 286 | iniset $NOVA_CONF DEFAULT neutron_auth_strategy "$Q_AUTH_STRATEGY" |
| 287 | iniset $NOVA_CONF DEFAULT neutron_admin_tenant_name "$SERVICE_TENANT_NAME" |
| 288 | iniset $NOVA_CONF DEFAULT neutron_region_name "RegionOne" |
| 289 | iniset $NOVA_CONF DEFAULT neutron_url "http://$Q_HOST:$Q_PORT" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 290 | |
| 291 | if [[ "$Q_USE_SECGROUP" == "True" ]]; then |
| 292 | LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver |
Jeff Peeler | 1143f7e | 2013-10-31 16:21:52 -0400 | [diff] [blame] | 293 | iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER |
Yong Sheng Gong | 032e454 | 2013-08-25 10:21:10 +0800 | [diff] [blame] | 294 | iniset $NOVA_CONF DEFAULT security_group_api neutron |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 295 | fi |
| 296 | |
| 297 | # set NOVA_VIF_DRIVER and optionally set options in nova_conf |
| 298 | neutron_plugin_create_nova_conf |
| 299 | |
| 300 | iniset $NOVA_CONF DEFAULT libvirt_vif_driver "$NOVA_VIF_DRIVER" |
| 301 | iniset $NOVA_CONF DEFAULT linuxnet_interface_driver "$LINUXNET_VIF_DRIVER" |
| 302 | if is_service_enabled q-meta; then |
Yong Sheng Gong | 032e454 | 2013-08-25 10:21:10 +0800 | [diff] [blame] | 303 | iniset $NOVA_CONF DEFAULT service_neutron_metadata_proxy "True" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 304 | fi |
| 305 | } |
| 306 | |
Emilien Macchi | a677b7f | 2013-11-25 23:40:20 +0100 | [diff] [blame] | 307 | # create_neutron_cache_dir() - Part of the _neutron_setup_keystone() process |
| 308 | function create_neutron_cache_dir() { |
| 309 | # Create cache dir |
| 310 | sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR |
| 311 | sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR |
| 312 | rm -f $NEUTRON_AUTH_CACHE_DIR/* |
| 313 | } |
| 314 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 315 | # create_neutron_accounts() - Set up common required neutron accounts |
| 316 | |
| 317 | # Tenant User Roles |
| 318 | # ------------------------------------------------------------------ |
| 319 | # service neutron admin # if enabled |
| 320 | |
| 321 | # Migrated from keystone_data.sh |
| 322 | function create_neutron_accounts() { |
| 323 | |
| 324 | SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") |
| 325 | ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }") |
| 326 | |
| 327 | if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then |
| 328 | NEUTRON_USER=$(keystone user-create \ |
| 329 | --name=neutron \ |
| 330 | --pass="$SERVICE_PASSWORD" \ |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 331 | --tenant-id $SERVICE_TENANT \ |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 332 | --email=neutron@example.com \ |
| 333 | | grep " id " | get_field 2) |
| 334 | keystone user-role-add \ |
Jorge Valderrama Romero | f39ee96 | 2013-09-02 17:18:40 +0200 | [diff] [blame] | 335 | --tenant-id $SERVICE_TENANT \ |
| 336 | --user-id $NEUTRON_USER \ |
| 337 | --role-id $ADMIN_ROLE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 338 | if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
| 339 | NEUTRON_SERVICE=$(keystone service-create \ |
| 340 | --name=neutron \ |
| 341 | --type=network \ |
| 342 | --description="Neutron Service" \ |
| 343 | | grep " id " | get_field 2) |
| 344 | keystone endpoint-create \ |
| 345 | --region RegionOne \ |
| 346 | --service_id $NEUTRON_SERVICE \ |
| 347 | --publicurl "http://$SERVICE_HOST:9696/" \ |
| 348 | --adminurl "http://$SERVICE_HOST:9696/" \ |
| 349 | --internalurl "http://$SERVICE_HOST:9696/" |
| 350 | fi |
| 351 | fi |
| 352 | } |
| 353 | |
| 354 | function create_neutron_initial_network() { |
| 355 | TENANT_ID=$(keystone tenant-list | grep " demo " | get_field 1) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 356 | die_if_not_set $LINENO TENANT_ID "Failure retrieving TENANT_ID for demo" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 357 | |
| 358 | # Create a small network |
| 359 | # Since neutron command is executed in admin context at this point, |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 360 | # ``--tenant-id`` needs to be specified. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 361 | if is_baremetal; then |
sbauza | e2c4ee2 | 2013-08-29 17:29:46 +0200 | [diff] [blame] | 362 | if [[ "$PUBLIC_INTERFACE" == '' || "$OVS_PHYSICAL_BRIDGE" == '' ]]; then |
| 363 | die $LINENO "Neutron settings for baremetal not set.. exiting" |
| 364 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 365 | sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE |
| 366 | for IP in $(ip addr show dev $PUBLIC_INTERFACE | grep ' inet ' | awk '{print $2}'); do |
| 367 | sudo ip addr del $IP dev $PUBLIC_INTERFACE |
| 368 | sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE |
| 369 | done |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 370 | NET_ID=$(neutron net-create $PHYSICAL_NETWORK --tenant-id $TENANT_ID --provider:network_type flat --provider:physical_network "$PHYSICAL_NETWORK" | grep ' id ' | get_field 2) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 371 | die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK $TENANT_ID" |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 372 | SUBNET_ID=$(neutron 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) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 373 | die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $TENANT_ID" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 374 | sudo ifconfig $OVS_PHYSICAL_BRIDGE up |
sbauza | e2c4ee2 | 2013-08-29 17:29:46 +0200 | [diff] [blame] | 375 | sudo route add default gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 376 | else |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 377 | NET_ID=$(neutron net-create --tenant-id $TENANT_ID "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 378 | die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK $TENANT_ID" |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 379 | SUBNET_ID=$(neutron 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) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 380 | die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $TENANT_ID" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 381 | fi |
| 382 | |
| 383 | if [[ "$Q_L3_ENABLED" == "True" ]]; then |
| 384 | # Create a router, and add the private subnet as one of its interfaces |
| 385 | if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then |
| 386 | # create a tenant-owned router. |
Dirk Mueller | 25049cd | 2014-01-09 13:53:52 +0100 | [diff] [blame^] | 387 | ROUTER_ID=$(neutron router-create --tenant-id $TENANT_ID $Q_ROUTER_NAME | grep ' id ' | get_field 2) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 388 | die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $TENANT_ID $Q_ROUTER_NAME" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 389 | else |
| 390 | # Plugin only supports creating a single router, which should be admin owned. |
| 391 | ROUTER_ID=$(neutron router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 392 | die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $Q_ROUTER_NAME" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 393 | fi |
| 394 | neutron router-interface-add $ROUTER_ID $SUBNET_ID |
| 395 | # Create an external network, and a subnet. Configure the external network as router gw |
| 396 | EXT_NET_ID=$(neutron net-create "$PUBLIC_NETWORK_NAME" -- --router:external=True | grep ' id ' | get_field 2) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 397 | die_if_not_set $LINENO EXT_NET_ID "Failure creating EXT_NET_ID for $PUBLIC_NETWORK_NAME" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 398 | EXT_GW_IP=$(neutron 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) |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 399 | die_if_not_set $LINENO EXT_GW_IP "Failure creating EXT_GW_IP" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 400 | neutron router-gateway-set $ROUTER_ID $EXT_NET_ID |
| 401 | |
| 402 | if is_service_enabled q-l3; then |
| 403 | # logic is specific to using the l3-agent for l3 |
| 404 | if is_neutron_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then |
| 405 | CIDR_LEN=${FLOATING_RANGE#*/} |
| 406 | sudo ip addr add $EXT_GW_IP/$CIDR_LEN dev $PUBLIC_BRIDGE |
| 407 | sudo ip link set $PUBLIC_BRIDGE up |
| 408 | ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' '{ print $8; }'` |
DennyZhang | 23178a9 | 2013-10-22 17:07:32 -0500 | [diff] [blame] | 409 | die_if_not_set $LINENO ROUTER_GW_IP "Failure retrieving ROUTER_GW_IP" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 410 | sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP |
| 411 | fi |
| 412 | if [[ "$Q_USE_NAMESPACE" == "False" ]]; then |
| 413 | # Explicitly set router id in l3 agent configuration |
| 414 | iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID |
| 415 | fi |
| 416 | fi |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 417 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | # init_neutron() - Initialize databases, etc. |
| 421 | function init_neutron() { |
Salvatore Orlando | dd64988 | 2013-08-05 08:56:17 -0700 | [diff] [blame] | 422 | recreate_database $Q_DB_NAME utf8 |
| 423 | # Run Neutron db migrations |
| 424 | $NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 425 | } |
| 426 | |
| 427 | # install_neutron() - Collect source and prepare |
| 428 | function install_neutron() { |
| 429 | git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH |
| 430 | setup_develop $NEUTRON_DIR |
| 431 | } |
| 432 | |
| 433 | # install_neutronclient() - Collect source and prepare |
| 434 | function install_neutronclient() { |
| 435 | git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH |
| 436 | setup_develop $NEUTRONCLIENT_DIR |
Attila Fazekas | fac533e | 2013-08-14 16:04:01 +0200 | [diff] [blame] | 437 | sudo install -D -m 0644 -o $STACK_USER {$NEUTRONCLIENT_DIR/tools/,/etc/bash_completion.d/}neutron.bash_completion |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 438 | } |
| 439 | |
| 440 | # install_neutron_agent_packages() - Collect source and prepare |
| 441 | function install_neutron_agent_packages() { |
| 442 | # install packages that are specific to plugin agent(s) |
| 443 | if is_service_enabled q-agt q-dhcp q-l3; then |
| 444 | neutron_plugin_install_agent_packages |
| 445 | fi |
| 446 | |
| 447 | if is_service_enabled q-lbaas; then |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 448 | neutron_agent_lbaas_install_agent_packages |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 449 | fi |
| 450 | } |
| 451 | |
| 452 | # Start running processes, including screen |
| 453 | function start_neutron_service_and_check() { |
| 454 | # build config-file options |
| 455 | local cfg_file |
| 456 | local CFG_FILE_OPTIONS="--config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE" |
| 457 | for cfg_file in ${Q_PLUGIN_EXTRA_CONF_FILES[@]}; do |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 458 | CFG_FILE_OPTIONS+=" --config-file /$cfg_file" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 459 | done |
| 460 | # Start the Neutron service |
| 461 | screen_it q-svc "cd $NEUTRON_DIR && python $NEUTRON_BIN_DIR/neutron-server $CFG_FILE_OPTIONS" |
| 462 | echo "Waiting for Neutron to start..." |
JUN JIE NAN | 0aa8534 | 2013-09-13 15:47:09 +0800 | [diff] [blame] | 463 | if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$Q_HOST:$Q_PORT; do sleep 1; done"; then |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 464 | die $LINENO "Neutron did not start" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 465 | fi |
| 466 | } |
| 467 | |
| 468 | # Start running processes, including screen |
| 469 | function start_neutron_agents() { |
| 470 | # Start up the neutron agents if enabled |
| 471 | screen_it q-agt "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE" |
| 472 | screen_it q-dhcp "cd $NEUTRON_DIR && python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE" |
Nachi Ueno | 584750f | 2013-07-15 18:22:21 -0700 | [diff] [blame] | 473 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 474 | L3_CONF_FILES="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE" |
| 475 | |
| 476 | if is_service_enabled q-fwaas; then |
| 477 | L3_CONF_FILES="$L3_CONF_FILES --config-file $Q_FWAAS_CONF_FILE" |
Nachi Ueno | 584750f | 2013-07-15 18:22:21 -0700 | [diff] [blame] | 478 | fi |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 479 | if is_service_enabled q-vpn; then |
| 480 | screen_it q-vpn "cd $NEUTRON_DIR && $AGENT_VPN_BINARY $L3_CONF_FILES" |
| 481 | else |
| 482 | screen_it q-l3 "cd $NEUTRON_DIR && python $AGENT_L3_BINARY $L3_CONF_FILES" |
| 483 | fi |
| 484 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 485 | screen_it q-meta "cd $NEUTRON_DIR && python $AGENT_META_BINARY --config-file $NEUTRON_CONF --config-file=$Q_META_CONF_FILE" |
| 486 | |
| 487 | if [ "$VIRT_DRIVER" = 'xenserver' ]; then |
| 488 | # For XenServer, start an agent for the domU openvswitch |
| 489 | screen_it q-domua "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU" |
| 490 | fi |
| 491 | |
| 492 | if is_service_enabled q-lbaas; then |
| 493 | screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME" |
| 494 | fi |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 495 | |
| 496 | if is_service_enabled q-metering; then |
| 497 | screen_it q-metering "cd $NEUTRON_DIR && python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME" |
| 498 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | # stop_neutron() - Stop running processes (non-screen) |
| 502 | function stop_neutron() { |
| 503 | if is_service_enabled q-dhcp; then |
| 504 | pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }') |
| 505 | [ ! -z "$pid" ] && sudo kill -9 $pid |
| 506 | fi |
| 507 | if is_service_enabled q-meta; then |
| 508 | pid=$(ps aux | awk '/neutron-ns-metadata-proxy/ { print $2 }') |
| 509 | [ ! -z "$pid" ] && sudo kill -9 $pid |
| 510 | fi |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 511 | |
| 512 | if is_service_enabled q-lbaas; then |
| 513 | neutron_lbaas_stop |
| 514 | fi |
| 515 | if is_service_enabled q-fwaas; then |
| 516 | neutron_fwaas_stop |
| 517 | fi |
| 518 | if is_service_enabled q-vpn; then |
| 519 | neutron_vpn_stop |
| 520 | fi |
| 521 | if is_service_enabled q-metering; then |
| 522 | neutron_metering_stop |
| 523 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 524 | } |
| 525 | |
| 526 | # cleanup_neutron() - Remove residual data files, anything left over from previous |
| 527 | # runs that a clean run would need to clean up |
| 528 | function cleanup_neutron() { |
| 529 | if is_neutron_ovs_base_plugin; then |
| 530 | neutron_ovs_base_cleanup |
| 531 | fi |
| 532 | |
| 533 | # delete all namespaces created by neutron |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 534 | for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas)-[0-9a-f-]*'); do |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 535 | sudo ip netns delete ${ns} |
| 536 | done |
| 537 | } |
| 538 | |
| 539 | # _configure_neutron_common() |
| 540 | # Set common config for all neutron server and agents. |
| 541 | # This MUST be called before other ``_configure_neutron_*`` functions. |
| 542 | function _configure_neutron_common() { |
| 543 | # Put config files in ``NEUTRON_CONF_DIR`` for everyone to find |
| 544 | if [[ ! -d $NEUTRON_CONF_DIR ]]; then |
| 545 | sudo mkdir -p $NEUTRON_CONF_DIR |
| 546 | fi |
| 547 | sudo chown $STACK_USER $NEUTRON_CONF_DIR |
| 548 | |
| 549 | cp $NEUTRON_DIR/etc/neutron.conf $NEUTRON_CONF |
| 550 | |
| 551 | # Set plugin-specific variables ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``. |
| 552 | # For main plugin config file, set ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``. |
| 553 | # For addition plugin config files, set ``Q_PLUGIN_EXTRA_CONF_PATH``, |
| 554 | # ``Q_PLUGIN_EXTRA_CONF_FILES``. For example: |
Adam Spiers | cb96159 | 2013-10-05 12:11:07 +0100 | [diff] [blame] | 555 | # |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 556 | # ``Q_PLUGIN_EXTRA_CONF_FILES=(file1, file2)`` |
| 557 | neutron_plugin_configure_common |
| 558 | |
sbauza | e2c4ee2 | 2013-08-29 17:29:46 +0200 | [diff] [blame] | 559 | if [[ "$Q_PLUGIN_CONF_PATH" == '' || "$Q_PLUGIN_CONF_FILENAME" == '' || "$Q_PLUGIN_CLASS" == '' ]]; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 560 | die $LINENO "Neutron plugin not set.. exiting" |
| 561 | fi |
| 562 | |
| 563 | # If needed, move config file from ``$NEUTRON_DIR/etc/neutron`` to ``NEUTRON_CONF_DIR`` |
| 564 | mkdir -p /$Q_PLUGIN_CONF_PATH |
| 565 | Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME |
| 566 | cp $NEUTRON_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE |
| 567 | |
| 568 | iniset /$Q_PLUGIN_CONF_FILE database connection `database_connection_url $Q_DB_NAME` |
| 569 | iniset $NEUTRON_CONF DEFAULT state_path $DATA_DIR/neutron |
| 570 | |
| 571 | # If addition config files are set, make sure their path name is set as well |
| 572 | if [[ ${#Q_PLUGIN_EXTRA_CONF_FILES[@]} > 0 && $Q_PLUGIN_EXTRA_CONF_PATH == '' ]]; then |
| 573 | die $LINENO "Neutron additional plugin config not set.. exiting" |
| 574 | fi |
| 575 | |
| 576 | # If additional config files exist, copy them over to neutron configuration |
| 577 | # directory |
| 578 | if [[ $Q_PLUGIN_EXTRA_CONF_PATH != '' ]]; then |
| 579 | mkdir -p /$Q_PLUGIN_EXTRA_CONF_PATH |
| 580 | local f |
| 581 | for (( f=0; $f < ${#Q_PLUGIN_EXTRA_CONF_FILES[@]}; f+=1 )); do |
| 582 | Q_PLUGIN_EXTRA_CONF_FILES[$f]=$Q_PLUGIN_EXTRA_CONF_PATH/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} |
| 583 | cp $NEUTRON_DIR/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} /${Q_PLUGIN_EXTRA_CONF_FILES[$f]} |
| 584 | done |
| 585 | fi |
| 586 | |
Joe Gordon | bee5c50 | 2013-08-30 13:48:08 -0400 | [diff] [blame] | 587 | if [ "$VIRT_DRIVER" = 'fake' ]; then |
| 588 | # Disable arbitrary limits |
| 589 | iniset $NEUTRON_CONF quotas quota_network -1 |
| 590 | iniset $NEUTRON_CONF quotas quota_subnet -1 |
| 591 | iniset $NEUTRON_CONF quotas quota_port -1 |
| 592 | iniset $NEUTRON_CONF quotas quota_security_group -1 |
| 593 | iniset $NEUTRON_CONF quotas quota_security_group_rule -1 |
| 594 | fi |
| 595 | |
Salvatore Orlando | 05ae833 | 2013-08-20 14:51:08 -0700 | [diff] [blame] | 596 | # Format logging |
| 597 | if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then |
Salvatore Orlando | bc7f643 | 2013-11-25 10:11:14 -0800 | [diff] [blame] | 598 | setup_colorized_logging $NEUTRON_CONF DEFAULT project_id |
Salvatore Orlando | 05ae833 | 2013-08-20 14:51:08 -0700 | [diff] [blame] | 599 | fi |
| 600 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 601 | _neutron_setup_rootwrap |
| 602 | } |
| 603 | |
| 604 | function _configure_neutron_debug_command() { |
| 605 | if [[ "$Q_USE_DEBUG_COMMAND" != "True" ]]; then |
| 606 | return |
| 607 | fi |
| 608 | |
| 609 | cp $NEUTRON_DIR/etc/l3_agent.ini $NEUTRON_TEST_CONFIG_FILE |
| 610 | |
| 611 | iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT verbose False |
| 612 | iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT debug False |
| 613 | iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE |
| 614 | iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT root_helper "$Q_RR_COMMAND" |
| 615 | # Intermediate fix until Neutron patch lands and then line above will |
| 616 | # be cleaned. |
| 617 | iniset $NEUTRON_TEST_CONFIG_FILE agent root_helper "$Q_RR_COMMAND" |
| 618 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 619 | _neutron_setup_interface_driver $NEUTRON_TEST_CONFIG_FILE |
| 620 | |
| 621 | neutron_plugin_configure_debug_command |
| 622 | } |
| 623 | |
| 624 | function _configure_neutron_dhcp_agent() { |
| 625 | AGENT_DHCP_BINARY="$NEUTRON_BIN_DIR/neutron-dhcp-agent" |
| 626 | Q_DHCP_CONF_FILE=$NEUTRON_CONF_DIR/dhcp_agent.ini |
| 627 | |
| 628 | cp $NEUTRON_DIR/etc/dhcp_agent.ini $Q_DHCP_CONF_FILE |
| 629 | |
| 630 | iniset $Q_DHCP_CONF_FILE DEFAULT verbose True |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 631 | iniset $Q_DHCP_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 632 | iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE |
| 633 | iniset $Q_DHCP_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND" |
| 634 | |
Kyle Mestery | 73b2191 | 2013-08-22 11:25:21 +0000 | [diff] [blame] | 635 | # Define extra "DEFAULT" configuration options when q-dhcp is configured by |
| 636 | # defining the array ``Q_DHCP_EXTRA_DEFAULT_OPTS``. |
| 637 | # For Example: ``Q_DHCP_EXTRA_DEFAULT_OPTS=(foo=true bar=2)`` |
| 638 | for I in "${Q_DHCP_EXTRA_DEFAULT_OPTS[@]}"; do |
| 639 | # Replace the first '=' with ' ' for iniset syntax |
| 640 | iniset $Q_DHCP_CONF_FILE DEFAULT ${I/=/ } |
| 641 | done |
| 642 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 643 | _neutron_setup_interface_driver $Q_DHCP_CONF_FILE |
| 644 | |
| 645 | neutron_plugin_configure_dhcp_agent |
| 646 | } |
| 647 | |
| 648 | function _configure_neutron_l3_agent() { |
| 649 | Q_L3_ENABLED=True |
| 650 | # for l3-agent, only use per tenant router if we have namespaces |
| 651 | Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 652 | |
| 653 | AGENT_L3_BINARY=${AGENT_L3_BINARY:-"$NEUTRON_BIN_DIR/neutron-l3-agent"} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 654 | Q_L3_CONF_FILE=$NEUTRON_CONF_DIR/l3_agent.ini |
| 655 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 656 | if is_service_enabled q-fwaas; then |
| 657 | Q_FWAAS_CONF_FILE=$NEUTRON_CONF_DIR/fwaas_driver.ini |
| 658 | fi |
| 659 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 660 | cp $NEUTRON_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE |
| 661 | |
| 662 | iniset $Q_L3_CONF_FILE DEFAULT verbose True |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 663 | iniset $Q_L3_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 664 | iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE |
| 665 | iniset $Q_L3_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND" |
| 666 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 667 | _neutron_setup_interface_driver $Q_L3_CONF_FILE |
| 668 | |
| 669 | neutron_plugin_configure_l3_agent |
| 670 | } |
| 671 | |
| 672 | function _configure_neutron_metadata_agent() { |
| 673 | AGENT_META_BINARY="$NEUTRON_BIN_DIR/neutron-metadata-agent" |
| 674 | Q_META_CONF_FILE=$NEUTRON_CONF_DIR/metadata_agent.ini |
| 675 | |
| 676 | cp $NEUTRON_DIR/etc/metadata_agent.ini $Q_META_CONF_FILE |
| 677 | |
| 678 | iniset $Q_META_CONF_FILE DEFAULT verbose True |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 679 | iniset $Q_META_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 680 | iniset $Q_META_CONF_FILE DEFAULT nova_metadata_ip $Q_META_DATA_IP |
| 681 | iniset $Q_META_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND" |
| 682 | |
Yong Sheng Gong | 8535d8b | 2013-08-25 11:21:13 +0800 | [diff] [blame] | 683 | _neutron_setup_keystone $Q_META_CONF_FILE DEFAULT True True True |
Maru Newby | bf10ac5 | 2013-08-10 21:27:54 +0000 | [diff] [blame] | 684 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 685 | } |
| 686 | |
| 687 | function _configure_neutron_lbaas() { |
| 688 | neutron_agent_lbaas_configure_common |
| 689 | neutron_agent_lbaas_configure_agent |
| 690 | } |
| 691 | |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 692 | function _configure_neutron_metering() { |
| 693 | neutron_agent_metering_configure_common |
| 694 | neutron_agent_metering_configure_agent |
| 695 | } |
| 696 | |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 697 | function _configure_neutron_fwaas() { |
| 698 | neutron_fwaas_configure_common |
| 699 | neutron_fwaas_configure_driver |
| 700 | } |
| 701 | |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 702 | function _configure_neutron_vpn() |
| 703 | { |
| 704 | neutron_vpn_install_agent_packages |
| 705 | neutron_vpn_configure_common |
Nachi Ueno | 69b3ff6 | 2013-06-07 10:28:33 -0700 | [diff] [blame] | 706 | } |
| 707 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 708 | # _configure_neutron_plugin_agent() - Set config files for neutron plugin agent |
| 709 | # It is called when q-agt is enabled. |
| 710 | function _configure_neutron_plugin_agent() { |
| 711 | # Specify the default root helper prior to agent configuration to |
| 712 | # ensure that an agent's configuration can override the default |
| 713 | iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_COMMAND" |
| 714 | iniset $NEUTRON_CONF DEFAULT verbose True |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 715 | iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 716 | |
| 717 | # Configure agent for plugin |
| 718 | neutron_plugin_configure_plugin_agent |
| 719 | } |
| 720 | |
| 721 | # _configure_neutron_service() - Set config files for neutron service |
| 722 | # It is called when q-svc is enabled. |
| 723 | function _configure_neutron_service() { |
| 724 | Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini |
| 725 | Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json |
| 726 | |
| 727 | cp $NEUTRON_DIR/etc/api-paste.ini $Q_API_PASTE_FILE |
| 728 | cp $NEUTRON_DIR/etc/policy.json $Q_POLICY_FILE |
| 729 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 730 | # Update either configuration file with plugin |
| 731 | iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS |
| 732 | |
| 733 | if [[ $Q_SERVICE_PLUGIN_CLASSES != '' ]]; then |
| 734 | iniset $NEUTRON_CONF DEFAULT service_plugins $Q_SERVICE_PLUGIN_CLASSES |
| 735 | fi |
| 736 | |
| 737 | iniset $NEUTRON_CONF DEFAULT verbose True |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 738 | iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 739 | iniset $NEUTRON_CONF DEFAULT policy_file $Q_POLICY_FILE |
| 740 | iniset $NEUTRON_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP |
| 741 | |
| 742 | iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY |
| 743 | _neutron_setup_keystone $NEUTRON_CONF keystone_authtoken |
| 744 | |
Simon Pasquier | ca96b0a | 2013-07-09 16:59:12 +0200 | [diff] [blame] | 745 | # Define extra "DEFAULT" configuration options when q-svc is configured by |
| 746 | # defining the array ``Q_SRV_EXTRA_DEFAULT_OPTS``. |
| 747 | # For Example: ``Q_SRV_EXTRA_DEFAULT_OPTS=(foo=true bar=2)`` |
| 748 | for I in "${Q_SRV_EXTRA_DEFAULT_OPTS[@]}"; do |
| 749 | # Replace the first '=' with ' ' for iniset syntax |
| 750 | iniset $NEUTRON_CONF DEFAULT ${I/=/ } |
| 751 | done |
| 752 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 753 | # Configure plugin |
| 754 | neutron_plugin_configure_service |
| 755 | } |
| 756 | |
| 757 | # Utility Functions |
| 758 | #------------------ |
| 759 | |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame] | 760 | # _neutron_service_plugin_class_add() - add service plugin class |
| 761 | function _neutron_service_plugin_class_add() { |
| 762 | local service_plugin_class=$1 |
| 763 | if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then |
| 764 | Q_SERVICE_PLUGIN_CLASSES=$service_plugin_class |
| 765 | elif [[ ! ,${Q_SERVICE_PLUGIN_CLASSES}, =~ ,${service_plugin_class}, ]]; then |
| 766 | Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$service_plugin_class" |
| 767 | fi |
| 768 | } |
| 769 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 770 | # _neutron_setup_rootwrap() - configure Neutron's rootwrap |
| 771 | function _neutron_setup_rootwrap() { |
| 772 | if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then |
| 773 | return |
| 774 | fi |
| 775 | # Deploy new rootwrap filters files (owned by root). |
| 776 | # Wipe any existing ``rootwrap.d`` files first |
| 777 | Q_CONF_ROOTWRAP_D=$NEUTRON_CONF_DIR/rootwrap.d |
| 778 | if [[ -d $Q_CONF_ROOTWRAP_D ]]; then |
| 779 | sudo rm -rf $Q_CONF_ROOTWRAP_D |
| 780 | fi |
| 781 | # Deploy filters to ``$NEUTRON_CONF_DIR/rootwrap.d`` |
| 782 | mkdir -p -m 755 $Q_CONF_ROOTWRAP_D |
| 783 | cp -pr $NEUTRON_DIR/etc/neutron/rootwrap.d/* $Q_CONF_ROOTWRAP_D/ |
| 784 | sudo chown -R root:root $Q_CONF_ROOTWRAP_D |
| 785 | sudo chmod 644 $Q_CONF_ROOTWRAP_D/* |
| 786 | # Set up ``rootwrap.conf``, pointing to ``$NEUTRON_CONF_DIR/rootwrap.d`` |
| 787 | # location moved in newer versions, prefer new location |
| 788 | if test -r $NEUTRON_DIR/etc/neutron/rootwrap.conf; then |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 789 | sudo cp -p $NEUTRON_DIR/etc/neutron/rootwrap.conf $Q_RR_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 790 | else |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 791 | sudo cp -p $NEUTRON_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 792 | fi |
| 793 | sudo sed -e "s:^filters_path=.*$:filters_path=$Q_CONF_ROOTWRAP_D:" -i $Q_RR_CONF_FILE |
| 794 | sudo chown root:root $Q_RR_CONF_FILE |
| 795 | sudo chmod 0644 $Q_RR_CONF_FILE |
| 796 | # Specify ``rootwrap.conf`` as first parameter to neutron-rootwrap |
| 797 | ROOTWRAP_SUDOER_CMD="$NEUTRON_ROOTWRAP $Q_RR_CONF_FILE *" |
| 798 | |
| 799 | # Set up the rootwrap sudoers for neutron |
| 800 | TEMPFILE=`mktemp` |
Stephan Renatus | e578eff | 2013-11-19 13:31:04 +0100 | [diff] [blame] | 801 | echo "$STACK_USER ALL=(root) NOPASSWD: $ROOTWRAP_SUDOER_CMD" >$TEMPFILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 802 | chmod 0440 $TEMPFILE |
| 803 | sudo chown root:root $TEMPFILE |
| 804 | sudo mv $TEMPFILE /etc/sudoers.d/neutron-rootwrap |
| 805 | |
| 806 | # Update the root_helper |
| 807 | iniset $NEUTRON_CONF agent root_helper "$Q_RR_COMMAND" |
| 808 | } |
| 809 | |
| 810 | # Configures keystone integration for neutron service and agents |
| 811 | function _neutron_setup_keystone() { |
| 812 | local conf_file=$1 |
| 813 | local section=$2 |
| 814 | local use_auth_url=$3 |
Maru Newby | bf10ac5 | 2013-08-10 21:27:54 +0000 | [diff] [blame] | 815 | local skip_auth_cache=$4 |
Yong Sheng Gong | 8535d8b | 2013-08-25 11:21:13 +0800 | [diff] [blame] | 816 | local use_service_port=$5 |
| 817 | local keystone_port=$KEYSTONE_AUTH_PORT |
| 818 | if [[ -n $use_service_port ]]; then |
| 819 | keystone_port=$KEYSTONE_SERVICE_PORT |
| 820 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 821 | if [[ -n $use_auth_url ]]; then |
Yong Sheng Gong | 8535d8b | 2013-08-25 11:21:13 +0800 | [diff] [blame] | 822 | iniset $conf_file $section auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_AUTH_HOST:$keystone_port/v2.0" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 823 | else |
| 824 | iniset $conf_file $section auth_host $KEYSTONE_SERVICE_HOST |
Yong Sheng Gong | 8535d8b | 2013-08-25 11:21:13 +0800 | [diff] [blame] | 825 | iniset $conf_file $section auth_port $keystone_port |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 826 | iniset $conf_file $section auth_protocol $KEYSTONE_SERVICE_PROTOCOL |
| 827 | fi |
| 828 | iniset $conf_file $section admin_tenant_name $SERVICE_TENANT_NAME |
| 829 | iniset $conf_file $section admin_user $Q_ADMIN_USERNAME |
| 830 | iniset $conf_file $section admin_password $SERVICE_PASSWORD |
Maru Newby | bf10ac5 | 2013-08-10 21:27:54 +0000 | [diff] [blame] | 831 | if [[ -z $skip_auth_cache ]]; then |
| 832 | iniset $conf_file $section signing_dir $NEUTRON_AUTH_CACHE_DIR |
| 833 | # Create cache dir |
Emilien Macchi | a677b7f | 2013-11-25 23:40:20 +0100 | [diff] [blame] | 834 | create_neutron_cache_dir |
Maru Newby | bf10ac5 | 2013-08-10 21:27:54 +0000 | [diff] [blame] | 835 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 836 | } |
| 837 | |
| 838 | function _neutron_setup_interface_driver() { |
| 839 | |
| 840 | # ovs_use_veth needs to be set before the plugin configuration |
| 841 | # occurs to allow plugins to override the setting. |
| 842 | iniset $1 DEFAULT ovs_use_veth $Q_OVS_USE_VETH |
| 843 | |
| 844 | neutron_plugin_setup_interface_driver $1 |
| 845 | } |
| 846 | |
| 847 | # Functions for Neutron Exercises |
| 848 | #-------------------------------- |
| 849 | |
| 850 | function delete_probe() { |
| 851 | local from_net="$1" |
| 852 | net_id=`_get_net_id $from_net` |
| 853 | probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}'` |
| 854 | neutron-debug --os-tenant-name admin --os-username admin probe-delete $probe_id |
| 855 | } |
| 856 | |
| 857 | function setup_neutron_debug() { |
| 858 | if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then |
| 859 | public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME` |
| 860 | neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id |
| 861 | private_net_id=`_get_net_id $PRIVATE_NETWORK_NAME` |
| 862 | neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id |
| 863 | fi |
| 864 | } |
| 865 | |
| 866 | function teardown_neutron_debug() { |
| 867 | delete_probe $PUBLIC_NETWORK_NAME |
| 868 | delete_probe $PRIVATE_NETWORK_NAME |
| 869 | } |
| 870 | |
| 871 | function _get_net_id() { |
| 872 | neutron --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD net-list | grep $1 | awk '{print $2}' |
| 873 | } |
| 874 | |
| 875 | function _get_probe_cmd_prefix() { |
| 876 | local from_net="$1" |
| 877 | net_id=`_get_net_id $from_net` |
| 878 | probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1` |
| 879 | echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id" |
| 880 | } |
| 881 | |
| 882 | function _ping_check_neutron() { |
| 883 | local from_net=$1 |
| 884 | local ip=$2 |
| 885 | local timeout_sec=$3 |
| 886 | local expected=${4:-"True"} |
| 887 | local check_command="" |
| 888 | probe_cmd=`_get_probe_cmd_prefix $from_net` |
| 889 | if [[ "$expected" = "True" ]]; then |
| 890 | check_command="while ! $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done" |
| 891 | else |
| 892 | check_command="while $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done" |
| 893 | fi |
| 894 | if ! timeout $timeout_sec sh -c "$check_command"; then |
| 895 | if [[ "$expected" = "True" ]]; then |
| 896 | die $LINENO "[Fail] Couldn't ping server" |
| 897 | else |
| 898 | die $LINENO "[Fail] Could ping server" |
| 899 | fi |
| 900 | fi |
| 901 | } |
| 902 | |
| 903 | # ssh check |
| 904 | function _ssh_check_neutron() { |
| 905 | local from_net=$1 |
| 906 | local key_file=$2 |
| 907 | local ip=$3 |
| 908 | local user=$4 |
| 909 | local timeout_sec=$5 |
| 910 | local probe_cmd = "" |
| 911 | probe_cmd=`_get_probe_cmd_prefix $from_net` |
| 912 | if ! timeout $timeout_sec sh -c "while ! $probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success; do sleep 1; done"; then |
| 913 | die $LINENO "server didn't become ssh-able!" |
| 914 | fi |
| 915 | } |
| 916 | |
| 917 | # Neutron 3rd party programs |
| 918 | #--------------------------- |
| 919 | |
| 920 | # please refer to ``lib/neutron_thirdparty/README.md`` for details |
| 921 | NEUTRON_THIRD_PARTIES="" |
| 922 | for f in $TOP_DIR/lib/neutron_thirdparty/*; do |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 923 | third_party=$(basename $f) |
| 924 | if is_service_enabled $third_party; then |
| 925 | source $TOP_DIR/lib/neutron_thirdparty/$third_party |
| 926 | NEUTRON_THIRD_PARTIES="$NEUTRON_THIRD_PARTIES,$third_party" |
| 927 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 928 | done |
| 929 | |
| 930 | function _neutron_third_party_do() { |
| 931 | for third_party in ${NEUTRON_THIRD_PARTIES//,/ }; do |
| 932 | ${1}_${third_party} |
| 933 | done |
| 934 | } |
| 935 | |
| 936 | # configure_neutron_third_party() - Set config files, create data dirs, etc |
| 937 | function configure_neutron_third_party() { |
| 938 | _neutron_third_party_do configure |
| 939 | } |
| 940 | |
| 941 | # init_neutron_third_party() - Initialize databases, etc. |
| 942 | function init_neutron_third_party() { |
| 943 | _neutron_third_party_do init |
| 944 | } |
| 945 | |
| 946 | # install_neutron_third_party() - Collect source and prepare |
| 947 | function install_neutron_third_party() { |
| 948 | _neutron_third_party_do install |
| 949 | } |
| 950 | |
| 951 | # start_neutron_third_party() - Start running processes, including screen |
| 952 | function start_neutron_third_party() { |
| 953 | _neutron_third_party_do start |
| 954 | } |
| 955 | |
| 956 | # stop_neutron_third_party - Stop running processes (non-screen) |
| 957 | function stop_neutron_third_party() { |
| 958 | _neutron_third_party_do stop |
| 959 | } |
| 960 | |
| 961 | |
| 962 | # Restore xtrace |
| 963 | $XTRACE |
| 964 | |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 965 | # Tell emacs to use shell-script-mode |
| 966 | ## Local variables: |
| 967 | ## mode: shell-script |
| 968 | ## End: |