From f9e3d6ea35f404b58d67355dfc1a2349664fc9e7 Mon Sep 17 00:00:00 2001 From: CR_hui Date: Fri, 23 Dec 2016 17:46:34 +0800 Subject: [PATCH] Add configuration guide in the Tricircle 1. What is the problem Currently no configuration guide in the Tricircle. 2. What is the solution to the problem This patch adds configuration guide for the Tricircle. Only the configuration items of Tricircle will be described here. Logging, messaging, database, keystonemiddleware etc configuration which are generated from OpenStack OSLO libary, will not be described here. 3. What the features need to be implemented to the Tricircle to realize the solution None Change-Id: I73c972c60ef43f8cca394af6a1b52cd5751a0f8b Closes-Bug: #1652738 --- README.rst | 1 + doc/source/configuration.rst | 183 +++++++++++++++++++++ doc/source/index.rst | 2 + tricircle/tests/unit/xjob/test_xmanager.py | 2 +- tricircle/xjob/xservice.py | 2 +- 5 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 doc/source/configuration.rst diff --git a/README.rst b/README.rst index 807be9f9..a832caf2 100644 --- a/README.rst +++ b/README.rst @@ -48,6 +48,7 @@ detailed in the LICENSE file. * Wiki: https://wiki.openstack.org/wiki/tricircle * Installation guide: http://docs.openstack.org/developer/tricircle/installation-guide.html * Tricircle Admin API documentation: http://docs.openstack.org/developer/tricircle/api_v1.html +* Configuration guide: http://docs.openstack.org/developer/tricircle/configuration.html * Source: http://git.openstack.org/cgit/openstack/tricircle * Bugs: http://bugs.launchpad.net/tricircle * Blueprints: https://blueprints.launchpad.net/tricircle diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst new file mode 100644 index 00000000..99b676a9 --- /dev/null +++ b/doc/source/configuration.rst @@ -0,0 +1,183 @@ +A brief introduction to configure Tricircle service. Only the +configuration items for Tricircle will be described here. Logging, +messaging, database, keystonemiddleware etc configuration which are +generated from OpenStack Oslo library, will not be described here. Since +these configuration items are common to Nova, Cinder, Neutron. Please +refer to corresponding description from Nova, Cinder or Neutron. + +---------------- +Common options +---------------- +In the common configuration options, the group of "client" need to be +configured in Admin API, XJob, Local Plugin and Central Plugin. The +"tricircle_db_connection" should be configured in Admin API, XJob and +Central Plugin. + +.. _Common: + +.. list-table:: Description of common configuration options + :header-rows: 1 + :class: config-ref-table + + * - Configuration option = Default value + - Description + * - **[DEFAULT]** + - + * - ``tricircle_db_connection`` = ``None`` + - (String) database connection string for Tricircle, for example, mysql+pymysql://root:password@127.0.0.1/tricircle?charset=utf8 + * - **[client]** + - + * - ``admin_password`` = ``None`` + - (String) password of admin account, needed when auto_refresh_endpoint set to True, for example, password. + * - ``admin_tenant`` = ``None`` + - (String) tenant name of admin account, needed when auto_refresh_endpoint set to True, for example, demo. + * - ``admin_tenant_domain_name`` = ``Default`` + - (String) tenant domain name of admin account, needed when auto_refresh_endpoint set to True. + * - ``admin_user_domain_name`` = ``Default`` + - (String) user domain name of admin account, needed when auto_refresh_endpoint set to True. + * - ``admin_username`` = ``None`` + - (String) username of admin account, needed when auto_refresh_endpoint set to True. + * - ``auth_url`` = ``http://127.0.0.1:5000/v3`` + - (String) keystone authorization url, for example, http://$service_host:5000/v3 + * - ``auto_refresh_endpoint`` = ``True`` + - (Boolean) if set to True, endpoint will be automatically refreshed if timeout accessing endpoint. + * - ``ew_bridge_cidr`` = ``100.0.0.0/9`` + - (String) cidr pool of the east-west bridge network, for example, 100.0.0.0/9 + * - ``identity_url`` = ``http://127.0.0.1:35357/v3`` + - (String) keystone service url, for example, http://$service_host:35357/v3 + * - ``neutron_timeout`` = ``60`` + - (Integer) timeout for neutron client in seconds. + * - ``ns_bridge_cidr`` = ``100.128.0.0/9`` + - (String) cidr pool of the north-south bridge network, for example, 100.128.0.0/9 + * - ``top_pod_name`` = ``None`` + - (String) region name of Central Neutron in which client needs to access, for example, CentralRegion. + + + +------------------------------ + Tricircle Admin API settings +------------------------------ + +Tricircle Admin API servers for managing the mapping between OpenStack instances +and availability zone, retrieving object uuid routing and exposing API for +maintenance. The following items should be configured in Tricircle's api.conf. + +.. _Tricircle-Admin_API: + +.. list-table:: Description of Tricircle Admin API configuration options + :header-rows: 1 + :class: config-ref-table + + * - Configuration option = Default value + - Description + * - **[DEFAULT]** + - + * - ``api_workers`` = ``1`` + - (Integer) The port to bind to + * - ``auth_strategy`` = ``keystone`` + - (String) The type of authentication to use + * - ``bind_host`` = ``0.0.0.0`` + - (String) The host IP to bind to + * - ``bind_port`` = ``19999`` + - (Integer) The port to bind to + +----------------------- +Tricircle XJob settings +----------------------- + +Tricircle XJob serves for receiving and processing cross OpenStack +functionality and other async jobs from Admin API or Tricircle Central +Neutron Plugin. The following items should be configured in Tricircle's +xjob.conf. + +.. _Tricircle-Xjob: + +.. list-table:: Description of Tricircle XJob configuration options + :header-rows: 1 + :class: config-ref-table + + * - Configuration option = Default value + - Description + * - **[DEFAULT]** + - + * - ``periodic_enable`` = ``True`` + - (Boolean) Enable periodic tasks + * - ``periodic_fuzzy_delay`` = ``60`` + - (Integer) Range of seconds to randomly delay when starting the periodic task scheduler to reduce stampeding. (Disable by setting to 0) + * - ``report_interval`` = ``10`` + - (Integer) Seconds between nodes reporting state to datastore + * - ``host`` = ``tricircle.xhost`` + - (String) The host name for RPC server, each node should have different host name. + * - ``job_run_expire`` = ``180`` + - (Integer) Running job is considered expires after this time, in seconds + * - ``workers`` = ``1`` + - (Integer) Number of workers + * - ``worker_handle_timeout`` = ``1800`` + - (Integer) Timeout for worker's one turn of processing, in seconds + * - ``worker_sleep_time`` = ``60`` + - (Float) Seconds a worker sleeps after one run in a loop + +------------------------------- +Networking settings for Tricircle +------------------------------- +To make the networking automation work, two plugins need to be configured: +Tricircle Central Neutron Plugin and Tricircle Local Neutron Plugin. + +================================ +Tricircle Central Neutron Plugin +================================ +The Tricircle Central Neutron Plugin serves for tenant level L2/L3 networking +automation across multiple OpenStack instances. The following items should be +configured in central Neutron's neutron.conf. + +.. _Central Neutron: + +.. list-table:: Description of Central Neutron configuration options + :header-rows: 1 + :class: config-ref-table + + * - Configuration option = Default value + - Description + * - **[DEFAULT]** + - + * - ``core_plugin`` = ``None`` + - (String) core plugin central Neutron server uses, should be set to tricircle.network.central_plugin.TricirclePlugin + * - **[tricircle]** + - + * - ``bridge_network_type`` = ``shared_vlan`` + - (String) Type of l3 bridge network, this type should be enabled in tenant_network_types and is not local type, for example, shared_vlan. + * - ``network_vlan_ranges`` = ``None`` + - (String) List of :: or specifying physical_network names usable for VLAN provider and tenant networks, as well as ranges of VLAN tags on each available for allocation to tenant networks, for example,bridge:2001:3000. + * - ``tenant_network_types`` = ``local,shared_vlan`` + - (String) Ordered list of network_types to allocate as tenant networks. The default value "local" is useful for single pod connectivity. For example, local and shared_vlan. + * - ``type_drivers`` = ``local,shared_vlan`` + - (String) List of network type driver entry points to be loaded from the tricircle.network.type_drivers namespace. For example, local and shared_vlan. + + +=============================== +Tricircle Local Neutron Plugin +=============================== + +The Tricircle Local Neutron Plugin serves for cross Neutron networking +automation triggering. It is a shim layer between real core plugin and +Neutron API server. The following items should be configured in local +Neutron's neutron.conf + +.. _Local Neutron: + +.. list-table:: Description of Local Neutron configuration options + :header-rows: 1 + :class: config-ref-table + + * - Configuration option = Default value + - Description and Example + * - **[DEFAULT]** + - + * - ``core_plugin`` = ``None`` + - (String) core plugin local Neutron server uses, should be set to tricircle.network.local_plugin.TricirclePlugin + * - **[tricircle]** + - + * - ``central_neutron_url`` = ``None`` + - (String) Central Neutron server url, for example, http://$service_host:9696 + * - ``real_core_plugin`` = ``None`` + - (String) The core plugin the Tricircle local plugin will invoke, for example, neutron.plugins.ml2.plugin.Ml2Plugin diff --git a/doc/source/index.rst b/doc/source/index.rst index 56b842b5..b278691a 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,10 +14,12 @@ Contents: readme usage installation-guide + configuration api_v1 contributing + Indices and tables ================== diff --git a/tricircle/tests/unit/xjob/test_xmanager.py b/tricircle/tests/unit/xjob/test_xmanager.py index 34a98cd5..cb947928 100644 --- a/tricircle/tests/unit/xjob/test_xmanager.py +++ b/tricircle/tests/unit/xjob/test_xmanager.py @@ -353,7 +353,7 @@ class XManagerTest(unittest.TestCase): expired_job = { 'id': uuidutils.generate_uuid(), 'type': 'fake_resource', - 'timestamp': datetime.datetime.now() - datetime.timedelta(0, 120), + 'timestamp': datetime.datetime.now() - datetime.timedelta(0, 200), 'status': constants.JS_Running, 'resource_id': fake_id, 'extra_id': constants.SP_EXTRA_ID diff --git a/tricircle/xjob/xservice.py b/tricircle/xjob/xservice.py index 18dc8d94..5d5eb016 100644 --- a/tricircle/xjob/xservice.py +++ b/tricircle/xjob/xservice.py @@ -49,7 +49,7 @@ common_opts = [ cfg.IntOpt('worker_handle_timeout', default=1800, help=_("Timeout for worker's one turn of processing, in" " seconds")), - cfg.IntOpt('job_run_expire', default=60, + cfg.IntOpt('job_run_expire', default=180, help=_("Running job is considered expires after this time, in" " seconds")), cfg.FloatOpt('worker_sleep_time', default=0.1,