Commit Graph

25 Commits

Author SHA1 Message Date
Zuul 48ec1759ed Merge "Add admin network support to SM" 2023-02-16 21:02:00 +00:00
Steven Webster db1eea124d Add admin network support to SM
Add SM support for the DC admin network

This commit adds SM support for the DC admin network.

The admin network is intended to be used between a subcloud
and system controller. Because the (existing) management network
is so embedded in other parts of the StarlingX system, it makes
it prohibitively hard to re-configure this network after initial
installation.  The admin network is intended to be isolated from
the management network, allowing re-configuration of the network
parameters in the case that the physical network between subcloud
and system controller has been changed.

In the case of admin network usage, the management network still
exist but is a private network in the context of a subcloud.

This specific commit provides for admin-ip and admin-interface
services to be added to the SM database and be recognized in
processing similar to the management, cluster-host, oam, etc
networks.

Since there is a requirement for the admin IP subnet information
to be allowed to change at runtime, in-service updating of SM
information relating to the admin-ip service (floating IP), as
well as unicast heartbeating between peers is also added in this
commit.

Testing:

AIO-SX:
    - admin-ip service is enabled when the admin network is
      created.
    - admin-ip service is not enabled when the admin network is
      not created.
    - floating-ip is updated on the admin interface when admin
      addr-pool information is changed.
AIO-DX:
    - admin-ip service is enabled when the admin network is
      created.
    - admin-ip service is not enabled when the admin network
      is not created.
    - floating-ip is updated on the active-controller when the
      admin addr-pool information is changed.
    - When a peer admin interface is down, an alarm is raised.
    - When a peer admin IP is not correct (changed), an alarm
      is raised.
    - Swact between controllers.
    - Inactive controller admin interface goes down
	Result: A 400.005 major communication loss fault is generated
               for the inactive controller entity
    - Inactive controller admin interface comes back up
        Result: The fault is cleared
    - Inactive controller admin IP address is removed/changed
        Result: Two 400.005 major communication loss faults are
                generated for both controller entities
    - Inactive controller admin node IP address is re-applied
        Result: The faults are cleared
    - Active admin interface goes down
        Result: A 400.005 major communication loss fault is generated
                for the inactive controller entity.  A swact is not
                issued.
    - Active admin interface comes back up
        Result: The fault is cleared
    - Active admin node IP address is removed/changed
        Result: Two 400.005 major communication loss faults are
                generated for both controller entities.
                A swact is not issued.
    - Active admin floating IP address is removed/changed
        Result: A 400.001 critical admin-services / admin-ip alarm
                is raised.
                A swact occurs.
                The floating admin IP is applied to the newly active
                controller. Alarms are cleared.
    - After the above test, the newly active controller swacts back
      to the previously active controller.
        Result: No alarms.
                The floating IP is applied to the newly active
		controller.
    - The cable for the management interface on the active controller
      is pulled
        Result: A swact occurs
    - The cable for the OAM interface on the active controller
      is pulled
        Result: A swact occurs
    - The cable for the Admin interface on the active controller
      is pulled
        Result: A swact occurs. 400.005 alarms are raised.
    - The mgmt, cluster-host, oam interfaces are all brought down/up at
      the same time.  The admin interface is also brought down,
      but not brought back up
      back up.
        Result: A swact occurs, with multiple controller-services
	related to the mgmt interface being in degraded state.

Story: 2010319
Task: 47278

Signed-off-by: Steven Webster <steven.webster@windriver.com>
Change-Id: I65df52600f4d5c499dceed32739cab414d36847a
2023-02-14 15:14:28 +00:00
Luis Sampaio 5d4ba83910 Update debian package versions to use git commits
The Debian packaging has been changed to reflect all the
git commits under the directory, and not just the commits
to the metadata folder.

This ensures that any new code submissions under those
directories will increment the versions.

Test Plan:
PASS: build-pkgs -p sm-common
PASS: build-pkgs -p sm-db
PASS: build-pkgs -p sm
PASS: build-pkgs -p sm-api
PASS: build-pkgs -p sm-client
PASS: build-pkgs -p sm-tools
PASS: build-pkgs -p stx-ocf-scripts

Story: 2010550
Task: 47341
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I54cde0fe252c3bcef669969a1b0675a2df8b3d69
2023-02-10 10:14:48 -08:00
Chuck Short c20bff717c debian: Clean up sm-mgmt-tools packaging
Make sure that the python is installed correctly.

Test Plan
PASS Build and test ISO.

Story: 2009101
Task: 43644

