From 1de9a991df093b8b3a31dbd7ed75f17a0bb02b1d Mon Sep 17 00:00:00 2001 From: gong yong sheng Date: Fri, 14 Oct 2016 05:24:58 +0000 Subject: [PATCH] Allow to install tacker only env Introduce a TACKER_MODE variable. If this is set to 'all', the tacker devstack plugin will install other components just like previous way. If it is set to 'standalone', the tacker devstack plugin will disable all other services and enable the mysql, keystone, tacker and horizon services. Change-Id: I5d7613566ed45aa273848bfe85d76c7a7fe97ba1 Closes-bug: 1633327 Closes-bug: 1620163 --- devstack/lib/tacker | 32 +++++----- devstack/local.conf.standalone | 23 ++++++++ devstack/plugin.sh | 18 +++--- devstack/settings | 101 +++++++++++++++++--------------- doc/source/install/devstack.rst | 16 ++--- 5 files changed, 110 insertions(+), 80 deletions(-) create mode 100644 devstack/local.conf.standalone diff --git a/devstack/lib/tacker b/devstack/lib/tacker index b40c74335..f836e03d2 100644 --- a/devstack/lib/tacker +++ b/devstack/lib/tacker @@ -189,10 +189,6 @@ function _create_tacker_conf_dir { # configure_tacker() # Set common config for all tacker server and agents. function configure_tacker { - iniset "/$Q_PLUGIN_CONF_FILE" ml2 extension_drivers port_security - iniset "/$Q_PLUGIN_CONF_FILE" ml2_type_flat flat_networks $PUBLIC_PHYSICAL_NETWORK,$MGMT_PHYS_NET - iniset "/$Q_PLUGIN_CONF_FILE" ovs bridge_mappings $PUBLIC_PHYSICAL_NETWORK:$PUBLIC_BRIDGE,$MGMT_PHYS_NET:$BR_MGMT - _create_tacker_conf_dir cd $TACKER_DIR @@ -244,20 +240,26 @@ function configure_tacker { iniset $TACKER_CONF DEFAULT auth_strategy $TACKER_AUTH_STRATEGY _tacker_setup_keystone $TACKER_CONF keystone_authtoken - # Experimental settings for monitor alarm auth settings, - # Will be changed according to new implementation. - iniset $TACKER_CONF alarm_auth uername tacker - iniset $TACKER_CONF alarm_auth password "$SERVICE_PASSWORD" - iniset $TACKER_CONF alarm_auth project_name "$SERVICE_PROJECT_NAME" - iniset $TACKER_CONF alarm_auth url http://$SERVICE_HOST:35357/v3 + if [[ "${TACKER_MODE}" == "all" ]]; then + iniset "/$Q_PLUGIN_CONF_FILE" ml2 extension_drivers port_security + iniset "/$Q_PLUGIN_CONF_FILE" ml2_type_flat flat_networks $PUBLIC_PHYSICAL_NETWORK,$MGMT_PHYS_NET + iniset "/$Q_PLUGIN_CONF_FILE" ovs bridge_mappings $PUBLIC_PHYSICAL_NETWORK:$PUBLIC_BRIDGE,$MGMT_PHYS_NET:$BR_MGMT - iniset $TACKER_CONF tacker_heat heat_uri http://$SERVICE_HOST:8004/v1 - iniset $TACKER_CONF tacker_heat stack_retries 60 - iniset $TACKER_CONF tacker_heat stack_retry_wait 5 + # Experimental settings for monitor alarm auth settings, + # Will be changed according to new implementation. + iniset $TACKER_CONF alarm_auth uername tacker + iniset $TACKER_CONF alarm_auth password "$SERVICE_PASSWORD" + iniset $TACKER_CONF alarm_auth project_name "$SERVICE_PROJECT_NAME" + iniset $TACKER_CONF alarm_auth url http://$SERVICE_HOST:35357/v3 + iniset $TACKER_CONF tacker_heat heat_uri http://$SERVICE_HOST:8004/v1 + iniset $TACKER_CONF tacker_heat stack_retries 60 + iniset $TACKER_CONF tacker_heat stack_retry_wait 5 + + echo "Creating bridge" + sudo ovs-vsctl --may-exist add-br ${BR_MGMT} + fi _tacker_setup_rootwrap - echo "Creating bridge" - sudo ovs-vsctl --may-exist add-br ${BR_MGMT} } # Utility Functions diff --git a/devstack/local.conf.standalone b/devstack/local.conf.standalone new file mode 100644 index 000000000..969990ca3 --- /dev/null +++ b/devstack/local.conf.standalone @@ -0,0 +1,23 @@ +[[local|localrc]] +############################################################ +# Customize the following HOST_IP based on your installation +############################################################ +HOST_IP=127.0.0.1 +SERVICE_HOST=127.0.0.1 +SERVICE_PASSWORD=devstack +ADMIN_PASSWORD=devstack +SERVICE_TOKEN=devstack +DATABASE_PASSWORD=root +RABBIT_PASSWORD=password +ENABLE_HTTPD_MOD_WSGI_SERVICES=True +KEYSTONE_USE_MOD_WSGI=True + +# Logging +LOGFILE=$DEST/logs/stack.sh.log +SCREEN_LOGDIR=$DEST/logs/screen +VERBOSE=True +ENABLE_DEBUG_LOG_LEVEL=True +ENABLE_VERBOSE_LOG_LEVEL=True + +TACKER_MODE=standalone +enable_plugin tacker https://github.com/openstack/tacker master diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 03594e37d..d6529b53e 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -29,14 +29,16 @@ if is_service_enabled tacker; then start_tacker_api echo_summary "Installing tacker horizon" tacker_horizon_install - echo_summary "Modifying Heat policy.json file" - modify_heat_flavor_policy_rule - echo_summary "Setup initial tacker network" - tacker_create_initial_network - echo_summary "Upload OpenWrt image" - tacker_create_openwrt_image - echo_summary "Registering default VIM" - tacker_register_default_vim + if [[ "${TACKER_MODE}" == "all" ]]; then + echo_summary "Modifying Heat policy.json file" + modify_heat_flavor_policy_rule + echo_summary "Setup initial tacker network" + tacker_create_initial_network + echo_summary "Upload OpenWrt image" + tacker_create_openwrt_image + echo_summary "Registering default VIM" + tacker_register_default_vim + fi fi if [[ "$1" == "unstack" ]]; then diff --git a/devstack/settings b/devstack/settings index 4177401bc..7b86176a3 100644 --- a/devstack/settings +++ b/devstack/settings @@ -1,47 +1,54 @@ -# Nova -disable_service n-net -VIRT_DRIVER=libvirt - -#enable_service q-lbaas -#enable_service q-fwaas - -# TACKER_NEUTRON_AGENTS can be disabled by adding -# TACKER_NEUTRON_AGENTS='' in local.conf if neutron agents are running on a separate node -TACKER_NEUTRON_AGENTS=${TACKER_NEUTRON_AGENTS:-q-agt,q-dhcp,q-meta,q-l3} -for i in $(echo $TACKER_NEUTRON_AGENTS | sed 's/,/ /g') -do - enable_service $i -done - -enable_service q-svc -enable_service neutron - -# Heat -enable_service heat -enable_service h-eng -enable_service h-api -enable_service h-api-cfn -enable_service h-api-cw - -enable_service tacker - -# tacker-horizon isn't installable from pip -LIBS_FROM_GIT=tacker-horizon - -MGMT_PHYS_NET=${MGMT_PHYS_NET:-mgmtphysnet0} -BR_MGMT=${BR_MGMT:-br-mgmt0} -NET_MGMT=${NET_MGMT:-net_mgmt} -SUBNET_MGMT=${SUBNET_MGMT:-subnet_mgmt} -FIXED_RANGE_MGMT=${FIXED_RANGE_MGMT:-192.168.120.0/24} -NETWORK_GATEWAY_MGMT=${NETWORK_GATEWAY_MGMT:-192.168.120.1} -NETWORK_GATEWAY_MGMT_IP=${NETWORK_GATEWAY_MGMT_IP:-192.168.120.1/24} - -NET0=${NET0:-net0} -SUBNET0=${SUBNET0:-subnet0} -FIXED_RANGE0=${FIXED_RANGE0:-10.10.0.0/24} -NETWORK_GATEWAY0=${NETWORK_GATEWAY0:-10.10.0.1} - -NET1=${NET1:-net1} -SUBNET1=${SUBNET1:-subnet1} -FIXED_RANGE1=${FIXED_RANGE1:-10.10.1.0/24} -NETWORK_GATEWAY1=${NETWORK_GATEWAY1:-10.10.1.1} +TACKER_MODE=${TACKER_MODE:-all} +if [ "${TACKER_MODE}" == "all" ]; then + # Nova + disable_service n-net + VIRT_DRIVER=libvirt + + #enable_service q-lbaas + #enable_service q-fwaas + + # TACKER_NEUTRON_AGENTS can be disabled by adding + # TACKER_NEUTRON_AGENTS='' in local.conf if neutron agents are running on a separate node + TACKER_NEUTRON_AGENTS=${TACKER_NEUTRON_AGENTS:-q-agt,q-dhcp,q-meta,q-l3} + for i in $(echo $TACKER_NEUTRON_AGENTS | sed 's/,/ /g') + do + enable_service $i + done + + enable_service q-svc + enable_service neutron + + # Heat + enable_service heat + enable_service h-eng + enable_service h-api + enable_service h-api-cfn + enable_service h-api-cw + + enable_service tacker + + # tacker-horizon isn't installable from pip + LIBS_FROM_GIT=tacker-horizon + + MGMT_PHYS_NET=${MGMT_PHYS_NET:-mgmtphysnet0} + BR_MGMT=${BR_MGMT:-br-mgmt0} + NET_MGMT=${NET_MGMT:-net_mgmt} + SUBNET_MGMT=${SUBNET_MGMT:-subnet_mgmt} + FIXED_RANGE_MGMT=${FIXED_RANGE_MGMT:-192.168.120.0/24} + NETWORK_GATEWAY_MGMT=${NETWORK_GATEWAY_MGMT:-192.168.120.1} + NETWORK_GATEWAY_MGMT_IP=${NETWORK_GATEWAY_MGMT_IP:-192.168.120.1/24} + + NET0=${NET0:-net0} + SUBNET0=${SUBNET0:-subnet0} + FIXED_RANGE0=${FIXED_RANGE0:-10.10.0.0/24} + NETWORK_GATEWAY0=${NETWORK_GATEWAY0:-10.10.0.1} + + NET1=${NET1:-net1} + SUBNET1=${SUBNET1:-subnet1} + FIXED_RANGE1=${FIXED_RANGE1:-10.10.1.0/24} + NETWORK_GATEWAY1=${NETWORK_GATEWAY1:-10.10.1.1} +elif [ "${TACKER_MODE}" == "standalone" ]; then + ENABLED_SERVICES=key,horizon,tacker,mysql,dstat +else + die $LINENO "invalid value: $TACKER_MODE for TACKER_MODE" +fi diff --git a/doc/source/install/devstack.rst b/doc/source/install/devstack.rst index f0bf80f1f..fc184c3fb 100644 --- a/doc/source/install/devstack.rst +++ b/doc/source/install/devstack.rst @@ -60,14 +60,10 @@ place of branch-name as given below: $ ./stack.sh -Multi Node Environment -~~~~~~~~~~~~~~~~~~~~~~ - -In a multi-node devstack environment where controller, network and compute -nodes are separate, some neutron agents should not be installed in the -controller node. In such cases, use the following local.conf setting to disable -neutron agents in the controller node:: - - [[local|localrc]] - TACKER_NEUTRON_AGENTS='' +Standalone mode installation +~~~~~~~~~~~~~~~~~~~~~~~~~~ +By default, the tacker devstack plugin will install the tacker and other OpenStack +services together. By setting TACKER_MODE=standalone in local.conf, we will install +a standalone tacker environment with some mandatory OpenStack services, such as +KeyStone. After this installation, a default VIM must be registered manually.