Signed-off-by: Chuck Short <charles.short@windriver.com>
Change-Id: I1bd2938b2fb861a2281fc6a3f3bf3f5408ccbb86
2022-03-08 15:59:24 +00:00
Zuul d2c1785496 Merge "Re-enable important py3k checks for ha" 2021-11-02 18:37:09 +00:00
Bernardo Decco 43ca8bc29c Re-enable important py3k checks for ha
Re-enabling some of the disabled tox warnings present on
the pylint.rc file

Re-enabling:

print-statement (E1601)

Test Plan: Sanity test run on AIO-SX:

PASS: test_system_health_pre_session[pods]
PASS: test_system_health_pre_session[alarms]
PASS: test_system_health_pre_session[system_apps]
PASS: test_wr_analytics[deploy_and_remove]
PASS: test_horizon_host_inventory_display
PASS: test_lock_unlock_host[controller]
PASS: test_pod_to_pod_connection
PASS: test_pod_to_service_connection
PASS: test_host_to_service_connection

Story: 2006796
Task: 43434
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I4b8b1dcec40d1255edccaa8873af558c382a4f67
2021-10-28 17:10:41 -03:00
Leonardo Fagundes Luz Serrano e905c2315b Add debian package for service-mgmt-tools
Add debian packaging infrastructure for service-mgmt-tools
to build a debian package.

Story: 2009101
Task: 43644

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: If3d3ea10e99490af29b4f55f5bdd15b900e339c9
2021-10-28 14:32:44 -03:00
Charles Short 1f48745689 Fix python3 compatibility
- Use six.moves for urllib2
- Use six.moves.xmlrpc_client
- Use six.moves.zip
- Adapt gettextutils
- Fix set() order dismatch for python 2/3
- Change dict key to list

Test:
- Build RPM with applied changes.
- Installed simplex controller checked to see if sm-api was running.

Story: 2006796
Task: 42388

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I29a81755f732b55f67321748604b2e5d951935c9
Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
(cherry picked from commit cdc4757a46)
2021-08-10 21:19:25 -04:00
Don Penney df739b210e Add auto-version for remaining stx/ha packages
Update remaining StarlingX packages with hardcoded TIS_PATCH_VER to
use PKG_GITREVCOUNT where possible, with offsets as needed to ensure
the version is incremented above the hardcoded version.

Story: 2008455
Task: 41447
Signed-off-by: Don Penney <don.penney@windriver.com>
Change-Id: Idf5ef476192cdf4923d6c903f1a15e03cfe9d03f
2020-12-17 13:27:02 -05:00
Abraham Arce 03b3f990ea openSUSE: Runtime Dependencies
Resolve runtime dependencies for the following service manager
components:

- sm-client
- sm-tools
- sm-api

High availability OBS workspace has been moved to xe1gyq home
project [0], adding repository
Cloud_StarlingX_2.0_openSUSE_Leap_15.1 [1] in order to:

- allow all succesfull packages appear under xe1gyq
  repository [2].
- automatically include other flock dependencies
  (e.g. mtce-devel).

Refer to the following OBS workspaces to verify all service
management packages have built successfully under repository
Cloud_StarlingX_2.0_openSUSE_Leap_15.1:

- https://build.opensuse.org/package/show/home:xe1gyq/sm-db
- https://build.opensuse.org/package/show/home:xe1gyq/sm-common
- https://build.opensuse.org/package/show/home:xe1gyq/sm
- https://build.opensuse.org/package/show/home:xe1gyq/sm-client
- https://build.opensuse.org/package/show/home:xe1gyq/sm-tools
- https://build.opensuse.org/package/show/home:xe1gyq/sm-api

[0] https://build.opensuse.org/project/show/home:xe1gyq
[1] https://build.opensuse.org/repositories/home:xe1gyq
[2] https://download.opensuse.org/repositories/home:/xe1gyq/

Depends-On: https://review.opendev.org/#/c/679686

Story: 2006684
Task: 36968
Task: 36969
Task: 36970

Change-Id: I0a21652fff83b5da8acdfb0191df87165b88389e
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2019-10-09 10:05:54 -05:00
Abraham Arce f38de3f45f openSUSE: Open Build Service Artifacts
OBS is a generic system to build and distribute binary packages
from sources [0], StarlingX OBS Project:

- Cloud:StarlingX:2.0 [1]

Build Service Management uses Open Build Service (OBS) with the
following base artifacts under Service Management repository:

- Specfiles
- Changelogs
- Rpmlintrcs

The following components are included and succesfully building,
(with their source OBS repository):

- sm        [2]
- sm-common [3]
- sm-db     [4]
- sm-api    [5]
- sm-client [6]
- sm-tools  [7]

The following considerations are taken for Gerrit files:

- Added %changelog directive to all specfiles

The following considerations are taken for OBS _service files:

- Added parameter "extract" to get spec, changes and rpmlintrc files.
- All component version standardized to 1.0.0

[0] openbuildservice.org
[1] https://build.opensuse.org/project/show/Cloud:StarlingX:2.0
[2] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm
[3] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-common
[4] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-db
[5] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-api
[6] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-client
[7] https://build.opensuse.org/package/show/home:xe1gyq:branches:Cloud:StarlingX:2.0/sm-tools

Story: 2006508
Task: 36495
Task: 36496
Task: 36497
Task: 36498
Task: 36534
Task: 36794

Change-Id: I06a7e132de4892b846d99977ff1bfc5bf240ade4
Co-authored-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
2019-10-09 10:05:20 -05:00
Hayde Martinez 8cd6cc65f1 sm-dump output not formatted properly
Using command: sudo sm-dump --impact --pid --pid_file
pid column is not formatted properly and there is no space
between pid and pid_file, this is due to pid's in linux can
have up to 7 characters.

This commit:
 a) Increases this field to 8 characters in order to fix format

Test:
 Use "sudo sm-dump --impact --pid --pid_file"
Closes-Bug: 1828045

Change-Id: I3966f12f68c6694078f8670962c0d4113b8820c6
Signed-off-by: Hayde Martinez <hayde.martinez.landa@intel.com>
2019-05-27 11:19:55 -05:00
Bin Qian 778d4e2dcf Add new provision/deprovison command option
Add "--apply" command option for sm-provision and sm-deprovision
commands to apply the change to SM immediately.

If SM runtime configuration has not already been created, the new option
will not do extra. SM will load the up-to-date configuration from static
db when it creates runtime configuration.

The new commands:
sm-provision service-group-member
sm-deprovision service-group-member

will provision/deprovision both service and service group member.
The commands below are now deprecated, although they are still supported
for backward compatibility.

sm-provision service
sm-deprovision service

Story: 2005486
Task: 30622

Depends-on: https://review.opendev.org/#/c/655766

Change-Id: I6dda4129ab1d121a7e5861d20a4df791c0c535a8
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2019-04-25 15:58:16 -04:00
Teresa Ho 5232bdd8fd SM monitoring for cluster-host-ip service
Added service domain for cluster host interface and service for
cluster host IP in the SM database.
Removed references of infrastructure interface.

Story: 2004273
Task: 29474

Change-Id: I6223047e9453eba83ea8b4ecf4db739d0f7d7665
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
2019-04-11 07:43:06 -04:00
Bin Qian 720232befe Enable configurable sm process priority through sm-configure
In some cases sm will need to adjust its process priority. This
change enables the configuring sm priority as part of sm at runtime

Partial-Bug: 1816764
Change-Id: I860759621c0d1389ca5a3c947d7973c185274bdd
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2019-02-22 10:37:24 -05:00
SidneyAn 729a8e7f36 Remove retired codes populated “V1” tables
the old source code which populate "V1" tables are no longer being used
in the current stx-ha design architecture.

Remove list:
  service-mgmt/sm-db-1.0.0/upgrades/
  service-mgmt/sm-db-1.0.0/scripts/sm-db-populate.script
  service-mgmt/sm-db-1.0.0/patches/*install.patch
  service-mgmt/sm-db-1.0.0/database/sm_database.xlsb
  service-mgmt-tools/sm-tools/sm-tools/sm-patch.py

Story: 2004752
Task: 28842

Change-Id: I9f230f900baafcb8495d8f7ed739bf8e182abae5
Signed-off-by: SidneyAn <ran1.an@intel.com>
2019-01-29 00:12:11 +08:00
Sun Austin da53f143ee Fix flake8 errors and disable ignore case
below issures are removed from ignore cases:
    E114 indentation is not a multiple of four (comment)
    E116 unexpected indentation (comment)
    E121 continuation line under-indented for hanging indent
    E122 continuation line missing indentation or outdented
    E123 closing bracket does not match indentation of opening bracket's line
    E124 closing bracket does not match visual indentation
    E125 continuation line with same indent as next logical line
    E126 continuation line over-indented for hanging indent
    E127 continuation line over-indented for visual indent
    E128 continuation line under-indented for visual indent
    E129 visually indented line with same indent as next logical line
    E131 continuation line unaligned for hanging indent
    E201 whitespace after '('
    E228 missing whitespace around modulo operator
    E231 missing whitespace after ','
    E241 multiple spaces after ':'
    E251 unexpected spaces around keyword / parameter equals
    E265 block comment should start with '#'
    E271 multiple spaces after keyword
    E302 expected 2 blank lines, found 1
    E303 too many blank lines
    E305 expected 2 blank lines after class or function definition, found 1
    E704 multiple statements on one line (def)
    E713 test for membership should be 'not in'
    E714 test for object identity should be 'is not'
    E722 do not use bare except'
    E731 do not assign a lambda expression, use a def
    E999 SyntaxError: invalid syntax (this is likely python3)
    F401 <foo> imported but unused
    F841 local variable 'foo' is assigned to but never used
    H201: no 'except:'
    H233: Python 3.x incompatible use of print operator
    B001 Do not use bare `except:`
    B004 Using `hasattr(x, '__call__')` to test
         if `x` is callable is unreliable.
    B305 `.next()` is not a thing on Python 3. Use the `next()` builtin.
    B306 `BaseException.message` has been deprecated as of Python 2.6
          and is removed in Python 3.
    B007 Loop control variable 'key' not used within the loop body.
remain below issues in ignores:
    E402 module level import not at top of file
    ./service-mgmt-api/sm-api/sm_api/cmd/__init__.py:25

    Hxxx since which are related with document format

    F811 redefinition of unused '<foo>' from line <x>
    ./service-mgmt-tools/sm-tools/sm_tools/sm_configure.py:18

    F821 undefined name 'e'
    ./service-mgmt-api/sm-api/sm_api/common/utils.py:448

    B006 Do not use mutable data structures for argument defaults.
    ./service-mgmt-api/sm-api/sm_api/common/service.py:59

    B008 Do not perform calls in argument defaults.
    ./service-mgmt-api/sm-api/sm_api/openstack/common/timeutils.py:117

Test have been done:Build,Deploy,some smc command,such as smc service-list,
smc service-show, sm-dump, etc

Story: 2003430
Task: 26524

Change-Id: I3e2a4a31f87e3ff66cfce86f54285e830ee1c3dc
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-11-07 08:12:37 +08:00
Bin Qian 01e3a2be4b Add new configuration for hbs cluster info
Add default of 2 new system configurations to sm.db.
Add configuration code to enable configure the options.

Story: 2003577
Task: 27727

Change-Id: I1a3dbaec78de591ef0de75ef9cafab48bcbb4dbf
Signed-off-by: Bin Qian <bin.qian@windriver.com>
2018-11-02 19:27:10 -04:00
Don Penney b4049622ec Add hooks for python wheel generation
This update adds hooks to the spec files for the following packages
to generate wheels for the python modules:
- sm-api
- sm-client
- sm-tools

Change-Id: If6ebbdaaad5ee7623cbbaa07b48d216461a16dec
Story: 2003907
Task: 27527
Signed-off-by: Don Penney <don.penney@windriver.com>
2018-10-24 17:13:06 +00:00
Sun Austin 4fe73f515d Fix: "except" issues for Python 2/3 compatible code.
change "except ValueError, e:"
to "except ValueError as e:"

and remove tox H231 from ignore for pep8 check
Story:2003430
Task: 26522

Change-Id: I06c7646c375ada7f8f06f870a7bdb0d7fc282e5a
Signed-off-by: Sun Austin <austin.sun@intel.com>
2018-10-22 11:49:35 +08:00
Erich Cordoba 54f4802bb1 Unsupress pylint warnings.
The W291,W292,W391,W503,W601 warnings were fixed and
tox.ini updated accordingly.

Story: 2002803
Task: 26911

Change-Id: I1e5f0b1f72b06ad8b5cac07921e9d14171623ba0
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2018-10-04 14:19:31 -05:00
zhangyangyang 75b8c70d9d Python 3 compatibility: use print as a function.
In Python 3 print is a function.
Especially for multiple string print, need to import
print_function from __future__.

Story: 2003430

Task: 24915

Signed-off: zhangyangyang <zhangyangyang@unionpay.com>

Change-Id: I40ae72b8efb7b342489ad2191ad02b0a5fb2898f
2018-08-31 15:42:43 +00:00
Bin Qian b62c18debf Fix slow VM recovery after unlocking AIO-SX host
Delay starting compute services until controller services are up. Add
new sm-query service-group support for the compute_config to determine
all controller service groups are enabled.

Change-Id: Ie5a5c941076d1295aabde40361bdaca9bcf3bfe1
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
2018-06-28 12:49:24 -04:00
Bin Qian c17f9fdfff Fix CLI sm-dump output
Cryptic message shown by CLI 'sudo sm-dump | head' properly close stdout
and stderr

Change-Id: I8437fff51993e12f4bfee1379ef3c0a8bc1109c3
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
2018-06-27 18:50:00 -04:00
Dean Troyer 17c909ec83 StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-05-31 07:36:26 -07:00