diff --git a/README.md b/README.md index 5f49aa2..a2e26fa 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,15 @@ python -m pip install -r requirements.txt EasyUCS can be used with command line interface or via a Web GUI. +### Using the Web Graphical User Interface (GUI) / the API + +The Web GUI is hosted by your machine, in order to launch it you need to use the file **[easyucs_api.py](./easyucs_api.py)**. + +``` +python easyucs_api.py +``` + + ### Using the Command-Line Interface (CLI) Push config file config_ucsm.json to UCS system @@ -128,17 +137,9 @@ Clear SEL Logs of all discovered servers of UCS system python easyucs.py device clear_sel_logs -t ucsm -i 192.168.0.1 -u admin -p password ``` -Clear Intersight Device Connector claim status for UCS system +Reset Device Connector for UCS system ``` -python easyucs.py device clear_intersight_claim_status -t ucsm -i 192.168.0.1 -u admin -p password -``` - -#### Using the Web Graphical User Interface (GUI) / the API - -The Web GUI is hosted by your machine, in order to launch it you need to use the file **[easyucs_api.py](./easyucs_api.py)**. - -``` -python easyucs_api.py +python easyucs.py device reset_device_connector -t ucsm -i 192.168.0.1 -u admin -p password ``` @@ -152,6 +153,14 @@ python easyucs_api.py ## Versioning +### 0.9.8.11 +* Add support for UCS X-Direct in UCSM config/inventory/report +* Add support for assigning user label to devices +* Add GUI support for Intersight SaaS/Appliance and SaaS regions +* Renamed clear_intersight_claim_status action to reset_device_connector +* Bump up minimum Intersight Appliance required version to 1.1.0-1 +* Miscellaneous bug fixes and improvements + ### 0.9.8.10 * Add support for a new Software Repository feature in EasyUCS UI, with ability to serve as an HTTP repo for ISO/firmware updates @@ -246,7 +255,7 @@ This also means that there are a few **breaking changes** in the JSON format for * Add support for Intersight Device Connector in inventory & config for UCSM & IMC * Add Device Connector section in UCSM & IMC report -* Add support for clearing Intersight Claim Status for UCSM & IMC Device Connector +* Add support for resetting UCSM & IMC Device Connector * Miscellaneous bug fixes ### 0.9.7 @@ -330,13 +339,13 @@ Initial release ## Authors -* **Marc Abu El Ghait** - *Initial work* - [github account link](https://github.com/mabuelgh) -* **Franck Bonneau** - *Initial work* - [github account link](https://github.com/Franck-Bonneau) -* **Vincent Esposito** - *Initial work* - [github account link](https://github.com/vesposito) +* **Marc Abu El Ghait** - *Initial work* - [GitHub account link](https://github.com/mabuelgh) +* **Franck Bonneau** - *Initial work* - [GitHub account link](https://github.com/Franck-Bonneau) +* **Vincent Esposito** - *Initial work* - [GitHub account link](https://github.com/vesposito) ## Contributors -* **Shashank Pandey** - *Repository, DB, API, Intersight, ...* - [github account link](https://github.com/Shashank-Pandey-ML) -* **Valentin Pereira** - *Redesigned GUI* - [github account link](https://github.com/Valisback) +* **Shashank Pandey** - *Repository, DB, API, Intersight, ...* - [GitHub account link](https://github.com/Shashank-Pandey-ML) +* **Valentin Pereira** - *Redesigned GUI* - [GitHub account link](https://github.com/Valisback) * **Mohamed Ismayil** - *Intersight support* * **Syeda Mehar Naseer** - *UCS Central/Manager & Intersight support* * **Anjana Devi Chilukuri** - *UCS Central/Manager & Intersight support* diff --git a/__init__.py b/__init__.py index 4302477..96afe0f 100644 --- a/__init__.py +++ b/__init__.py @@ -3,7 +3,7 @@ __author__ = "Marc Abu El Ghait, Franck Bonneau and Vincent Esposito" __copyright__ = "Copyright 2016-2024, Cisco" -__version__ = "0.9.8.10" +__version__ = "0.9.8.11" __status__ = "Development" # https://realpython.com/pypi-publish-python-package/ diff --git a/api/api_server.py b/api/api_server.py index 00a73de..4d8894b 100644 --- a/api/api_server.py +++ b/api/api_server.py @@ -41,7 +41,6 @@ "calculate_checksums": 300, "claim_to_intersight": 600, "clear_config": 3600, - "clear_intersight_claim_status": 300, "clear_sel_logs": 300, "create_vmedia_policy": 300, "download_file": 7200, @@ -54,6 +53,7 @@ "push_config": 10800, "regenerate_certificate": 300, "reset": 300, + "reset_device_connector": 300, "sync_to_software_repository": 600, "test_connection": 300 } @@ -409,10 +409,9 @@ def perform_action(device=None, action_type="", object_type="", task_uuid=None, sys.exit() if action_type not in ["add_device", "calculate_checksums", "claim_to_intersight", "clear_config", - "clear_intersight_claim_status", "clear_sel_logs", "create_vmedia_policy", - "download_file", "fetch", "fetch_os_firmware_data", "generate", "push", - "regenerate_certificate", "reset", "sync_to_software_repository", - "test_connection"]: + "clear_sel_logs", "create_vmedia_policy", "download_file", "fetch", + "fetch_os_firmware_data", "generate", "push", "regenerate_certificate", "reset", + "reset_device_connector", "sync_to_software_repository", "test_connection"]: easyucs.logger(level="error", message="Invalid action type provided") sys.exit() @@ -428,9 +427,9 @@ def perform_action(device=None, action_type="", object_type="", task_uuid=None, action_kwargs = {} # In case this is a clear, fetch or push operation, we first need to connect to the device - if action_type in ["add_device", "clear_config", "clear_intersight_claim_status", "clear_sel_logs", - "create_vmedia_policy", "fetch", "fetch_os_firmware_data", "push", "regenerate_certificate", - "reset", "sync_to_software_repository", "test_connection"]: + if action_type in ["add_device", "clear_config", "clear_sel_logs", "create_vmedia_policy", "fetch", + "fetch_os_firmware_data", "push", "regenerate_certificate", "reset", "reset_device_connector", + "sync_to_software_repository", "test_connection"]: if not device.connect(bypass_version_checks=device.metadata.bypass_version_checks): easyucs.logger(level="error", message="Failed to connect to " + device.metadata.device_type_long + " device", @@ -530,9 +529,9 @@ def perform_action(device=None, action_type="", object_type="", task_uuid=None, manager_target = None file_uuid = None file_path = None - if object_type in ["device"] and action_type in ["claim_to_intersight", "clear_config", - "clear_intersight_claim_status", "clear_sel_logs", - "fetch_os_firmware_data", "regenerate_certificate", "reset"]: + if object_type in ["device"] and action_type in ["claim_to_intersight", "clear_config", "clear_sel_logs", + "fetch_os_firmware_data", "regenerate_certificate", "reset", + "reset_device_connector"]: # The operation to perform is a direct call to the function at the device level action_target = getattr(device, action_type) @@ -564,8 +563,8 @@ def perform_action(device=None, action_type="", object_type="", task_uuid=None, response = action_target(**action_kwargs) # In case this is a claim, a clear, a fetch or a push operation, we now need to disconnect from the device - if action_type in ["add_device", "claim_to_intersight", "clear_config", "clear_intersight_claim_status", - "clear_sel_logs", "fetch", "fetch_os_firmware_data", "push", "regenerate_certificate", + if action_type in ["add_device", "claim_to_intersight", "clear_config", "clear_sel_logs", "fetch", + "fetch_os_firmware_data", "push", "regenerate_certificate", "reset_device_connector", "sync_to_software_repository", "test_connection"]: device.disconnect() @@ -980,9 +979,9 @@ def device_actions(): }, "cimc": { "display_name": "UCS IMC", - "available_actions": ["claim_to_intersight", "clear_intersight_claim_status", "clear_sel_logs", - "clear_user_sessions", "erase_all_virtual_drives", "erase_all_flexflash", - "regenerate_certificate", "reset", "set_all_drives_status", "test_connection"] + "available_actions": ["claim_to_intersight", "clear_sel_logs", "clear_user_sessions", + "erase_all_virtual_drives", "erase_all_flexflash","regenerate_certificate", + "reset", "reset_device_connector", "set_all_drives_status", "test_connection"] }, "ucsc": { "display_name": "UCS Central", @@ -990,10 +989,10 @@ def device_actions(): }, "ucsm": { "display_name": "UCS System", - "available_actions": ["claim_to_intersight", "clear_intersight_claim_status", "clear_sel_logs", - "clear_user_sessions", "decommission_all_rack_servers", - "erase_all_virtual_drives", "erase_all_flexflash", "regenerate_certificate", - "reset", "test_connection"] + "available_actions": ["claim_to_intersight", "clear_sel_logs", "clear_user_sessions", + "decommission_all_rack_servers", "erase_all_virtual_drives", + "erase_all_flexflash", "regenerate_certificate", "reset", + "reset_device_connector", "test_connection"] } } @@ -1231,15 +1230,53 @@ def devices_actions_claim_to_intersight(): return response -@app.route("/devices/actions/clear_intersight_claim_status", methods=['POST']) +@app.route("/devices/actions/delete", methods=['POST']) +# @cross_origin() +def devices_actions_delete(): + if request.method == 'POST': + try: + payload = request.json + + # Check if payload valid + if not validate_json(json_data=payload, schema_path="api/specs/devices_actions_delete.json", + logger=easyucs): + response = response_handle(code=400, response="Invalid payload") + return response + + device_uuid_list = payload["device_uuids"] + + devices_metadata_list = [] + + for device_uuid in device_uuid_list: + device_metadata_list = easyucs.repository_manager.get_metadata(object_type="device", uuid=device_uuid) + if len(device_metadata_list) == 1: + devices_metadata_list.append(device_metadata_list[0]) + else: + response = response_handle(response="Device with UUID " + device_uuid + " not found", code=404) + return response + + if easyucs.repository_manager.delete_bulk_from_repository(metadata_list=devices_metadata_list, + delete_keys=True): + response = response_handle(code=200) + else: + response = response_handle(code=500, response="Could not delete devices from repository") + + except BadRequest as err: + response = response_handle(code=err.code, response=str(err.description)) + except Exception as err: + response = response_handle(code=500, response=str(err)) + return response + + +@app.route("/devices/actions/reset_device_connector", methods=['POST']) # @cross_origin() -def devices_actions_clear_intersight_claim_status(): +def devices_actions_reset_device_connector(): if request.method == 'POST': try: payload = request.json # Check if payload valid - if not validate_json(json_data=payload, schema_path="api/specs/devices_actions_clear_intersight_claim_status.json", + if not validate_json(json_data=payload, schema_path="api/specs/devices_actions_reset_device_connector.json", logger=easyucs): response = response_handle(code=400, response="Invalid payload") return response @@ -1261,11 +1298,11 @@ def devices_actions_clear_intersight_claim_status(): task_uuid_list = [] for device in device_list: if device.metadata.device_type in ["cimc"]: - task_uuid = easyucs.task_manager.add_task(name="ClearIntersightClaimStatusUcsImc", + task_uuid = easyucs.task_manager.add_task(name="ResetDeviceConnectorUcsImc", device_name=str(device.name), device_uuid=str(device.uuid)) elif device.metadata.device_type in ["ucsm"]: - task_uuid = easyucs.task_manager.add_task(name="ClearIntersightClaimStatusUcsSystem", + task_uuid = easyucs.task_manager.add_task(name="ResetDeviceConnectorUcsSystem", device_name=str(device.name), device_uuid=str(device.uuid)) else: @@ -1274,13 +1311,13 @@ def devices_actions_clear_intersight_claim_status(): return response task_uuid_list.append(str(task_uuid)) - # We schedule the clear Intersight Claim Status actions through the scheduler + # We schedule the Reset Device Connector actions through the scheduler for task_uuid in task_uuid_list: pending_task = { "task_uuid": task_uuid, - "action_type": "clear_intersight_claim_status", + "action_type": "reset_device_connector", "object_type": "device", - "timeout": timeout_values["clear_intersight_claim_status"] + "timeout": timeout_values["reset_device_connector"] } if not easyucs.task_manager.add_to_pending_tasks(pending_task): response = response_handle(response="Error while scheduling the task. Task Queue might be Full." @@ -1288,7 +1325,7 @@ def devices_actions_clear_intersight_claim_status(): return response except Exception as err: - response = response_handle(response="Error while clearing Intersight Claim Status: " + str(err), code=500) + response = response_handle(response="Error while resetting Device Connector: " + str(err), code=500) return response response = response_handle(response={"tasks": task_uuid_list}, code=200) @@ -1300,44 +1337,6 @@ def devices_actions_clear_intersight_claim_status(): return response -@app.route("/devices/actions/delete", methods=['POST']) -# @cross_origin() -def devices_actions_delete(): - if request.method == 'POST': - try: - payload = request.json - - # Check if payload valid - if not validate_json(json_data=payload, schema_path="api/specs/devices_actions_delete.json", - logger=easyucs): - response = response_handle(code=400, response="Invalid payload") - return response - - device_uuid_list = payload["device_uuids"] - - devices_metadata_list = [] - - for device_uuid in device_uuid_list: - device_metadata_list = easyucs.repository_manager.get_metadata(object_type="device", uuid=device_uuid) - if len(device_metadata_list) == 1: - devices_metadata_list.append(device_metadata_list[0]) - else: - response = response_handle(response="Device with UUID " + device_uuid + " not found", code=404) - return response - - if easyucs.repository_manager.delete_bulk_from_repository(metadata_list=devices_metadata_list, - delete_keys=True): - response = response_handle(code=200) - else: - response = response_handle(code=500, response="Could not delete devices from repository") - - except BadRequest as err: - response = response_handle(code=err.code, response=str(err.description)) - except Exception as err: - response = response_handle(code=500, response=str(err)) - return response - - @app.route("/devices/", methods=['GET', 'DELETE', 'PUT']) # @cross_origin() def device_uuid(device_uuid): @@ -1471,17 +1470,17 @@ def device_uuid_actions(device_uuid): actions = None if device_type in ["cimc"]: - actions = ["claim_to_intersight", "clear_intersight_claim_status", "clear_sel_logs", - "clear_user_sessions", "erase_all_virtual_drives", "erase_all_flexflash", - "regenerate_certificate", "reset", "set_all_drives_status", "test_connection"] + actions = ["claim_to_intersight", "clear_sel_logs", "clear_user_sessions", + "erase_all_virtual_drives", "erase_all_flexflash", "regenerate_certificate", "reset", + "reset_device_connector", "set_all_drives_status", "test_connection"] elif device_type in ["intersight"]: actions = ["test_connection"] elif device_type in ["ucsc"]: actions = ["clear_user_sessions", "test_connection"] elif device_type in ["ucsm"]: - actions = ["claim_to_intersight", "clear_intersight_claim_status", "clear_sel_logs", - "clear_user_sessions", "decommission_all_rack_servers", "erase_all_virtual_drives", - "erase_all_flexflash", "regenerate_certificate", "reset", "test_connection"] + actions = ["claim_to_intersight", "clear_sel_logs", "clear_user_sessions", + "decommission_all_rack_servers", "erase_all_virtual_drives", "erase_all_flexflash", + "regenerate_certificate", "reset", "reset_device_connector", "test_connection"] actions_dict = {"actions": actions} @@ -1633,54 +1632,6 @@ def device_uuid_actions_clear_config(device_uuid): return response -@app.route("/devices//actions/clear_intersight_claim_status", methods=['POST']) -# @cross_origin() -def device_uuid_actions_clear_intersight_claim_status(device_uuid): - if request.method == 'POST': - try: - device = load_object(object_type="device", object_uuid=device_uuid) - if device: - try: - # We create a new task - if device.metadata.device_type in ["cimc"]: - task_uuid = easyucs.task_manager.add_task(name="ClearIntersightClaimStatusUcsImc", - device_name=str(device.name), - device_uuid=str(device.uuid)) - elif device.metadata.device_type in ["ucsm"]: - task_uuid = easyucs.task_manager.add_task(name="ClearIntersightClaimStatusUcsSystem", - device_name=str(device.name), - device_uuid=str(device.uuid)) - else: - response = response_handle(response="Unsupported device type", code=500) - return response - # We schedule the clear Intersight claim status action through the scheduler - pending_task = { - "task_uuid": task_uuid, - "action_type": "clear_intersight_claim_status", - "object_type": "device", - "timeout": timeout_values["clear_intersight_claim_status"] - } - if not easyucs.task_manager.add_to_pending_tasks(pending_task): - response = response_handle(response="Error while scheduling the task. Task Queue might be Full." - " Try again after some time.", code=400) - return response - except Exception as err: - response = response_handle(response="Error while performing clear Intersight Claim Status: " + - str(err), code=500) - return response - response = response_handle(response={"task": str(task_uuid)}, code=200) - - else: - response = response_handle(response="Device not found with UUID: " + device_uuid, code=404) - - except BadRequest as err: - response = response_handle(code=err.code, response=str(err.description)) - except Exception as err: - response = response_handle(response="Error while performing clear Intersight Claim Status: " + str(err), - code=500) - return response - - @app.route("/devices//actions/clear_sel_logs", methods=['POST']) # @cross_origin() def device_uuid_actions_clear_sel_logs(device_uuid): @@ -1859,11 +1810,11 @@ def device_uuid_actions_reset(device_uuid): device_name=str(device.name), device_uuid=str(device.uuid)) action_kwargs = { - "clear_intersight_claim_status": payload.get("clear_intersight_claim_status", True), "clear_sel_logs": payload.get("clear_sel_logs", False), "decommission_rack_servers": payload.get("decommission_rack_servers", True), "erase_flexflash": payload.get("erase_flexflash", False), "erase_virtual_drives": payload.get("erase_virtual_drives", False), + "reset_device_connector": payload.get("reset_device_connector", True), "unregister_from_central": payload.get("unregister_from_central", False) } elif device.metadata.device_type == "cimc": @@ -1871,7 +1822,7 @@ def device_uuid_actions_reset(device_uuid): device_name=str(device.name), device_uuid=str(device.uuid)) action_kwargs = { - "clear_intersight_claim_status": payload.get("clear_intersight_claim_status", False) + "reset_device_connector": payload.get("reset_device_connector", False) } else: response = response_handle(response="Resetting " + device.metadata.device_type + @@ -1900,6 +1851,54 @@ def device_uuid_actions_reset(device_uuid): return response +@app.route("/devices//actions/reset_device_connector", methods=['POST']) +# @cross_origin() +def device_uuid_actions_reset_device_connector(device_uuid): + if request.method == 'POST': + try: + device = load_object(object_type="device", object_uuid=device_uuid) + if device: + try: + # We create a new task + if device.metadata.device_type in ["cimc"]: + task_uuid = easyucs.task_manager.add_task(name="ResetDeviceConnectorUcsImc", + device_name=str(device.name), + device_uuid=str(device.uuid)) + elif device.metadata.device_type in ["ucsm"]: + task_uuid = easyucs.task_manager.add_task(name="ResetDeviceConnectorUcsSystem", + device_name=str(device.name), + device_uuid=str(device.uuid)) + else: + response = response_handle(response="Unsupported device type", code=500) + return response + # We schedule the Reset Device Connector action through the scheduler + pending_task = { + "task_uuid": task_uuid, + "action_type": "reset_device_connector", + "object_type": "device", + "timeout": timeout_values["reset_device_connector"] + } + if not easyucs.task_manager.add_to_pending_tasks(pending_task): + response = response_handle(response="Error while scheduling the task. Task Queue might be Full." + " Try again after some time.", code=400) + return response + except Exception as err: + response = response_handle(response="Error while performing Reset Device Connector: " + + str(err), code=500) + return response + response = response_handle(response={"task": str(task_uuid)}, code=200) + + else: + response = response_handle(response="Device not found with UUID: " + device_uuid, code=404) + + except BadRequest as err: + response = response_handle(code=err.code, response=str(err.description)) + except Exception as err: + response = response_handle(response="Error while performing Reset Device Connector: " + str(err), + code=500) + return response + + @app.route("/devices//actions/test_connection", methods=['POST']) # @cross_origin() def device_uuid_actions_test_connection(device_uuid): diff --git a/api/specs/devices_actions_clear_intersight_claim_status.json b/api/specs/devices_actions_clear_intersight_claim_status.json deleted file mode 100644 index fd9feb2..0000000 --- a/api/specs/devices_actions_clear_intersight_claim_status.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": "easyucs.json#/components/schemas/devices_actions_clear_intersight_claim_status_post" -} \ No newline at end of file diff --git a/api/specs/devices_actions_reset_device_connector.json b/api/specs/devices_actions_reset_device_connector.json new file mode 100644 index 0000000..2914e8c --- /dev/null +++ b/api/specs/devices_actions_reset_device_connector.json @@ -0,0 +1,3 @@ +{ + "$ref": "easyucs.json#/components/schemas/devices_actions_reset_device_connector_post" +} \ No newline at end of file diff --git a/api/specs/easyucs.json b/api/specs/easyucs.json index 4598a3e..2070c03 100644 --- a/api/specs/easyucs.json +++ b/api/specs/easyucs.json @@ -1,7 +1,7 @@ { "openapi": "3.0.3", "info": { - "version": "0.9.8.10", + "version": "0.9.8.11", "title": "EasyUCS API", "description": "Description of EasyUCS API" }, @@ -79,11 +79,6 @@ ], "example": "cvd" }, - "clear_intersight_claim_status": { - "type": "boolean", - "description": "Clear Intersight claim status if claimed", - "example": true - }, "clear_sel_logs": { "type": "boolean", "description": "Clear SEL logs from all servers", @@ -532,6 +527,11 @@ "description": "UUID of the report", "example": "783670e4-c03c-40a8-89cf-2eb9eacc2c6a" }, + "reset_device_connector": { + "type": "boolean", + "description": "Reset Device Connector", + "example": true + }, "restore_repo": { "type": "boolean", "description": "Whether to restore repofiles and reposynctodevice tables", @@ -812,7 +812,6 @@ "description": "Action", "example": "reset", "enum": [ - "clear_intersight_claim_status", "clear_sel_logs", "clear_user_sessions", "decommission_all_rack_servers", @@ -820,6 +819,7 @@ "erase_all_flexflash", "regenerate_certificate", "reset", + "reset_device_connector", "set_all_drives_status" ] } @@ -1324,9 +1324,6 @@ "password": { "$ref": "#/components/schemas/password" }, - "clear_intersight_claim_status": { - "$ref": "#/components/schemas/clear_intersight_claim_status" - }, "clear_sel_logs": { "$ref": "#/components/schemas/clear_sel_logs" }, @@ -1339,6 +1336,9 @@ "erase_virtual_drives": { "$ref": "#/components/schemas/erase_virtual_drives" }, + "reset_device_connector": { + "$ref": "#/components/schemas/reset_device_connector" + }, "unregister_from_central": { "$ref": "#/components/schemas/unregister_from_central" } @@ -1370,7 +1370,7 @@ }, "additionalProperties": false }, - "devices_actions_clear_intersight_claim_status_post": { + "devices_actions_delete_post": { "type": "object", "required": [ "device_uuids" @@ -1385,7 +1385,7 @@ }, "additionalProperties": false }, - "devices_actions_delete_post": { + "devices_actions_reset_device_connector_post": { "type": "object", "required": [ "device_uuids" @@ -2204,7 +2204,7 @@ "restore_repo": { "name": "restore_repo", "in": "query", - "description": "Whether to resore repofiles and reposynctodevice tables", + "description": "Whether to restore repofiles and reposynctodevice tables", "schema": { "$ref": "#/components/schemas/restore_repo" } @@ -2705,42 +2705,26 @@ } } }, - "/devices/actions/clear_intersight_claim_status": { + "/devices/actions/delete": { "post": { "tags": [ "devices" ], - "summary": "Clears the Intersight Claim Status of a list of devices", - "description": "Clears the Intersight Claim Status of a list of devices in EasyUCS.", + "summary": "Deletes a list of devices", + "description": "Deletes a list of devices in EasyUCS.", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/devices_actions_clear_intersight_claim_status_post" + "$ref": "#/components/schemas/devices_actions_delete_post" } } } }, "responses": { "200": { - "description": "A list of task UUIDs", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tasks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/task_uuid" - } - } - }, - "additionalProperties": false - } - } - } + "description": "Devices successfully deleted" }, "400": { "$ref": "#/components/responses/400ClientError" @@ -2751,26 +2735,42 @@ } } }, - "/devices/actions/delete": { + "/devices/actions/reset_device_connector": { "post": { "tags": [ "devices" ], - "summary": "Deletes a list of devices", - "description": "Deletes a list of devices in EasyUCS.", + "summary": "Resets the Device Connector of a list of devices", + "description": "Resets the Device Connector of a list of devices in EasyUCS.", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/devices_actions_delete_post" + "$ref": "#/components/schemas/devices_actions_reset_device_connector_post" } } } }, "responses": { "200": { - "description": "Devices successfully deleted" + "description": "A list of task UUIDs", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tasks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/task_uuid" + } + } + }, + "additionalProperties": false + } + } + } }, "400": { "$ref": "#/components/responses/400ClientError" @@ -3006,47 +3006,6 @@ } } }, - "/devices/{device_uuid}/actions/clear_intersight_claim_status": { - "post": { - "tags": [ - "devices" - ], - "summary": "Clears Intersight Claim Status of given UCS device", - "description": "Clears Intersight Claim Status of given UCS device", - "parameters": [ - { - "$ref": "#/components/parameters/device_uuid" - } - ], - "responses": { - "200": { - "description": "The corresponding task to follow progress", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "task": { - "$ref": "#/components/schemas/task_uuid" - } - }, - "additionalProperties": false - } - } - } - }, - "400": { - "$ref": "#/components/responses/400ClientError" - }, - "404": { - "$ref": "#/components/responses/404NotFound" - }, - "500": { - "$ref": "#/components/responses/500ServerError" - } - } - } - }, "/devices/{device_uuid}/actions/clear_config": { "post": { "tags": [ @@ -3284,6 +3243,47 @@ } } }, + "/devices/{device_uuid}/actions/reset_device_connector": { + "post": { + "tags": [ + "devices" + ], + "summary": "Resets Device Connector of given UCS device", + "description": "Resets Device Connector of given UCS device", + "parameters": [ + { + "$ref": "#/components/parameters/device_uuid" + } + ], + "responses": { + "200": { + "description": "The corresponding task to follow progress", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "task": { + "$ref": "#/components/schemas/task_uuid" + } + }, + "additionalProperties": false + } + } + } + }, + "400": { + "$ref": "#/components/responses/400ClientError" + }, + "404": { + "$ref": "#/components/responses/404NotFound" + }, + "500": { + "$ref": "#/components/responses/500ServerError" + } + } + } + }, "/devices/{device_uuid}/actions/test_connection": { "post": { "tags": [ diff --git a/api/specs/easyucs.yaml b/api/specs/easyucs.yaml index a1fec93..c89ea22 100644 --- a/api/specs/easyucs.yaml +++ b/api/specs/easyucs.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: '0.9.8.10' + version: '0.9.8.11' title: EasyUCS API description: Description of EasyUCS API servers: @@ -53,10 +53,6 @@ components: - custom - cvd example: cvd - clear_intersight_claim_status: - type: boolean - description: Clear Intersight claim status if claimed - example: true clear_sel_logs: type: boolean description: Clear SEL logs from all servers @@ -157,14 +153,14 @@ components: description: Version of the device example: 4.1(3b) disk_utilization: - type: object - properties: - available_disk: - $ref: '#/components/schemas/available_disk' - total_disk: - $ref: '#/components/schemas/total_disk' - used_disk: - $ref: '#/components/schemas/used_disk' + type: object + properties: + available_disk: + $ref: '#/components/schemas/available_disk' + total_disk: + $ref: '#/components/schemas/total_disk' + used_disk: + $ref: '#/components/schemas/used_disk' easyucs_version: type: string description: Version of EasyUCS @@ -410,6 +406,10 @@ components: type: string description: UUID of the report example: 783670e4-c03c-40a8-89cf-2eb9eacc2c6a + reset_device_connector: + type: boolean + description: Reset Device Connector + example: true restore_repo: type: boolean description: Whether to restore repofiles and reposynctodevice tables @@ -532,9 +532,9 @@ components: type: string description: Timestamp of the last modification of the object example: '2022-06-15T09:17:43.418Z' - total_disk: - type: string - description: Size of the total disk (in Giga bytes) + total_disk: + type: string + description: Size of the total disk (in Giga bytes) unregister_from_central: type: boolean description: Unregister UCS device from central @@ -552,8 +552,8 @@ components: description: Whether to upload in chunks or not example: true used_disk: - type: string - description: Size of the used disk (in Giga bytes) + type: string + description: Size of the used disk (in Giga bytes) username: type: string description: Username associated with the device @@ -625,7 +625,6 @@ components: description: Action example: reset enum: - - clear_intersight_claim_status - clear_sel_logs - clear_user_sessions - decommission_all_rack_servers @@ -633,6 +632,7 @@ components: - erase_all_flexflash - regenerate_certificate - reset + - reset_device_connector - set_all_drives_status actions_inventory_get: type: array @@ -970,8 +970,6 @@ components: properties: password: $ref: '#/components/schemas/password' - clear_intersight_claim_status: - $ref: '#/components/schemas/clear_intersight_claim_status' clear_sel_logs: $ref: '#/components/schemas/clear_sel_logs' decommission_rack_servers: @@ -980,6 +978,8 @@ components: $ref: '#/components/schemas/erase_flexflash' erase_virtual_drives: $ref: '#/components/schemas/erase_virtual_drives' + reset_device_connector: + $ref: '#/components/schemas/reset_device_connector' unregister_from_central: $ref: '#/components/schemas/unregister_from_central' additionalProperties: false @@ -1000,7 +1000,7 @@ components: proxy_details: $ref: '#/components/schemas/device_connector_proxy' additionalProperties: false - devices_actions_clear_intersight_claim_status_post: + devices_actions_delete_post: type: object required: - device_uuids @@ -1010,7 +1010,7 @@ components: items: $ref: '#/components/schemas/device_uuid' additionalProperties: false - devices_actions_delete_post: + devices_actions_reset_device_connector_post: type: object required: - device_uuids @@ -1578,7 +1578,7 @@ components: restore_repo: name: restore_repo in: query - description: Whether to resore repofiles and reposynctodevice tables + description: Whether to restore repofiles and reposynctodevice tables schema: $ref: '#/components/schemas/restore_repo' report_uuid: @@ -1860,50 +1860,50 @@ paths: $ref: '#/components/responses/400ClientError' '500': $ref: '#/components/responses/500ServerError' - '/devices/actions/clear_intersight_claim_status': + '/devices/actions/delete': post: tags: - devices - summary: Clears the Intersight Claim Status of a list of devices - description: Clears the Intersight Claim Status of a list of devices in EasyUCS. + summary: Deletes a list of devices + description: Deletes a list of devices in EasyUCS. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/devices_actions_clear_intersight_claim_status_post' + $ref: '#/components/schemas/devices_actions_delete_post' responses: '200': - description: A list of task UUIDs - content: - application/json: - schema: - type: object - properties: - tasks: - type: array - items: - $ref: '#/components/schemas/task_uuid' - additionalProperties: false + description: Devices successfully deleted '400': $ref: '#/components/responses/400ClientError' '500': $ref: '#/components/responses/500ServerError' - '/devices/actions/delete': + '/devices/actions/reset_device_connector': post: tags: - devices - summary: Deletes a list of devices - description: Deletes a list of devices in EasyUCS. + summary: Resets the Device Connector of a list of devices + description: Resets the Device Connector of a list of devices in EasyUCS. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/devices_actions_delete_post' + $ref: '#/components/schemas/devices_actions_reset_device_connector_post' responses: '200': - description: Devices successfully deleted + description: A list of task UUIDs + content: + application/json: + schema: + type: object + properties: + tasks: + type: array + items: + $ref: '#/components/schemas/task_uuid' + additionalProperties: false '400': $ref: '#/components/responses/400ClientError' '500': @@ -2045,31 +2045,6 @@ paths: $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500ServerError' - '/devices/{device_uuid}/actions/clear_intersight_claim_status': - post: - tags: - - devices - summary: Clears Intersight Claim Status of given UCS device - description: Clears Intersight Claim Status of given UCS device - parameters: - - $ref: '#/components/parameters/device_uuid' - responses: - '200': - description: The corresponding task to follow progress - content: - application/json: - schema: - type: object - properties: - task: - $ref: '#/components/schemas/task_uuid' - additionalProperties: false - '400': - $ref: '#/components/responses/400ClientError' - '404': - $ref: '#/components/responses/404NotFound' - '500': - $ref: '#/components/responses/500ServerError' '/devices/{device_uuid}/actions/clear_config': post: tags: @@ -2215,6 +2190,31 @@ paths: $ref: '#/components/responses/404NotFound' '500': $ref: '#/components/responses/500ServerError' + '/devices/{device_uuid}/actions/reset_device_connector': + post: + tags: + - devices + summary: Resets Device Connector of given UCS device + description: Resets Device Connector of given UCS device + parameters: + - $ref: '#/components/parameters/device_uuid' + responses: + '200': + description: The corresponding task to follow progress + content: + application/json: + schema: + type: object + properties: + task: + $ref: '#/components/schemas/task_uuid' + additionalProperties: false + '400': + $ref: '#/components/responses/400ClientError' + '404': + $ref: '#/components/responses/404NotFound' + '500': + $ref: '#/components/responses/500ServerError' '/devices/{device_uuid}/actions/test_connection': post: tags: diff --git a/catalog/fabric_interconnects/UCSX-S9108-100G.json b/catalog/fabric_interconnects/UCSX-S9108-100G.json new file mode 100644 index 0000000..79c9726 --- /dev/null +++ b/catalog/fabric_interconnects/UCSX-S9108-100G.json @@ -0,0 +1,81 @@ +{ + "model_short_name": "S9108-100G", + "rear_file_name": "UCSX-S9108-100G.png", + "front_file_name": "", + "rear_file_size": [2283,267], + "front_file_size": [], + "expansion_modules_slots": [], + "expansion_modules_models": [], + "rear_ports": { + "1": { + "port_coord": [428, 61], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "2": { + "port_coord": [428, 163], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "3": { + "port_coord": [582, 61], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "4": { + "port_coord": [582, 163], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "5": { + "port_coord": [1583, 61], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "6": { + "port_coord": [1583, 163], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "7": { + "port_coord": [1737, 61], + "port_type": "qsfp28", + "port_size": [111, 52] + }, + "8": { + "port_coord": [1737, 163], + "port_type": "qsfp28", + "port_size": [111, 52] + } + }, + "imm_compatible": true, + "imm_min_required_version": "4.3(4b)", + "spec_sheet_url": "https://www.cisco.com/c/dam/en/us/products/collateral/servers-unified-computing/ucs-x-series-modular-system/ucs-fabric-interconnect-9108-100g.pdf", + "data_sheet_url": "https://www.cisco.com/c/en/us/products/collateral/servers-unified-computing/ucs-x-series-modular-system/ucs-x-series-direct-ds.html", + "specs": { + "descr": "The Cisco UCS X-Direct 9108 100G Fabric Interconnect is a 100 Gigabit Ethernet, FCoE, and Fibre Channel switch offering up to 1.6 Tbps throughput and up to 8 ports. The switch has 6 fixed ports that can support 1/10/25/40/100-Gbps Ethernet and 2 fixed unified ports that can support 1/10/25/40/100-Gbps Ethernet or 8/16/32-Gbps Fibre Channel via Breakout. All Ethernet ports are capable of supporting FCoE.", + "form_factor": "Intelligent Fabric Module", + "throughput": { + "gbps": 1600, + "mpps": 0 + }, + "latency": "<1 µs", + "dimensions": { + "centimeters": { + "height": 4.2, + "width": 37.9, + "depth": 29.9 + }, + "inches": { + "height": 1.67, + "width": 14.93, + "depth": 11.76 + }, + "rack_units": 0 + }, + "weight": { + "lb": 8.42, + "kg": 3.82 + } + } +} \ No newline at end of file diff --git a/catalog/fabric_interconnects/img/UCSX-S9108-100G.png b/catalog/fabric_interconnects/img/UCSX-S9108-100G.png new file mode 100644 index 0000000..a6aa005 Binary files /dev/null and b/catalog/fabric_interconnects/img/UCSX-S9108-100G.png differ diff --git a/config/intersight/bios_table.json b/config/intersight/bios_table.json index 51e0561..20a578d 100644 --- a/config/intersight/bios_table.json +++ b/config/intersight/bios_table.json @@ -1146,7 +1146,10 @@ "c1auto_demotion": { "type": "enum", "ucsc_token_map": { - "Auto": [], + "Auto": [ + "Auto", + "auto" + ], "disabled": [ "disabled", "Disabled" @@ -1189,7 +1192,10 @@ "c1auto_un_demotion": { "type": "enum", "ucsc_token_map": { - "Auto": [], + "Auto": [ + "Auto", + "auto" + ], "disabled": [ "disabled", "Disabled" @@ -1279,11 +1285,21 @@ "cbs_cmn_cpu_avx512": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -1423,12 +1439,12 @@ "values": [ "platform-default", "Auto", + "TWO (1 + 1)", "FOUR (2 + 2)", - "FOUR (4 + 0)", + "TWO (2 + 0)", "SIX (3 + 3)", "THREE (3 + 0)", - "TWO (1 + 1)", - "TWO (2 + 0)" + "FOUR (4 + 0)" ] }, "cbs_cmn_cpu_global_cstate_ctrl": { @@ -1715,11 +1731,21 @@ "cbs_cmn_edc_control_throttle": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -1788,12 +1814,25 @@ "cbs_cmn_efficiency_mode_en_rs": { "type": "enum", "ucsc_token_map": { - "Balanced Memory Performance Mode": [], - "Efficiency Mode": [], - "High Performance Mode": [], - "Maximum IO Performance Mode": [], + "Balanced Memory Performance Mode": [ + "Balanced-Memory-Performance-Mode", + "balanced-memory-performance-mode" + ], + "Efficiency Mode": [ + "Efficiency-Mode", + "efficiency-mode" + ], + "High Performance Mode": [ + "High-Performance-Mode", + "high-performance-mode" + ], + "Maximum IO Performance Mode": [ + "Maximum-IO-Performance-Mode", + "maximum-io-performance-mode" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -1995,11 +2034,21 @@ "cbs_cmn_gnb_smu_dlwm_support": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2123,11 +2172,21 @@ "cbs_cmn_mem_ctrller_pwr_dn_en_ddr": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2156,14 +2215,6 @@ "enabled" ] }, - "cbs_cmn_mem_dram_refresh_rate": { - "type": "enum", - "values": [ - "platform-default", - "3.9 usec", - "7.8 usec" - ] - }, "cbs_cmn_mem_map_bank_interleave_ddr4": { "type": "enum", "ucsc_token_map": { @@ -2171,11 +2222,11 @@ "Auto", "auto" ], + "Enabled": [], "disabled": [ "disabled", "Disabled" ], - "enabled": [], "platform-default": [ "Platform Default", "platform-default" @@ -2186,11 +2237,11 @@ "Auto", "auto" ], + "Enabled": [], "disabled": [ "disabled", "Disabled" ], - "enabled": [], "platform-default": [ "Platform Default", "platform-default" @@ -2201,23 +2252,51 @@ "platform-default", "Auto", "disabled", - "enabled" + "Enabled" ] }, "cbs_cmn_mem_speed_ddr47xx2": { "type": "enum", "ucsc_token_map": { - "1067MHz": [], - "1200MHz": [], - "1333MHz": [], - "1467MHz": [], - "1600MHz": [], - "667MHz": [], - "800MHz": [], - "933MHz": [], - "Auto": [], + "1067MHz": [ + "1067MHz", + "1067mhz" + ], + "1200MHz": [ + "1200MHz", + "1200mhz" + ], + "1333MHz": [ + "1333MHz", + "1333mhz" + ], + "1467MHz": [ + "1467MHz", + "1467mhz" + ], + "1600MHz": [ + "1600MHz", + "1600mhz" + ], + "667MHz": [ + "667MHz", + "667mhz" + ], + "800MHz": [ + "800MHz", + "800mhz" + ], + "933MHz": [ + "933MHz", + "933mhz" + ], + "Auto": [ + "Auto", + "auto" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2279,23 +2358,69 @@ "cbs_cmn_mem_speed_ddr47xx3": { "type": "enum", "ucsc_token_map": { - "1067MHz": [], - "1200MHz": [], - "1333MHz": [], - "1467MHz": [], - "1600MHz": [], - "1633MHz": [], - "1667MHz": [], - "1700MHz": [], - "1733MHz": [], - "1767MHz": [], - "1800MHz": [], - "400MHz": [], - "800MHz": [], - "933MHz": [], - "Auto": [], + "1067MHz": [ + "1067MHz", + "1067mhz" + ], + "1200MHz": [ + "1200MHz", + "1200mhz" + ], + "1333MHz": [ + "1333MHz", + "1333mhz" + ], + "1467MHz": [ + "1467MHz", + "1467mhz" + ], + "1600MHz": [ + "1600MHz", + "1600mhz" + ], + "1633MHz": [ + "1633MHz", + "1633mhz" + ], + "1667MHz": [ + "1667MHz", + "1667mhz" + ], + "1700MHz": [ + "1700MHz", + "1700mhz" + ], + "1733MHz": [ + "1733MHz", + "1733mhz" + ], + "1767MHz": [ + "1767MHz", + "1767mhz" + ], + "1800MHz": [ + "1800MHz", + "1800mhz" + ], + "400MHz": [ + "400MHz", + "400mhz" + ], + "800MHz": [ + "800MHz", + "800mhz" + ], + "933MHz": [ + "933MHz", + "933mhz" + ], + "Auto": [ + "Auto", + "auto" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2387,10 +2512,17 @@ "cbs_cmn_preferred_io7xx2": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "Manual": [], + "Auto": [ + "Auto", + "auto" + ], + "Manual": [ + "Manual", + "manual" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2417,10 +2549,17 @@ "cbs_cmn_preferred_io7xx3": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "Bus": [], + "Auto": [ + "Auto", + "auto" + ], + "Bus": [ + "Bus", + "bus" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2484,12 +2623,22 @@ "cbs_cmnx_gmi_force_link_width_rs": { "type": "enum", "ucsc_token_map": { - "0": [], - "1": [], - "2": [], - "Auto": [], + "0": [ + "0" + ], + "1": [ + "1" + ], + "2": [ + "2" + ], + "Auto": [ + "Auto", + "auto" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2523,7 +2672,10 @@ "cbs_cpu_ccd_ctrl_ssp": { "type": "enum", "ucsc_token_map": { - "10 CCDs": [], + "10 CCDs": [ + "10-CCDs", + "10-ccds" + ], "2 CCDs": [ "2-CCDs", "2-ccds" @@ -2540,7 +2692,10 @@ "6-CCDs", "6-ccds" ], - "8 CCDs": [], + "8 CCDs": [ + "8-CCDs", + "8-ccds" + ], "Auto": [ "Auto", "auto" @@ -2678,13 +2833,13 @@ "values": [ "platform-default", "Auto", - "FIVE (5 + 0)", - "FOUR (4 + 0)", "ONE (1 + 0)", - "SEVEN (7 + 0)", - "SIX (6 + 0)", + "TWO (2 + 0)", "THREE (3 + 0)", - "TWO (2 + 0)" + "FOUR (4 + 0)", + "FIVE (5 + 0)", + "SIX (6 + 0)", + "SEVEN (7 + 0)" ] }, "cbs_cpu_down_core_ctrl_bergamo": { @@ -2692,19 +2847,22 @@ "values": [ "platform-default", "Auto", - "EIGHT (4 + 4)", + "TWO (1 + 1)", "FOUR (2 + 2)", - "FOURTEEN (7 + 7)", "SIX (3 + 3)", + "EIGHT (4 + 4)", "TEN (5 + 5)", "TWELVE (6 + 6)", - "TWO (1 + 1)" + "FOURTEEN (7 + 7)" ] }, "cbs_cpu_down_core_ctrl_genoa": { "type": "enum", "ucsc_token_map": { - "Auto": [], + "Auto": [ + "Auto", + "auto" + ], "FIVE (5 + 0)": [ "FIVE-(5-+-0)", "five-(5-+-0)" @@ -2734,7 +2892,8 @@ "two-(2-+-0)" ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2779,13 +2938,13 @@ "values": [ "platform-default", "Auto", - "FIVE (5 + 0)", - "FOUR (4 + 0)", "ONE (1 + 0)", - "SEVEN (7 + 0)", - "SIX (6 + 0)", + "TWO (2 + 0)", "THREE (3 + 0)", - "TWO (2 + 0)" + "FOUR (4 + 0)", + "FIVE (5 + 0)", + "SIX (6 + 0)", + "SEVEN (7 + 0)" ] }, "cbs_cpu_smt_ctrl": { @@ -2837,11 +2996,21 @@ "cbs_dbg_cpu_gen_cpu_wdt": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2873,12 +3042,25 @@ "cbs_dbg_cpu_lapic_mode": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "Compatibility": [], - "X2APIC": [], - "XAPIC": [], + "Auto": [ + "Auto", + "auto" + ], + "Compatibility": [ + "Compatibility", + "compatibility" + ], + "X2APIC": [ + "X2APIC", + "x2apic" + ], + "XAPIC": [ + "XAPIC", + "xapic" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -2912,25 +3094,6 @@ "XAPIC" ] }, - "cbs_dbg_cpu_lapic_mode7xx2": { - "type": "enum", - "values": [ - "platform-default", - "Auto", - "X2APIC", - "XAPIC" - ] - }, - "cbs_dbg_cpu_lapic_mode7xx3": { - "type": "enum", - "values": [ - "platform-default", - "Auto", - "Compatibility", - "X2APIC", - "XAPIC" - ] - }, "cbs_dbg_cpu_snp_mem_cover": { "type": "enum", "ucsc_token_map": { @@ -2994,12 +3157,25 @@ "cbs_df_cmn4link_max_xgmi_speed": { "type": "enum", "ucsc_token_map": { - "20Gbps": [], - "25Gbps": [], - "32Gbps": [], - "Auto": [], + "20Gbps": [ + "20Gbps", + "20gbps" + ], + "25Gbps": [ + "25Gbps", + "25gbps" + ], + "32Gbps": [ + "32Gbps", + "32gbps" + ], + "Auto": [ + "Auto", + "auto" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -3146,18 +3322,41 @@ "cbs_df_cmn_dram_scrub_time": { "type": "enum", "ucsc_token_map": { - "1 hour": [], - "12 hours": [], - "16 hours": [], - "24 hours": [], - "4 hours": [], - "48 hours": [], - "6 hours": [], - "8 hours": [], - "Auto": [], - "Disabled": [], + "1 hour": [ + "1-hour" + ], + "12 hours": [ + "12-hours" + ], + "16 hours": [ + "16-hours" + ], + "24 hours": [ + "24-hours" + ], + "4 hours": [ + "4-hours" + ], + "48 hours": [ + "48-hours" + ], + "6 hours": [ + "6-hours" + ], + "8 hours": [ + "8-hours" + ], + "Auto": [ + "Auto", + "auto" + ], + "Disabled": [ + "Disabled", + "disabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -3280,11 +3479,21 @@ "cbs_df_cmn_mem_intlv_control": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -3383,12 +3592,25 @@ "cbs_df_dbg_xgmi_link_cfg": { "type": "enum", "ucsc_token_map": { - "2 xGMI Links": [], - "3 xGMI Links": [], - "4 xGMI Links": [], - "Auto": [], + "2 xGMI Links": [ + "2-xGMI-Links", + "2-xgmi-links" + ], + "3 xGMI Links": [ + "3-xGMI-Links", + "3-xgmi-links" + ], + "4 xGMI Links": [ + "4-xGMI-Links", + "4-xgmi-links" + ], + "Auto": [ + "Auto", + "auto" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -3425,11 +3647,21 @@ "cbs_gnb_dbg_pcie_tbt_support": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -3461,7 +3693,10 @@ "cbs_sev_snp_support": { "type": "enum", "ucsc_token_map": { - "Auto": [], + "Auto": [ + "Auto", + "auto" + ], "disabled": [ "disabled", "Disabled" @@ -5021,11 +5256,21 @@ "dfx_osb_en": { "type": "enum", "ucsc_token_map": { - "Auto": [], - "disabled": [], - "enabled": [], + "Auto": [ + "Auto", + "auto" + ], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -5540,10 +5785,17 @@ "enable_tdx": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -5570,10 +5822,17 @@ "enable_tdx_seamldr": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -6613,10 +6872,17 @@ "ioat_config_cpm": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -7547,17 +7813,45 @@ "mmioh_base": { "type": "enum", "ucsc_token_map": { - "16T": [], - "1T": [], - "24T": [], - "2T": [], - "32T": [], - "40T": [], - "4T": [], - "512G": [], - "56T": [], + "16T": [ + "16T", + "16t" + ], + "1T": [ + "1T", + "1t" + ], + "24T": [ + "24T", + "24t" + ], + "2T": [ + "2T", + "2t" + ], + "32T": [ + "32T", + "32t" + ], + "40T": [ + "40T", + "40t" + ], + "4T": [ + "4T", + "4t" + ], + "512G": [ + "512G", + "512g" + ], + "56T": [ + "56T", + "56t" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -7619,14 +7913,33 @@ "mmioh_size": { "type": "enum", "ucsc_token_map": { - "1024G": [], - "16G": [], - "1G": [], - "256G": [], - "4G": [], - "64G": [], + "1024G": [ + "1024G", + "1024g" + ], + "16G": [ + "16G", + "16g" + ], + "1G": [ + "1G", + "1g" + ], + "256G": [ + "256G", + "256g" + ], + "4G": [ + "4G", + "4g" + ], + "64G": [ + "64G", + "64g" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -9641,7 +9954,10 @@ "128G", "128g" ], - "128M": [], + "128M": [ + "128M", + "128m" + ], "16G": [ "16G", "16g" @@ -9654,7 +9970,10 @@ "256G", "256g" ], - "256M": [], + "256M": [ + "256M", + "256m" + ], "2G": [ "2G", "2g" @@ -9671,7 +9990,10 @@ "512G", "512g" ], - "512M": [], + "512M": [ + "512M", + "512m" + ], "64G": [ "64G", "64g" @@ -9680,7 +10002,10 @@ "8G", "8g" ], - "Auto": [], + "Auto": [ + "Auto", + "auto" + ], "Invalid Config.": [ "Invalid-Config.", "invalid-config." @@ -10461,10 +10786,17 @@ "resize_bar_support": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -10491,10 +10823,17 @@ "runtime_post_package_repair": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -10695,10 +11034,17 @@ "serial_mux": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { @@ -11097,10 +11443,17 @@ "sha384pcr_bank": { "type": "enum", "ucsc_token_map": { - "disabled": [], - "enabled": [], + "disabled": [ + "disabled", + "Disabled" + ], + "enabled": [ + "enabled", + "Enabled" + ], "platform-default": [ - "Platform Default" + "Platform Default", + "platform-default" ] }, "ucsm_token_map": { diff --git a/config/intersight/config.py b/config/intersight/config.py index 28b0667..d9eb5a7 100644 --- a/config/intersight/config.py +++ b/config/intersight/config.py @@ -10,10 +10,10 @@ from intersight.api.access_api import AccessApi from intersight.api.adapter_api import AdapterApi from intersight.api.asset_api import AssetApi -from intersight.api.compute_api import ComputeApi from intersight.api.bios_api import BiosApi from intersight.api.boot_api import BootApi from intersight.api.certificatemanagement_api import CertificatemanagementApi +from intersight.api.compute_api import ComputeApi from intersight.api.chassis_api import ChassisApi from intersight.api.deviceconnector_api import DeviceconnectorApi from intersight.api.equipment_api import EquipmentApi diff --git a/config/intersight/fabric_policies.py b/config/intersight/fabric_policies.py index 8766bd2..b45668e 100644 --- a/config/intersight/fabric_policies.py +++ b/config/intersight/fabric_policies.py @@ -1067,7 +1067,7 @@ def push_object(self): # We start with SAN Unified Ports so that SAN Uplink Ports and SAN Port-Channels configuration work properly # We only do this for FI models that do not use FC Breakout - otherwise Unified Ports are configured as part # of Breakout config - if self.san_unified_ports and self.device_model not in ["UCS-FI-6536"]: + if self.san_unified_ports and self.device_model not in ["UCS-FI-6536", "UCSX-S9108-100G"]: # We now need to push the fabric.PortMode object for Unified Port configuration from intersight.model.fabric_port_mode import FabricPortMode @@ -2657,7 +2657,7 @@ def __init__(self, parent=None, fabric_fc_network_policy=None): # We use this to make sure all options of a VSAN are set to None if they are not present if self.vsans: for vsan in self.vsans: - for attribute in ["fcoe_vlan_id", "id", "name", "scope", "zoning"]: + for attribute in ["fcoe_vlan_id", "id", "name", "scope"]: if attribute not in vsan: vsan[attribute] = None @@ -2669,8 +2669,7 @@ def _get_vsans(self): if hasattr(fabric_vsan, "fc_network_policy"): if fabric_vsan.fc_network_policy.moid == self._moid: vsans.append({"name": fabric_vsan.name, "id": fabric_vsan.vsan_id, - "fcoe_vlan_id": fabric_vsan.fcoe_vlan, "scope": fabric_vsan.vsan_scope, - "zoning": fabric_vsan.default_zoning}) + "fcoe_vlan_id": fabric_vsan.fcoe_vlan, "scope": fabric_vsan.vsan_scope}) return vsans @@ -2722,8 +2721,6 @@ def push_object(self): kwargs["fcoe_vlan"] = vsan["fcoe_vlan_id"] if vsan["scope"] is not None: kwargs["vsan_scope"] = vsan["scope"] - if vsan["zoning"] is not None: - kwargs["default_zoning"] = vsan["zoning"] fabric_vsan = FabricVsan(**kwargs) diff --git a/config/intersight/object.py b/config/intersight/object.py index 8ed0fa1..2da5fd6 100644 --- a/config/intersight/object.py +++ b/config/intersight/object.py @@ -184,7 +184,11 @@ def commit(self, object_type="", payload="", detail="", show=True, return_relati self.logger(level="info", message=f"Updating existing object of type {object_type} with {message_str} using " f"the values from config.") - result = getattr(api_instance, "update_" + sdk_object_type)(existing_object_moid, payload) + if sdk_object_type == "iam_account": + # Handling "iam_account" with PATCH due to a backend issue preventing use of POST call + result = getattr(api_instance, "patch_" + sdk_object_type)(existing_object_moid, payload) + else: + result = getattr(api_instance, "update_" + sdk_object_type)(existing_object_moid, payload) self._config.push_summary_manager.add_object_status( obj=self, obj_detail=detail, obj_type=object_type, status="success") else: diff --git a/config/intersight/server_policies.py b/config/intersight/server_policies.py index 861f603..a03cb3a 100644 --- a/config/intersight/server_policies.py +++ b/config/intersight/server_policies.py @@ -5907,7 +5907,7 @@ def __init__(self, parent=None, storage_storage_policy=None): self.m2_configuration = { "enable": self._object.m2_virtual_drive.enable, "controller_slot": self._object.m2_virtual_drive.controller_slot, - "name": self._object.m2_virtual_drive.name + "name": self._object.m2_virtual_drive.name if self._object.m2_virtual_drive.name else None } if hasattr(self._object, "drive_group"): diff --git a/config/intersight/settings.py b/config/intersight/settings.py index e746450..1fda51e 100644 --- a/config/intersight/settings.py +++ b/config/intersight/settings.py @@ -102,14 +102,18 @@ def __init__(self, parent=None, iam_account=None): self.per_user_limit = None if self._config.load_from == "live": + if self._device.is_appliance: + # Account Name is not definable in Appliance (always "admin"), so we ignore it + self.account_name = None self.audit_log_retention_period = self._get_audit_log_retention_period() self._get_iam_resource_limits_info() self._get_iam_session_limits_info() elif self._config.load_from == "file": for attribute in ["api_keys_maximum_expiration_time", "api_keys_without_expiry", - "audit_log_retention_period", "oauth_applications_maximum_expiration_time", - "oauth_applications_without_expiry"]: + "audit_log_retention_period", "default_idle_timeout", "default_session_timeout", + "oauth_applications_maximum_expiration_time", "oauth_applications_without_expiry", + "per_user_limit"]: setattr(self, attribute, None) if attribute in self._object: setattr(self, attribute, self.get_attribute(attribute_name=attribute)) @@ -171,37 +175,35 @@ def _get_iam_session_limits_info(self): def push_object(self): self.logger(message=f"Pushing {self._CONFIG_NAME} configuration") - # # We first need to fetch the existing iam.Account object - # iam_account_list = self._device.query(object_type=self._INTERSIGHT_SDK_OBJECT_NAME) - # from intersight.api.iam_api import IamApi - # - # if len(iam_account_list) != 1: - # self.logger(level="error", message="Could not push " + self._CONFIG_NAME + " (Account). " + - # "Could not find existing iam.Account object") - # return False - # - # iam_account = iam_account_list[0] - # something_to_commit = False - # if self.account_name: - # iam_account.name = self.account_name - # something_to_commit = True - # if self.tags: - # iam_account.tags = self.create_tags() - # something_to_commit = True - # - # if something_to_commit: - # if self.account_name: - # detail = self.account_name + " - Account" - # else: - # detail = "Account" - # if not self.commit(object_type=self._INTERSIGHT_SDK_OBJECT_NAME, payload=iam_account, - # key_attributes=["moid"], detail=detail, modify_present=True): - # return False + # We first need to fetch the existing iam.Account object + iam_account_list = self._device.query(object_type=self._INTERSIGHT_SDK_OBJECT_NAME) + if len(iam_account_list) != 1: + self.logger(level="error", message="Could not push " + self._CONFIG_NAME + " (Account). " + + "Could not find existing iam.Account object") + return False + + iam_account = iam_account_list[0] + something_to_commit = False if self.account_name: - self.logger(level="warning", message="Setting account name is not yet supported") + if not self._device.is_appliance: + iam_account.name = self.account_name + something_to_commit = True + else: + self.logger(level="info", + message="Ignoring Account Name as it is not definable in Intersight Appliance") if self.tags: - self.logger(level="warning", message="Setting account tags is not yet supported") + iam_account.tags = self.create_tags() + something_to_commit = True + + if something_to_commit: + if self.account_name: + detail = self.account_name + " - Account" + else: + detail = "Account" + if not self.commit(object_type=self._INTERSIGHT_SDK_OBJECT_NAME, payload=iam_account, + key_attributes=["moid"], detail=detail, modify_present=True): + return False # We then need to fetch the existing iam.SessionLimits object iam_session_limits_list = self._device.query(object_type="iam.SessionLimits") @@ -235,12 +237,18 @@ def push_object(self): # We then need to fetch the existing aaa.RetentionPolicy object aaa_retention_policy_list = self._device.query(object_type="aaa.RetentionPolicy") - if len(aaa_retention_policy_list) != 1: + aaa_retention_policy = None + if len(aaa_retention_policy_list) > 1: self.logger(level="error", message="Could not push " + self._CONFIG_NAME + " (Audit Log Retention). " + - "Could not find existing aaa.RetentionPolicy object") + "Could not find unique existing aaa.RetentionPolicy object") return False + elif len(aaa_retention_policy_list) == 1: + aaa_retention_policy = aaa_retention_policy_list[0] + elif len(aaa_retention_policy_list) == 0: + self.logger(level="debug", message="No existing Log Retention Policy. Creating a new one.") + from intersight.model.aaa_retention_policy import AaaRetentionPolicy + aaa_retention_policy = AaaRetentionPolicy(name="AuditLogPolicy") - aaa_retention_policy = aaa_retention_policy_list[0] something_to_commit = False if self.audit_log_retention_period: aaa_retention_policy.retention_period = self.audit_log_retention_period @@ -968,7 +976,36 @@ def _get_member_devices(self): else: device_name = asset_device_registration_list[0].device_hostname[0] device_list.append({"moid": device_moid, "name": device_name}) - return device_list + + elif selector_object_type == "compute.Blade": + # We use a regex to get the serial number of the individual servers + regex_device_moid = r"([A-Z0-9]{11})" + res_devices = re.findall(regex_device_moid, combined_selector) + + for serial_number in res_devices: + if "compute_blade" in self._config.sdk_objects: + for compute_blade in self._config.sdk_objects["compute_blade"]: + if serial_number == compute_blade.serial: + device_name = compute_blade.name + device_list.append({"serial_number": compute_blade.serial, + "name": device_name, "type": "Blade"}) + break + + elif selector_object_type == "compute.RackUnit": + # We use a regex to get the serial number of the individual servers + regex_device_moid = r"([A-Z0-9]{11})" + res_devices = re.findall(regex_device_moid, combined_selector) + + for serial_number in res_devices: + if "compute_rack_unit" in self._config.sdk_objects: + for compute_rack_unit in self._config.sdk_objects["compute_rack_unit"]: + if serial_number == compute_rack_unit.serial: + device_name = compute_rack_unit.name + device_list.append({"serial_number": compute_rack_unit.serial, + "name": device_name, + "type": "Rack"}) + break + return device_list return None @@ -980,9 +1017,17 @@ def push_object(self): # Determining if we have a custom membership with a list of devices moid_list = [] + blade_server_list = [] + rack_server_list = [] + resource_selector_list = [] if self.memberships == "custom" and self.devices: for device in self.devices: - if "moid" in device: + if "serial_number" in device: + if device.get("type") == "Blade": + blade_server_list.append(device["serial_number"]) + elif device.get("type") == "Rack": + rack_server_list.append(device["serial_number"]) + elif "moid" in device: moid_list.append(device["moid"]) elif "name" in device: # We need to retrieve the device MOID for setting membership @@ -1004,20 +1049,41 @@ def push_object(self): else: self.logger(level="warning", message="Could not find device '" + device["name"] + "' to assign membership to Resource Group " + self.name) + + else: + self.logger(level="error", message="Could not find any device" + + " to assign membership to Resource Group " + self.name) from intersight.model.resource_selector import ResourceSelector - selector = "/api/v1/asset/DeviceRegistrations" - if self.memberships == "custom" and moid_list: - selector += "?$filter=Moid in ('" - selector += "','".join(moid_list) - selector += "')" + def create_resource_selector_object(endpoint, items, key='Serial', management_mode=None): + # Creates a resource selector object based on the entire domain or individual servers + # that are part of a resource group + selector = f"{endpoint}?$filter={key} in ('" + "','".join(items) + "')" + if management_mode: + selector += f" and ManagementMode eq '{management_mode}'" + return ResourceSelector( + object_type="resource.Selector", + class_id="resource.Selector", + selector=selector + ) - resource_selector = ResourceSelector( - object_type="resource.Selector", - class_id="resource.Selector", - selector=selector - ) + if moid_list or blade_server_list or rack_server_list: + if self.memberships == "custom": + info_message = f"The target must be claimed first to include the entire domain or individual servers" + \ + f" in the resource group '{self.name}'; otherwise, an empty resource group is created with 'custom' membership." + self.logger(level="info", message=info_message) + if moid_list: + resource_selector_list.append(create_resource_selector_object("/api/v1/asset/DeviceRegistrations", + moid_list, key='Moid')) + + if blade_server_list: + resource_selector_list.append(create_resource_selector_object("/api/v1/compute/Blades", + blade_server_list, management_mode='Intersight')) + + if rack_server_list: + resource_selector_list.append(create_resource_selector_object("/api/v1/compute/RackUnits", + rack_server_list, management_mode='Intersight')) kwargs = { "object_type": "resource.Group", @@ -1029,8 +1095,8 @@ def push_object(self): kwargs["qualifier"] = "Allow-All" else: kwargs["qualifier"] = "Allow-Selectors" - if moid_list: - kwargs["selectors"] = [resource_selector] + if moid_list or blade_server_list or rack_server_list: + kwargs["selectors"] = resource_selector_list else: # EASYUCS-893: If there is no device Moid found for the selector, we push an empty list instead kwargs["selectors"] = [] diff --git a/config/plot.py b/config/plot.py index eb79e58..4f86e79 100644 --- a/config/plot.py +++ b/config/plot.py @@ -78,13 +78,13 @@ def hierarchy_pos(self, G, root=None, width=1., vert_gap=0.2, vert_loc=0, xcente root = random.choice(list(G.nodes)) def _hierarchy_pos(G, root, width=1., vert_gap=0.2, vert_loc=0, xcenter=0.5, pos=None, parent=None): - ''' + """ see hierarchy_pos docstring for most arguments pos: a dict saying where all nodes go if they have been assigned parent: parent of this branch. - only affects it if non-directed - ''' + """ if pos is None: pos = {root: (xcenter, vert_loc)} @@ -211,7 +211,7 @@ def parse_org(org, service_profile_list, global_templates): # pos = self.hierarchy_pos(G, root=self.node_service_profile) # Setting options for each edge and node (a node is characterized only by a name (label)) - for node in ["node_" + i for i in sp_options_dict]: # the list includes all of the policies supported + for node in ["node_" + i for i in sp_options_dict]: # the list includes all the policies supported node_label_name = getattr(self, node) if getattr(self, node) is None: continue @@ -248,7 +248,7 @@ def parse_org(org, service_profile_list, global_templates): labels_dict[node_label_name] = (node_label_name.split("\n")[1], node_options) else: # Create a dict of label key associate with an alias to remove - # To fit into the square of the SP, it need to be split each 9 character + # To fit into the square of the SP, it needs to be split each 9 character n = 9 line = node_label_name.split("\n")[1] line = "\n".join([line[i:i + n] for i in range(0, len(line), n)]) diff --git a/config/ucs/config.py b/config/ucs/config.py index b811c88..c576363 100644 --- a/config/ucs/config.py +++ b/config/ucs/config.py @@ -1017,7 +1017,7 @@ def _fetch_sdk_objects(self, force=False): if not self.device.task.taskstep_manager.is_taskstep_optional(name="FetchConfigUcsSystemSdkObjects"): return False - # We sort all sdk objects by their DN in human readable format + # We sort all sdk objects by their DN in human-readable format for key, value in self.sdk_objects.items(): value.sort(key=lambda obj: [int(t) if t.isdigit() else t.lower() for t in re.split('(\d+)', obj.dn)]) diff --git a/config/ucs/manager.py b/config/ucs/manager.py index 5d4132b..2624592 100644 --- a/config/ucs/manager.py +++ b/config/ucs/manager.py @@ -455,7 +455,18 @@ def fetch_config(self, force=False): if "fabricBreakout" in config.sdk_objects: for fabric_breakout in config.sdk_objects["fabricBreakout"]: - config.breakout_ports.append(UcsSystemBreakoutPort(parent=config, fabric_breakout=fabric_breakout)) + # We need to skip config of internal backplane breakout ports of X-Direct FI, which are automatically + # present if server has a 25G VIC adapter. + fabric = fabric_breakout.dn.split("/")[2] + if ((config.device.fi_a_model == "UCSX-S9108-100G" and fabric == "A" and + int(fabric_breakout.port_id) > 8) or + (config.device.fi_b_model == "UCSX-S9108-100G") and fabric =="B" and + int(fabric_breakout.port_id) > 8): + self.logger(level="debug", + message="Ignoring internal backplane breakout port " + str(fabric) + "/" + + fabric_breakout.slot_id + "/" + fabric_breakout.port_id) + else: + config.breakout_ports.append(UcsSystemBreakoutPort(parent=config, fabric_breakout=fabric_breakout)) # EASYUCS-1076: It can happen that UCSM shows a port being both configured as Breakout and Server port. # We remove the server port config in this case @@ -821,7 +832,7 @@ def push_config(self, uuid=None, reset=False, fi_ip_list=[], bypass_version_chec else: if self.parent.task is not None: self.parent.task.taskstep_manager.skip_taskstep( - name="ClearIntersightClaimStatus", status_message="Skipping device reset") + name="ResetDeviceConnector", status_message="Skipping device reset") self.parent.task.taskstep_manager.skip_taskstep( name="DecommissionAllRackServers", status_message="Skipping device reset") self.parent.task.taskstep_manager.skip_taskstep( @@ -1747,9 +1758,9 @@ def push_config(self, uuid=None, reset=False, imc_ip=None, bypass_version_checks is_pushed = config.local_users_properties[0].push_object() and is_pushed for local_user in config.local_users: is_pushed = local_user.push_object() and is_pushed - if "clear_intersight_claim_status" in config.options.keys(): - if config.options["clear_intersight_claim_status"] == "yes": - self.parent.clear_intersight_claim_status() + if "reset_device_connector" in config.options.keys(): + if config.options["reset_device_connector"] == "yes": + self.parent.reset_device_connector() self.parent.connect() if config.device_connector: is_pushed = config.device_connector[0].push_object() and is_pushed diff --git a/config/ucs/ucsc/bios_table.json b/config/ucs/ucsc/bios_table.json index 491f635..741d69a 100644 --- a/config/ucs/ucsc/bios_table.json +++ b/config/ucs/ucsc/bios_table.json @@ -1,4 +1,29 @@ { + "4_link_xgmi_max_speed": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "20gbps", + "25gbps", + "32gbps", + "auto", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "4-link xGMI max speed", + "step": null, + "target_name": "CbsDfCmn4LinkMaxXgmiSpeed", + "type": "enum", + "unit": null, + "values": [ + "20Gbps", + "25Gbps", + "32Gbps", + "Auto", + "Platform Default" + ] + }, "acpi10_support": { "available_in_legacy_mode": true, "feature_group": "ACPI10 Support", @@ -494,13 +519,13 @@ "auto", "platform-default" ], - "maximum": null, - "minimum": null, + "maximum": "2", + "minimum": "0", "param_name": "APBDIS", - "step": null, + "step": "1", "target_name": "CbsCmnApbdis", "type": "enum", - "unit": null, + "unit": "P State", "values": [ "0", "1", @@ -594,6 +619,29 @@ "Platform Default" ] }, + "avx512": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "AVX512", + "step": null, + "target_name": "CbsCmnCpuAvx512", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "bank_group_swap": { "available_in_legacy_mode": false, "feature_group": "Processor", @@ -757,6 +805,7 @@ "available_in_legacy_mode": false, "feature_group": "C1 Auto Demotion", "legacy_values": [ + "auto", "disabled", "enabled", "platform-default" @@ -769,6 +818,7 @@ "type": "enum", "unit": null, "values": [ + "Auto", "Disabled", "Enabled", "Platform Default" @@ -778,6 +828,7 @@ "available_in_legacy_mode": false, "feature_group": "C1 Auto UnDemotion", "legacy_values": [ + "auto", "disabled", "enabled", "platform-default" @@ -790,6 +841,53 @@ "type": "enum", "unit": null, "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, + "cbs_df_cmn_mem_intlv_control": { + "available_in_legacy_mode": false, + "feature_group": "Memory Interleaving", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Memory Interleaving", + "step": null, + "target_name": "CbsDfCmnMemIntlvControl", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, + "cbs_df_cmn_mem_intlv_sp5": { + "available_in_legacy_mode": false, + "feature_group": "Memory Interleaving", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Memory Interleaving", + "step": null, + "target_name": "CbsDfCmnMemIntlvSP5", + "type": "enum", + "unit": null, + "values": [ + "Auto", "Disabled", "Enabled", "Platform Default" @@ -799,10 +897,12 @@ "available_in_legacy_mode": false, "feature_group": "Processor", "legacy_values": [ + "10-ccds", "2-ccds", "3-ccds", "4-ccds", "6-ccds", + "8-ccds", "auto", "platform-default" ], @@ -814,10 +914,12 @@ "type": "enum", "unit": null, "values": [ + "10-CCDs", "2-CCDs", "3-CCDs", "4-CCDs", "6-CCDs", + "8-CCDs", "Auto", "Platform Default" ] @@ -1197,6 +1299,29 @@ "Platform Default" ] }, + "core_watchdog_timer_enable": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Core Watchdog Timer Enable", + "step": null, + "target_name": "CbsDbgCpuGenCpuWdt", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "cppc": { "available_in_legacy_mode": false, "feature_group": "Processor", @@ -1253,6 +1378,39 @@ "Platform Default" ] }, + "cpu_downcore_control_f19_m10h_1fh": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "five-(5-+-0)", + "four-(4-+-0)", + "one-(1-+-0)", + "seven-(7-+-0)", + "six-(6-+-0)", + "three-(3-+-0)", + "two-(2-+-0)", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "CPU Downcore control F19 M10h-1Fh", + "step": null, + "target_name": "CbsCpuDownCoreCtrlGenoa", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "FIVE-(5-+-0)", + "FOUR-(4-+-0)", + "ONE-(1-+-0)", + "SEVEN-(7-+-0)", + "SIX-(6-+-0)", + "THREE-(3-+-0)", + "TWO-(2-+-0)", + "Platform Default" + ] + }, "cpu_hardware_power_management": { "available_in_legacy_mode": true, "feature_group": "CPU Hardware Power Management", @@ -1566,6 +1724,29 @@ "Platform Default" ] }, + "dfx_osb_configuration": { + "available_in_legacy_mode": false, + "feature_group": "DFX OSB Configuration", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "DFX OSB Configuration", + "step": null, + "target_name": "DfxOsbEn", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "direct_cache_access": { "available_in_legacy_mode": true, "feature_group": "Direct Cache Access", @@ -1589,6 +1770,29 @@ "Platform Default" ] }, + "dlwm_support": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "DLWM Support", + "step": null, + "target_name": "CbsCmnGnbSMUDlwmSupport", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "dma_control_opt_in_flag": { "available_in_legacy_mode": false, "feature_group": "Trusted Platform Module", @@ -1693,6 +1897,43 @@ "Platform Default" ] }, + "dram_scrub_time": { + "available_in_legacy_mode": false, + "feature_group": "DRAM Scrub Time", + "legacy_values": [ + "1-hour", + "12-hours", + "16-hours", + "24-hours", + "4-hours", + "48-hours", + "6-hours", + "8-hours", + "auto", + "disabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "DRAM Scrub Time", + "step": null, + "target_name": "CbsDfCmnDramScrubTime", + "type": "enum", + "unit": null, + "values": [ + "1-hour", + "12-hours", + "16-hours", + "24-hours", + "4-hours", + "48-hours", + "6-hours", + "8-hours", + "Auto", + "Disabled", + "Platform Default" + ] + }, "dram_sw_thermal_throttling": { "available_in_legacy_mode": false, "feature_group": "Processor", @@ -1737,6 +1978,29 @@ "Platform Default" ] }, + "edc_control_throttle": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "EDC Control Throttle", + "step": null, + "target_name": "CbsCmnEdcControlThrottle", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "efficiency_mode_enable": { "available_in_legacy_mode": false, "feature_group": "Processor", @@ -2009,6 +2273,25 @@ "Platform Default" ] }, + "fixed_soc_pstate_sp5_f19h": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "integer", + "platform-default" + ], + "maximum": "2", + "minimum": "0", + "param_name": "Fixed SOC Pstate SP5 F19h", + "step": "1", + "target_name": "CbsCmnApbdisDfPstateRs", + "type": "integer", + "unit": "P State", + "values": [ + "Integer", + "Platform Default" + ] + }, "flow_control": { "available_in_legacy_mode": true, "feature_group": "Console redirection", @@ -3680,6 +3963,27 @@ "Platform Default" ] }, + "ioat_configuration": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "IOAT Configuration", + "step": null, + "target_name": "IOATConfigCpm", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "ioemezz1_linkspeed": { "available_in_legacy_mode": false, "feature_group": "PCI Slot Link Speed", @@ -4206,6 +4510,31 @@ "Platform Default" ] }, + "local_apic_mode": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "compatibility", + "x2apic", + "xapic", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Local APIC Mode", + "step": null, + "target_name": "CbsDbgCpuLApicMode", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Compatibility", + "X2APIC", + "XAPIC", + "Platform Default" + ] + }, "local_x2_apic": { "available_in_legacy_mode": true, "feature_group": "Local X2 Apic", @@ -4382,6 +4711,88 @@ "Platform Default" ] }, + "memory_clock_speed_7xx2": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "1067mhz", + "1200mhz", + "1333mhz", + "1467mhz", + "1600mhz", + "667mhz", + "800mhz", + "933mhz", + "auto", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Memory Clock Speed 7xx2", + "step": null, + "target_name": "CbsCmnMemSpeedDdr47xx2", + "type": "enum", + "unit": null, + "values": [ + "1067MHz", + "1200MHz", + "1333MHz", + "1467MHz", + "1600MHz", + "667MHz", + "800MHz", + "933MHz", + "Auto", + "Platform Default" + ] + }, + "memory_clock_speed_7xx3": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "1067mhz", + "1200mhz", + "1333mhz", + "1467mhz", + "1600mhz", + "1633mhz", + "1667mhz", + "1700mhz", + "1733mhz", + "1767mhz", + "1800mhz", + "400mhz", + "800mhz", + "933mhz", + "auto", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Memory Clock Speed 7xx3", + "step": null, + "target_name": "CbsCmnMemSpeedDdr47xx3", + "type": "enum", + "unit": null, + "values": [ + "1067MHz", + "1200MHz", + "1333MHz", + "1467MHz", + "1600MHz", + "1633MHz", + "1667MHz", + "1700MHz", + "1733MHz", + "1767MHz", + "1800MHz", + "400MHz", + "800MHz", + "933MHz", + "Auto", + "Platform Default" + ] + }, "memory_interleaving": { "available_in_legacy_mode": true, "feature_group": "Interleave Configuration", @@ -4572,6 +4983,70 @@ "Platform Default" ] }, + "mmio_high_base": { + "available_in_legacy_mode": false, + "feature_group": "MMIO High Base", + "legacy_values": [ + "16t", + "1t", + "24t", + "2t", + "32t", + "40t", + "4t", + "512g", + "56t", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "MMIO High Base", + "step": null, + "target_name": "MmiohBase", + "type": "enum", + "unit": null, + "values": [ + "16T", + "1T", + "24T", + "2T", + "32T", + "40T", + "4T", + "512G", + "56T", + "Platform Default" + ] + }, + "mmio_high_granularity_size": { + "available_in_legacy_mode": false, + "feature_group": "MMIO High Granularity Size", + "legacy_values": [ + "1024g", + "16g", + "1g", + "256g", + "4g", + "64g", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "MMIO High Granularity Size", + "step": null, + "target_name": "MmiohSize", + "type": "enum", + "unit": null, + "values": [ + "1024G", + "16G", + "1G", + "256G", + "4G", + "64G", + "Platform Default" + ] + }, "mraid_link_speed": { "available_in_legacy_mode": false, "feature_group": "PCI Slot LINK Speed", @@ -7230,6 +7705,29 @@ "Platform Default" ] }, + "pcie_ten_bit_tag_support": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "PCIe Ten Bit Tag Support", + "step": null, + "target_name": "CbsGnbDbgPcieTbtSupport", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "pciromclp": { "available_in_legacy_mode": true, "feature_group": "PCI ROM CLP", @@ -7314,6 +7812,29 @@ "Platform Default" ] }, + "power_down_enable": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Power Down Enable", + "step": null, + "target_name": "CbsCmnMemCtrllerPwrDnEnDdr", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default" + ] + }, "power_on_password": { "available_in_legacy_mode": false, "feature_group": "PCI Slot LINK Speed", @@ -7335,6 +7856,31 @@ "Platform Default" ] }, + "power_profile_selection_f19h": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "balanced-memory-performance-mode", + "efficiency-mode", + "high-performance-mode", + "maximum-io-performance-mode", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Power Profile Selection F19h", + "step": null, + "target_name": "CbsCmnEfficiencyModeEnRs", + "type": "enum", + "unit": null, + "values": [ + "Balanced-Memory-Performance-Mode", + "Efficiency-Mode", + "High-Performance-Mode", + "Maximum-IO-Performance-Mode", + "Platform Default" + ] + }, "power_technology": { "available_in_legacy_mode": true, "feature_group": "Processor Energy Configuration", @@ -7360,20 +7906,66 @@ "Platform Default" ] }, + "preferred_io_7xx2": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "manual", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Preferred IO 7xx2", + "step": null, + "target_name": "CbsCmnPreferredIO7xx2", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Manual", + "Platform Default" + ] + }, + "preferred_io_7xx3": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "auto", + "bus", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Preferred IO 7xx3", + "step": null, + "target_name": "CbsCmnPreferredIO7xx3", + "type": "enum", + "unit": null, + "values": [ + "Auto", + "Bus", + "Platform Default" + ] + }, "prmrr_size": { "available_in_legacy_mode": false, "feature_group": "PRMRR Size Configuration", "legacy_values": [ "128g", + "128m", "16g", "1g", "256g", + "256m", "2g", "32g", "4g", "512g", + "512m", "64g", "8g", + "auto", "invalid-config.", "platform-default" ], @@ -7386,15 +7978,19 @@ "unit": null, "values": [ "128G", + "128M", "16G", "1G", "256G", + "256M", "2G", "32G", "4G", "512G", + "512M", "64G", "8G", + "Auto", "Invalid-Config.", "Platform Default" ] @@ -7816,6 +8412,27 @@ "Platform Default" ] }, + "re_size_bar_support": { + "available_in_legacy_mode": false, + "feature_group": "Resizable Bar Support", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Re-Size BAR Support", + "step": null, + "target_name": "ResizeBarSupport", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "rear_nvme1_link_speed": { "available_in_legacy_mode": false, "feature_group": "PCI Slot LINK Speed", @@ -7984,6 +8601,27 @@ "Platform Default" ] }, + "runtime_post_package_repair": { + "available_in_legacy_mode": false, + "feature_group": "PostPackageRepair", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Runtime Post Package Repair", + "step": null, + "target_name": "RuntimePostPackageRepair", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "sas_raid": { "available_in_legacy_mode": true, "feature_group": "Intel entry SAS RAID module", @@ -8326,6 +8964,27 @@ "Platform Default" ] }, + "serial_mux": { + "available_in_legacy_mode": false, + "feature_group": "Serial Mux", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Serial Mux", + "step": null, + "target_name": "SerialMux", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "serial_port_a_enable": { "available_in_legacy_mode": true, "feature_group": "Serial port A enable", @@ -8370,10 +9029,30 @@ "Platform Default" ] }, + "sev_es_asid_space_limit": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "integer", + "platform-default" + ], + "maximum": "1007", + "minimum": "1", + "param_name": "SEV-ES ASID Space Limit", + "step": "1", + "target_name": "CbsCmnCpuSevAsidSpaceLimit", + "type": "integer", + "unit": "ASIDs", + "values": [ + "Integer", + "Platform Default" + ] + }, "sev_snp_support": { "available_in_legacy_mode": false, "feature_group": "Processor", "legacy_values": [ + "auto", "disabled", "enabled", "platform-default" @@ -8386,6 +9065,7 @@ "type": "enum", "unit": null, "values": [ + "Auto", "Disabled", "Enabled", "Platform Default" @@ -8614,6 +9294,27 @@ "Platform Default" ] }, + "sha_384_pcr_bank": { + "available_in_legacy_mode": false, + "feature_group": "Trusted Platform Module", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "SHA 384 PCR Bank", + "step": null, + "target_name": "SHA384PCRBank", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "sioc1_linkspeed": { "available_in_legacy_mode": false, "feature_group": "PCI Slot Link Speed", @@ -9430,6 +10131,27 @@ "Platform Default" ] }, + "tdx_secure_arbitration_mode": { + "available_in_legacy_mode": false, + "feature_group": "Trust Domain Extension", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "TDX Secure Arbitration Mode (SEAM) Loader", + "step": null, + "target_name": "EnableTdxSeamldr", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "terminal_type": { "available_in_legacy_mode": true, "feature_group": "Console redirection", @@ -9497,6 +10219,27 @@ "Platform Default" ] }, + "trust_domain_extension": { + "available_in_legacy_mode": false, + "feature_group": "Trust Domain Extension", + "legacy_values": [ + "disabled", + "enabled", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "Trust Domain Extension (TDX)", + "step": null, + "target_name": "EnableTdx", + "type": "enum", + "unit": null, + "values": [ + "Disabled", + "Enabled", + "Platform Default" + ] + }, "trusted_execution_technology": { "available_in_legacy_mode": true, "feature_group": "Intel Trusted Execution Technology", @@ -9589,6 +10332,7 @@ "legacy_values": [ "disable(all2all)", "hemisphere(2-clusters)", + "quadrant(4-clusters)", "platform-default" ], "maximum": null, @@ -9601,6 +10345,7 @@ "values": [ "Disable(All2All)", "Hemisphere(2-clusters)", + "Quadrant(4-clusters)", "Platform Default" ] }, @@ -9659,6 +10404,7 @@ "12.8gt-s", "14.4gt-s", "16.0gt-s", + "20.0gt-s", "9.6gt-s", "auto", "use-per-link-setting", @@ -9677,6 +10423,7 @@ "12.8GT-s", "14.4GT-s", "16.0GT-s", + "20.0GT-s", "9.6GT-s", "Auto", "Use-Per-Link-Setting", @@ -10044,6 +10791,56 @@ "Platform Default" ] }, + "xgmi_force_link_width": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "0", + "1", + "2", + "auto", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "xGMI Force Link Width", + "step": null, + "target_name": "CbsCmnxGmiForceLinkWidthRs", + "type": "enum", + "unit": null, + "values": [ + "0", + "1", + "2", + "Auto", + "Platform Default" + ] + }, + "xgmi_link_configuration": { + "available_in_legacy_mode": false, + "feature_group": "Processor", + "legacy_values": [ + "2-xgmi-links", + "3-xgmi-links", + "4-xgmi-links", + "auto", + "platform-default" + ], + "maximum": null, + "minimum": null, + "param_name": "xGMI Link Configuration", + "step": null, + "target_name": "CbsDfDbgXgmiLinkCfg", + "type": "enum", + "unit": null, + "values": [ + "2-xGMI-Links", + "3-xGMI-Links", + "4-xGMI-Links", + "Auto", + "Platform Default" + ] + }, "xhci_mode": { "available_in_legacy_mode": true, "feature_group": "USB Configuration", diff --git a/config/ucs/ucsm/ports.py b/config/ucs/ucsm/ports.py index a4c61ef..9ef27fa 100644 --- a/config/ucs/ucsm/ports.py +++ b/config/ucs/ucsm/ports.py @@ -1477,6 +1477,16 @@ def push_object(self, commit=True): self.logger("error", "Incorrect values for port_id start or end in fabric " + self.fabric) return False + elif self._device.fi_a_model == "UCSX-S9108-100G": + self.logger("debug", "Trying to set Unified Ports on FI model " + self._device.fi_a_model) + if self.slot_id != "1": + self.logger("error", "Incorrect values for slot_id in fabric " + self.fabric) + return False + if self.port_id_end not in ["1", "2"] or self.port_id_start != "1"\ + or int(self.port_id_start) > int(self.port_id_end): + self.logger("error", "Incorrect values for port_id start or end in fabric " + self.fabric) + return False + else: self.logger("error", "Trying to set Unified Ports on unsupported FI model: " + self._device.fi_a_model) return False diff --git a/config/ucs/ucsm/profiles.py b/config/ucs/ucsm/profiles.py index 5beb5ae..3e101ee 100644 --- a/config/ucs/ucsm/profiles.py +++ b/config/ucs/ucsm/profiles.py @@ -492,12 +492,12 @@ def __init__(self, parent=None, json_content=None, ls_server=None): if self._parent._dn: if self._parent._dn + "/ls-" + self.name + "/" in ls_binding.dn: server = {} - if "chassis" in ls_binding.dn and "blade" in ls_binding.dn: - server.update({"chassis_id": ls_binding.dn.split("/")[1].split("-")[1]}) - server.update({"blade": ls_binding.dn.split("/")[2].split("-")[1]}) + if "chassis" in ls_binding.pn_dn and "blade" in ls_binding.pn_dn: + server.update({"chassis_id": ls_binding.pn_dn.split("/")[1].split("-")[1]}) + server.update({"blade": ls_binding.pn_dn.split("/")[2].split("-")[1]}) self.servers.append(server) - elif "rack_id" in ls_binding.dn: - server.update({"rack_id": ls_binding.dn.split("/")[1].split("-")[2]}) + elif "rack-unit" in ls_binding.pn_dn: + server.update({"rack_id": ls_binding.pn_dn.split("/")[1].split("-")[2]}) self.servers.append(server) if "lsPower" in self._parent._config.sdk_objects: diff --git a/config/ucs/ucsm/servers.py b/config/ucs/ucsm/servers.py index c6a5abc..eecdb0e 100644 --- a/config/ucs/ucsm/servers.py +++ b/config/ucs/ucsm/servers.py @@ -3316,7 +3316,11 @@ def __init__(self, parent=None, json_content=None, cimcvmedia_mount_config_polic if self._config.load_from == "live": if cimcvmedia_mount_config_policy is not None: - self.name = cimcvmedia_mount_config_policy.name + # EASYUCS-1423: If this is a Specific vMedia Policy, its name will be "remote-image-mapping-policy". + # We don't fetch the Specific vMedia Policy name, as it's an internal name which is not compliant + # with the naming pattern for vMedia Policies. + if cimcvmedia_mount_config_policy.name != "remote-image-mapping-policy": + self.name = cimcvmedia_mount_config_policy.name self.descr = cimcvmedia_mount_config_policy.descr self.retry_on_mount_fail = cimcvmedia_mount_config_policy.retry_on_mount_fail diff --git a/device/delete_summary_manager.py b/device/delete_summary_manager.py index 47c0e18..9fda341 100644 --- a/device/delete_summary_manager.py +++ b/device/delete_summary_manager.py @@ -84,6 +84,8 @@ def add_obj_status(self, obj, status="success", message=None): "status": status, "object_type": "organization.Organization", } + if message: # message field to be added in case organization deletion fails. + org_info["message"] = message self.delete_summary["deleted_objects"].setdefault("organization.Organization", []).append(org_info) org_info.setdefault(object_type, []).append(deletion_info) else: @@ -99,6 +101,8 @@ def add_obj_status(self, obj, status="success", message=None): else: # Update the existing organization info status org_info["status"] = status + if message: + org_info["message"] = message return True def export_delete_summary_dict(self): diff --git a/device/device_connector.py b/device/device_connector.py index 7cc9fd9..408cf3b 100644 --- a/device/device_connector.py +++ b/device/device_connector.py @@ -192,7 +192,7 @@ def claim_to_intersight(self, intersight_device, access_mode=None, proxy_details f" is already claimed to account {self.metadata.device_connector_ownership_name}.") return False - # Checking and clearing Intersight claim status if necessary + # Checking and resetting Device Connector if necessary if not intersight_device.is_appliance: # Determine the expected Cloud DNS value based on the target if "qa.starshipcloud.com" in intersight_device.target: @@ -211,8 +211,8 @@ def claim_to_intersight(self, intersight_device, access_mode=None, proxy_details current_cloud_dns = self._device_connector_info.get("Intersight URL") # Compare current Cloud DNS with the expected Cloud DNS if current_cloud_dns not in expected_cloud_dns: - # Call clear_intersight_claim_status if Cloud DNS values are different - self.clear_intersight_claim_status(intersight_device.target) + # Call reset_device_connector if Cloud DNS values are different + self.reset_device_connector(intersight_device.target) # Setting the device connector access mode (only for CIMC and UCSM devices) if self.metadata.device_type in ["cimc", "ucsm"] and access_mode: @@ -377,9 +377,9 @@ def claim_to_intersight(self, intersight_device, access_mode=None, proxy_details return True - def clear_intersight_claim_status(self, intersight_target="svc.intersight.com"): + def reset_device_connector(self, intersight_target="svc.intersight.com"): """ - Clears Intersight Claim Status + Resets Device Connector :return: True if successful, False otherwise """ if self.metadata.device_type not in ["cimc", "imm", "ucsm"]: @@ -392,9 +392,9 @@ def clear_intersight_claim_status(self, intersight_target="svc.intersight.com"): if not self.is_connected(): return False - message_str = "Clearing Intersight Claim Status of " + self.metadata.device_type_long + " device " + self.name + message_str = "Resetting Device Connector of " + self.metadata.device_type_long + " device " + self.name if self.task is not None: - self.task.taskstep_manager.start_taskstep(name="ClearIntersightClaimStatus", description=message_str) + self.task.taskstep_manager.start_taskstep(name="ResetDeviceConnector", description=message_str) self.logger(message=message_str) @@ -422,10 +422,10 @@ def clear_intersight_claim_status(self, intersight_target="svc.intersight.com"): self._set_device_connector_info() if self.task is not None: self.task.taskstep_manager.stop_taskstep( - name="ClearIntersightClaimStatus", status="successful", - status_message=f"Successfully cleared {self.metadata.device_type_long} device " + - f"{self.name} Intersight Claim Status") - self.logger(message="Intersight Claim Status cleared on " + self.metadata.device_type_long + + name="ResetDeviceConnector", status="successful", + status_message=f"Successfully reset {self.metadata.device_type_long} device " + + f"{self.name} Device Connector") + self.logger(message="Device Connector reset on " + self.metadata.device_type_long + " " + self.name) # We reset all Device Connector metadata info @@ -441,16 +441,16 @@ def clear_intersight_claim_status(self, intersight_target="svc.intersight.com"): else: if self.task is not None: self.task.taskstep_manager.stop_taskstep( - name="ClearIntersightClaimStatus", status="failed", + name="ResetDeviceConnector", status="failed", status_message=f"Error while clearing {self.metadata.device_type_long} {self.name}" + f" Intersight Claim Status: {str(response.status_code)}") - self.logger(level="error", message="Error while clearing Intersight Claim Status: " + + self.logger(level="error", message="Error while resetting Device Connector: " + str(response.status_code)) return False except Exception as err: if self.task is not None: self.task.taskstep_manager.stop_taskstep( - name="ClearIntersightClaimStatus", status="failed", + name="ResetDeviceConnector", status="failed", status_message=f"Error while clearing {self.metadata.device_type_long} {self.name}" + f" Intersight Claim Status: Couldn't request the device connector information" + f" from the API") @@ -459,7 +459,7 @@ def clear_intersight_claim_status(self, intersight_target="svc.intersight.com"): else: if self.task is not None: self.task.taskstep_manager.stop_taskstep( - name="ClearIntersightClaimStatus", status="failed", + name="ResetDeviceConnector", status="failed", status_message=f"Error while clearing {self.metadata.device_type_long} {self.name}" + f" Intersight Claim Status: No login cookie") self.logger(level="error", diff --git a/device/intersight/device.py b/device/intersight/device.py index a16a9a6..2c0516b 100644 --- a/device/intersight/device.py +++ b/device/intersight/device.py @@ -72,7 +72,7 @@ class IntersightDevice(GenericDevice): - INTERSIGHT_APPLIANCE_MIN_REQUIRED_VERSION = "1.1.0-0" + INTERSIGHT_APPLIANCE_MIN_REQUIRED_VERSION = "1.1.0-1" def __init__(self, parent=None, uuid=None, target="www.intersight.com", key_id="", private_key_path="", is_hidden=False, is_system=False, system_usage=None, proxy=None, proxy_user=None, proxy_password=None, @@ -297,15 +297,12 @@ def is_profile_unassigned(api_class_object, sdk_object_name, object_moid, retrie {IqnpoolApi: ["iqnpool_reservation", "iqnpool_pool"]}, {UuidpoolApi: ["uuidpool_reservation", "uuidpool_pool"]}, {ResourcepoolApi: ["resourcepool_membership_reservation", "resourcepool_pool"]}, - {IamApi: [ - "iam_end_point_user_policy", "iam_end_point_user_role", - "iam_end_point_user", "iam_permission", "iam_ldap_policy", "iam_sharing_rule" - ]}, + {IamApi: ["iam_user_group", "iam_user", "iam_end_point_user_policy", "iam_end_point_user", + "iam_permission", "iam_ldap_policy", "iam_sharing_rule"]}, {OrganizationApi: ["organization_organization"]} ] - settings_sdk_objects = ["iam_end_point_user_policy", "iam_end_point_user_role", "iam_end_point_user", - "iam_permission"] + settings_sdk_objects = ["iam_user_group", "iam_user", "iam_permission"] # A set containing moid of all the organizations to be deleted orgs_to_be_deleted = set() @@ -394,7 +391,7 @@ def is_profile_unassigned(api_class_object, sdk_object_name, object_moid, retrie # 'shared' ownership. We do not delete such objects. if hasattr(result, "shared_scope") and result.shared_scope == "shared": continue - # We skip some System defined objects which exists on appliance. These objects does not + # We skip some System defined objects which exists on appliance. These objects do not # belong to any organization and cannot be deleted. So we skip deleting them. # In Appliance version 1.1.0-0, we have 'ntp.Policy' and 'networkconfig.Policy' policy named # 'APPLIANCE-DEFAULT' which are system defined. @@ -501,6 +498,9 @@ def is_profile_unassigned(api_class_object, sdk_object_name, object_moid, retrie f"'{obj.name}' (MOID: {obj.moid})." ) continue + # Skip deletion of the iam_user if name is "admin". + elif sdk_object == "iam_user" and getattr(obj, "name", "") == "admin": + continue elif sdk_object == "iam_permission": # We skip the deletion of system defined objects skip_object = False @@ -708,11 +708,18 @@ def connect(self, bypass_version_checks=False): from api.api_server import easyucs if easyucs: self.metadata.is_reachable = False - self.logger(level="error", message="EasyUCS supports version " + - self.version_min_required + " and above.Your version" - + version + " is not supported.") + self.logger( + level="error", + message="EasyUCS supports version " + self.version_min_required + + " and above. Your version " + version + " is not supported." + ) return False else: + self.logger( + level="warning", + message="EasyUCS supports version " + self.version_min_required + + " and above. Your version " + version + " is not supported." + ) if not common.query_yes_no("Are you sure you want to continue with an unsupported version?"): # User declined continue with unsupported version query self.disconnect() diff --git a/device/ucs/device.py b/device/ucs/device.py index c046baf..d65929d 100644 --- a/device/ucs/device.py +++ b/device/ucs/device.py @@ -117,11 +117,18 @@ def connect(self, auto_refresh=None, force=None, bypass_version_checks=False, re from api.api_server import easyucs if easyucs: self.metadata.is_reachable = False - self.logger(level="error", message="EasyUCS supports version " + - self.version_min_required.version + " and above. Your " + - "version " + self.version.version + " is not supported.") + self.logger( + level="error", + message="EasyUCS supports version " + self.version_min_required.version + + " and above. Your version " + self.version.version + " is not supported." + ) return False else: + self.logger( + level="warning", + message="EasyUCS supports version " + self.version_min_required.version + + " and above. Your version " + self.version.version + " is not supported." + ) if not common.query_yes_no( "Are you sure you want to continue with an unsupported version?"): # User declined continue with unsupported version query @@ -706,13 +713,13 @@ def initial_setup(self, fi_ip_list=[], config=None): self.set_task_progression(35) return True - def reset(self, bypass_version_checks=False, clear_intersight_claim_status=False, clear_sel_logs=False, + def reset(self, bypass_version_checks=False, reset_device_connector=False, clear_sel_logs=False, decommission_rack_servers=False, erase_flexflash=False, erase_virtual_drives=False, unregister_from_central=True): """ Erases all configuration from the UCS System :param bypass_version_checks: Whether the minimum version checks should be bypassed when connecting - :param clear_intersight_claim_status: Whether Intersight claim status should be cleared if claimed + :param reset_device_connector: Whether the Device Connector should be reset if claimed :param clear_sel_logs: Whether SEL Logs should be cleared before reset :param decommission_rack_servers: Whether rack servers should be decommissioned before reset :param erase_flexflash: Whether FlexFlash should be formatted before reset @@ -727,16 +734,16 @@ def reset(self, bypass_version_checks=False, clear_intersight_claim_status=False self.logger(level="error", message="Unable to connect to UCS System") return False - if clear_intersight_claim_status and self.metadata.device_connector_claim_status == "claimed": + if reset_device_connector and self.metadata.device_connector_claim_status == "claimed": # If the UCSM device is claimed to Intersight, unclaim the device - if not self.clear_intersight_claim_status(): + if not self.reset_device_connector(): self.logger(level="error", message=f"Error while un-claiming the {self.metadata.device_type_long} " f"device {self.name} from Intersight") return False else: if self.task is not None: self.task.taskstep_manager.skip_taskstep( - name="ClearIntersightClaimStatus", + name="ResetDeviceConnector", status_message=f"Skipping the unclaim of {self.metadata.device_type_long} device {self.name} since " f"it is not claimed to Intersight" ) @@ -2006,7 +2013,7 @@ def initial_setup(self, imc_ip=None, config=None, bypass_version_checks=False): return False def reset(self, erase_virtual_drives=False, erase_flexflash=False, clear_sel_logs=False, set_drives_status=None, - bypass_version_checks=False, clear_intersight_claim_status=False): + bypass_version_checks=False, reset_device_connector=False): """ Erases all configuration from the UCS IMC :param erase_virtual_drives: Whether existing virtual drives should be erased from server before reset @@ -2014,7 +2021,7 @@ def reset(self, erase_virtual_drives=False, erase_flexflash=False, clear_sel_log :param clear_sel_logs: Whether SEL Log should be cleared before reset :param set_drives_status: The status to which the drives should be set before reset :param bypass_version_checks: Whether the minimum version checks should be bypassed when connecting - :param clear_intersight_claim_status: Whether Intersight claim status should be cleared if claimed + :param reset_device_connector: Whether the Device Connector should be reset if claimed :return: True if reset is successful, False otherwise """ @@ -2024,16 +2031,16 @@ def reset(self, erase_virtual_drives=False, erase_flexflash=False, clear_sel_log self.logger(level="error", message="Unable to connect to UCS IMC") return False - if clear_intersight_claim_status and self.metadata.device_connector_claim_status == "claimed": + if reset_device_connector and self.metadata.device_connector_claim_status == "claimed": # If the UCS IMC device is claimed to Intersight unclaim the device - if not self.clear_intersight_claim_status(): + if not self.reset_device_connector(): self.logger(level="error", message=f"Error while un-claiming the {self.metadata.device_type_long} " f"device {self.name} from Intersight") return False else: if self.task is not None: self.task.taskstep_manager.skip_taskstep( - name="ClearIntersightClaimStatus", + name="ResetDeviceConnector", status_message=f"Skipping the unclaim of {self.metadata.device_type_long} device {self.name} since " f"it is not claimed to Intersight" ) diff --git a/docs/ACTIONS.md b/docs/ACTIONS.md index d704dce..040784b 100644 --- a/docs/ACTIONS.md +++ b/docs/ACTIONS.md @@ -4,7 +4,7 @@ EasyUCS can perform maintenance actions on a live device, like: * Regenerate expired self-signed certificate on a UCS system * Clear SEL Logs of a UCS IMC / of all discovered servers on a UCS system * Clear all user sessions of a UCS IMC / UCS system / UCS central -* Clear Intersight Device Connector claim status of a UCS IMC / UCS system +* Reset Device Connector of a UCS IMC / UCS system ## Device actions @@ -32,13 +32,13 @@ Scope: The second argument is the type of action: ``` Action: - {regenerate_certificate,clear_sel_logs,clear_user_sessions,clear_intersight_claim_status} + {regenerate_certificate,clear_sel_logs,clear_user_sessions,reset_device_connector} Device actions regenerate_certificate Regenerate self-signed certificate of an UCS system clear_sel_logs Clears all SEL logs of an UCS device clear_user_sessions Clears all user sessions of an UCS device - clear_intersight_claim_status Clears Intersight Device Connector claim status of an UCS device + reset_device_connector Resets Intersight Device Connector of an UCS device ``` #### Arguments for a device action diff --git a/docs/SCHEMAS.md b/docs/SCHEMAS.md index a5115f8..2cc414d 100644 --- a/docs/SCHEMAS.md +++ b/docs/SCHEMAS.md @@ -3,9 +3,9 @@ EasyUCS can generate infrastructure & equipment schemas from a live device. The following schemas are generated: -* Front & rear view of chassis including I/O modules and blades -* Front & rear view of rack servers including adapters -* Front & rear view of fabric interconnects & fabric extenders +* Front & rear views of chassis including I/O modules and blades +* Front & rear views of rack servers including adapters +* Front & rear views of fabric interconnects & fabric extenders * Infrastructure view of each chassis & rack server with its physical connectivity to the fabric interconnects * Infrastructure view of LAN neighbors connected to the fabric interconnects * Infrastructure view of SAN neighbors connected to the fabric interconnects diff --git a/draw/ucs/chassis.py b/draw/ucs/chassis.py index e1f053f..7e6d430 100644 --- a/draw/ucs/chassis.py +++ b/draw/ucs/chassis.py @@ -163,7 +163,7 @@ def __init__(self, parent=None, color_ports=True): self.xfm_list = self.get_xfm_list() if self._parent.fabric_interconnects: - # We have Fabric Interconnects in the chassis (UCS Mini) + # We have Fabric Interconnects in the chassis (UCS Mini/X-Direct) self.fi_list = self.get_fi_list() self.fill_blanks() self._file_name = self._device_target + "_chassis_" + self._parent.id + "_rear" @@ -240,7 +240,7 @@ def fill_blanks(self): used_slot_ids.append(1) elif slot.id == 'B': # for FI B in IOM Slot 2 used_slot_ids.append(2) - else: # for normal use of a chassis ( != UCS Mini) + else: # for normal use of a chassis ( != UCS Mini/X-Direct) used_slot_ids.append(int(slot.id)) for slot in slots_list: @@ -1431,7 +1431,7 @@ def fill_blanks(self): used_slot_ids.append(1) elif slot.id == 'B': # for FI B in IOM Slot 2 used_slot_ids.append(2) - else: # for normal use of a chassis ( != UCS Mini) + else: # for normal use of a chassis ( != UCS Mini/X-Direct) used_slot_ids.append(int(slot.id)) for slot in slots_list: diff --git a/draw/ucs/rack.py b/draw/ucs/rack.py index 4f04e99..dc71f92 100644 --- a/draw/ucs/rack.py +++ b/draw/ucs/rack.py @@ -389,7 +389,7 @@ def fill_blanks(self): self.paste_layer(img, coord_offset) if "pcie_riser_slots" in self.json_file: - # Fill blank for PCIe Riser slot (we put the default ones when None could been detected) + # Fill blank for PCIe Riser slot (we put the default ones when None could be detected) if len(self._parent_pcie_risers)-1 < len(self.json_file["pcie_riser_slots"]): used_slot = [] potential_slot = [] diff --git a/easyucs.py b/easyucs.py index c2a0c53..0ef9343 100644 --- a/easyucs.py +++ b/easyucs.py @@ -386,10 +386,14 @@ def init_process(device, args, config_string): device.set_task_progression(10) device.clear_user_sessions() - elif args.scope == "device" and args.action == "clear_intersight_claim_status": - # Clears Intersight Claim Status of Device + elif args.scope == "device" and args.action == "reset_device_connector": + # Reset Device Connector of Device device.set_task_progression(10) - device.clear_intersight_claim_status() + if not device.connect(bypass_version_checks=bypass_version_checks): + device.logger(level="error", message="Failed to connect to device") + exit() + device.reset_device_connector() + device.disconnect() elif args.scope == "device" and args.action == "get_device_connector_status": # Get Intersight info of Device @@ -500,18 +504,18 @@ def main(): python easyucs.py device clear_user_sessions -t ucsc -i 192.168.0.3 -u admin -p password clear all user sessions of UCS Central''' - example_device_clear_intersight_claim_status_text = '''Examples: - python easyucs.py device clear_intersight_claim_status -t ucsm -i 192.168.0.1 -u admin -p password - clear intersight claim status of UCS System - python easyucs.py device clear_intersight_claim_status -t cimc -i 192.168.0.2 -u admin -p password - clear intersight claim status of IMC System + example_device_reset_device_connector_text = '''Examples: + python easyucs.py device reset_device_connector -t ucsm -i 192.168.0.1 -u admin -p password + reset Device Connector of UCS System + python easyucs.py device reset_device_connector -t cimc -i 192.168.0.2 -u admin -p password + Reset Device Connector of IMC System ''' example_device_get_device_connector_status_text = '''Examples: python easyucs.py device get_device_connector_status -t ucsm -i 192.168.0.1 -u admin -p password - clear intersight claim status of UCS System + Reset Device Connector of UCS System python easyucs.py device get_device_connector_status -t cimc -i 192.168.0.2 -u admin -p password - clear intersight claim status of IMC System + Reset Device Connector of IMC System ''' # Introduction message @@ -739,34 +743,34 @@ def main(): parser_device_clear_user_sessions.add_argument('-y', '--yes', dest='yes', action='store_true', help='Answer yes to all questions') - # Create the parsers for the "clear_intersight_claim_status" action of device - parser_device_clear_intersight_claim_status = \ - subparsers_device.add_parser('clear_intersight_claim_status', - help='Clears Intersight claim status of a device', - epilog=example_device_clear_intersight_claim_status_text, + # Create the parsers for the "reset_device_connector" action of device + parser_device_reset_device_connector = \ + subparsers_device.add_parser('reset_device_connector', + help='Resets Device Connector of a device', + epilog=example_device_reset_device_connector_text, formatter_class=argparse.RawDescriptionHelpFormatter) - parser_device_clear_intersight_claim_status.add_argument('-i', '--ip', dest='ip', action='store', + parser_device_reset_device_connector.add_argument('-i', '--ip', dest='ip', action='store', help='Device IP address/Hostname', required=True) - parser_device_clear_intersight_claim_status.add_argument('-u', '--username', dest='username', action='store', + parser_device_reset_device_connector.add_argument('-u', '--username', dest='username', action='store', help='Device Account Username', required=True) - parser_device_clear_intersight_claim_status.add_argument('-p', '--password', dest='password', action='store', + parser_device_reset_device_connector.add_argument('-p', '--password', dest='password', action='store', help='Device Account Password', required=True) - parser_device_clear_intersight_claim_status.add_argument('-t', '--device_type', dest='device_type', action='store', + parser_device_reset_device_connector.add_argument('-t', '--device_type', dest='device_type', action='store', choices=['ucsm', 'cimc', 'ucsc'], required=True, help='Device type') - parser_device_clear_intersight_claim_status.add_argument('-v', '--verbose', dest='log', action='store_true', + parser_device_reset_device_connector.add_argument('-v', '--verbose', dest='log', action='store_true', help='Print debug log') - parser_device_clear_intersight_claim_status.add_argument('-l', '--logfile', dest='logfile', action='store', + parser_device_reset_device_connector.add_argument('-l', '--logfile', dest='logfile', action='store', help='Print log in a file') - parser_device_clear_intersight_claim_status.add_argument('-y', '--yes', dest='yes', action='store_true', + parser_device_reset_device_connector.add_argument('-y', '--yes', dest='yes', action='store_true', help='Answer yes to all questions') # Create the parsers for the "get_device_connector_status" action of device parser_device_get_device_connector_status = \ subparsers_device.add_parser('get_device_connector_status', - help='Clears Intersight claim status of a device', + help='Gets Intersight claim status of a device', epilog=example_device_get_device_connector_status_text, formatter_class=argparse.RawDescriptionHelpFormatter) parser_device_get_device_connector_status.add_argument('-i', '--ip', dest='ip', action='store', diff --git a/inventory/ucs/fabric.py b/inventory/ucs/fabric.py index c4451ee..1745210 100644 --- a/inventory/ucs/fabric.py +++ b/inventory/ucs/fabric.py @@ -228,8 +228,8 @@ def __init__(self, parent=None, network_element=None): self.short_name = None self.vlan_port_count = None - # UCS Mini Fabric Interconnect is a bit different - The CapProvider object needs to be changed - if self.model == "UCS-FI-M-6324": + # UCS Mini/X-Direct Fabric Interconnect is a bit different - The CapProvider object needs to be changed + if self.model in ["UCS-FI-M-6324", "UCSX-S9108-100G"]: self._UCS_SDK_CATALOG_OBJECT_NAME = "equipmentSwitchIOCardCapProvider" UcsSystemInventoryObject.__init__(self, parent=parent, ucs_sdk_object=network_element) @@ -251,7 +251,7 @@ def __init__(self, parent=None, network_element=None): def _generate_draw(self): self._draw_rear = UcsSystemDrawFiRear(parent=self) - if self.model != "UCS-FI-M-6324": + if self.model not in ["UCS-FI-M-6324", "UCSX-S9108-100G"]: self._draw_front = UcsSystemDrawFiFront(parent=self) def _get_expansion_modules(self): diff --git a/inventory/ucs/manager.py b/inventory/ucs/manager.py index bf64c2a..ebd97aa 100644 --- a/inventory/ucs/manager.py +++ b/inventory/ucs/manager.py @@ -97,12 +97,16 @@ def draw_inventory(self, uuid=None): fi_rear_draw_list = [fi for fi in fi_rear_draw_list if fi.picture_size] rotated_fi_draw_list = [] + is_embedded_fi = False for fi in fi_rear_draw_list: if fi._parent.sku == "UCS-FI-M-6324": + is_embedded_fi = True # As we drop the picture before, we need to recreate it and drop it again fi._get_picture() rotated_fi_draw_list.append(fi.rotate_object(fi)) fi.picture = None + elif fi._parent.sku == "UCSX-S9108-100G": + is_embedded_fi = True fex_rear_draw_list = [] for fex in inventory.fabric_extenders: @@ -169,8 +173,8 @@ def draw_inventory(self, uuid=None): # Draw infra of equipments for chassis_draw in chassis_rear_draw_list: - # if draw_rotated_fi_list exists then the chassis 1 is a UCS Mini chassis - if not (rotated_fi_draw_list and chassis_draw._parent.id == '1'): + # if FI is embedded then the chassis 1 is a UCS Mini/X-Direct chassis, so no need to draw infra + if not (is_embedded_fi and chassis_draw._parent.id == '1'): if fi_rear_draw_list: infra = UcsSystemDrawInfraChassis(chassis=chassis_draw, fi_list=fi_rear_draw_list, diff --git a/inventory/ucs/transceiver.py b/inventory/ucs/transceiver.py index beb1d33..2313b72 100644 --- a/inventory/ucs/transceiver.py +++ b/inventory/ucs/transceiver.py @@ -86,6 +86,7 @@ def __init__(self, parent=None, equipment_xcvr=None): "qsfp4sfp10gcu1m": {"sku": "QSFP-4SFP10G-CU1M", "length": "1m"}, "qsfp4sfp10gcu2m": {"sku": "QSFP-4SFP10G-CU2M", "length": "2m"}, "qsfp4sfp10gcu3m": {"sku": "QSFP-4SFP10G-CU3M", "length": "3m"}, + "qsfp4sfp10gcu4m": {"sku": "QSFP-4SFP10G-CU4M", "length": "4m"}, "qsfp4sfp10gcu5m": {"sku": "QSFP-4SFP10G-CU5M", "length": "5m"}, "qsfp4x10gac7m": {"sku": "QSFP-4X10G-AC7M", "length": "7m"}, "qsfp4x10gac10m": {"sku": "QSFP-4X10G-AC10M", "length": "10m"}, diff --git a/report/content_table.py b/report/content_table.py index f0876cb..c77ed61 100644 --- a/report/content_table.py +++ b/report/content_table.py @@ -160,7 +160,7 @@ def add_in_word_report(self): for i in range(len(self.cells_list)): row = self.cells_list[i] row = list(filter(None.__ne__, row)) # Remove None values - # Replace True with unicode check mark and False with unicode cross mark + # Replace True with Unicode check mark and False with Unicode cross mark # row = ["\U00002705" if e is True else "\U0000274C" if e is False else e for e in row] row_cells = table.rows[i].cells for j in range(0, len(row)): diff --git a/report/ucs/architecture.py b/report/ucs/architecture.py index a663448..0775e4b 100644 --- a/report/ucs/architecture.py +++ b/report/ucs/architecture.py @@ -26,12 +26,12 @@ def __init__(self, order_id, parent, title=""): title = _("Internal Infrastructure cabling") UcsReportSection.__init__(self, order_id=order_id, parent=parent, title=title) if self.report.inventory.chassis: - if self.report.inventory.fabric_interconnects[0].model not in ["UCS-FI-M-6324"]: + if self.report.inventory.fabric_interconnects[0].model not in ["UCS-FI-M-6324", "UCSX-S9108-100G"]: self.content_list.append( UcsSystemInfraCablingAllChassisReportSection(order_id=self.report.get_current_order_id(), parent=self)) else: - # Checking if we have a second chassis in UCS Mini, otherwise infra section is not needed + # Checking if we have a second chassis in UCS Mini/X-Direct, otherwise infra section is not needed if len(self.report.inventory.chassis) > 1: self.content_list.append( UcsSystemInfraCablingAllChassisReportSection(order_id=self.report.get_current_order_id(), @@ -52,8 +52,9 @@ def __init__(self, order_id, parent, title=""): title = _("Chassis Internal Infrastructure cabling") UcsReportSection.__init__(self, order_id=order_id, parent=parent, title=title) for chassis in self.report.inventory.chassis: - if chassis.id == "1" and self.report.inventory.fabric_interconnects[0].model in ["UCS-FI-M-6324"]: - # We do not create a section for chassis 1 in UCS Mini + if (chassis.id == "1" and self.report.inventory.fabric_interconnects[0].model in + ["UCS-FI-M-6324", "UCSX-S9108-100G"]): + # We do not create a section for chassis 1 in UCS Mini/X-Direct continue chassis_name = chassis.id if chassis.user_label: diff --git a/report/ucs/configuration.py b/report/ucs/configuration.py index 8753148..8f48225 100644 --- a/report/ucs/configuration.py +++ b/report/ucs/configuration.py @@ -56,7 +56,7 @@ def __init__(self, order_id, parent, title, fi): # UCS Mini FI only has a rear picture path_rear = self.report.img_path + "fi_" + fi.id + "_rear.png" if os.path.exists(path_rear): - # rotate and create an horizontal picture of the FI from UCS Mini + # rotate and create a horizontal picture of the FI from UCS Mini image = Image.open(path_rear).rotate(90, expand=True) path_rear = self.report.img_path + "fi_" + fi.id + "_rear_horizontal.png" image.save(path_rear) diff --git a/report/ucs/inventory.py b/report/ucs/inventory.py index d02d739..ca8cfa1 100644 --- a/report/ucs/inventory.py +++ b/report/ucs/inventory.py @@ -74,14 +74,15 @@ def __init__(self, order_id, parent, title, fi): _(" expansion modules and ") + str(len(fi.power_supplies)) + _(" power supplies.") self.content_list.append(GenericReportText(order_id=self.report.get_current_order_id(), parent=self, string=descr)) - if fi.model in ["UCS-FI-M-6324"]: - # UCS Mini FI only has a rear picture + if fi.model in ["UCS-FI-M-6324", "UCSX-S9108-100G"]: + # UCS Mini/X-Direct FI only has a rear picture path_rear = self.report.img_path + "fi_" + fi.id + "_rear_clear.png" if os.path.exists(path_rear): - # rotate and create an horizontal picture of the FI from UCS Mini - image = Image.open(path_rear).rotate(90, expand=True) - path_rear = self.report.img_path + "fi_" + fi.id + "_rear_clear_horizontal.png" - image.save(path_rear) + if fi.model in ["UCS-FI-M-6324"]: + # rotate and create a horizontal picture of the FI from UCS Mini + image = Image.open(path_rear).rotate(90, expand=True) + path_rear = self.report.img_path + "fi_" + fi.id + "_rear_clear_horizontal.png" + image.save(path_rear) self.content_list.append( GenericReportImage(order_id=self.report.get_current_order_id(), parent=self, path=path_rear, centered=True, spacing_after=2)) diff --git a/requirements.txt b/requirements.txt index f382e0b..d6c24e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ imcsdk>=0.9.13 jsonschema>=3.2.0 python-docx>=1.0.1 requests>=2.23.0 -ucsmsdk>=0.9.18 +ucsmsdk>=0.9.19 ucscsdk>=0.9.0.7 matplotlib>=3.2.1 natsort>=7.1.1 @@ -17,7 +17,7 @@ Flask>=2.0.0 Flask-Cors>=3.0.10 cryptography>=42.0.4 urllib3>=1.25.9 -intersight==1.0.11.17057 +intersight>=1.0.11.17956 SQLAlchemy>=2.0.23 werkzeug>=1.0.1 numpy>=1.19.4 diff --git a/schema/intersight/config/orgs/bios_policies.json b/schema/intersight/config/orgs/bios_policies.json index c52c986..6c7fa56 100644 --- a/schema/intersight/config/orgs/bios_policies.json +++ b/schema/intersight/config/orgs/bios_policies.json @@ -627,24 +627,14 @@ "platform-default" ] }, - "cbs_cmn_mem_dram_refresh_rate": { - "description": "BIOS Policy - cbs_cmn_mem_dram_refresh_rate", - "type": "string", - "default": "platform-default", - "enum": [ - "3.9 usec", - "7.8 usec", - "platform-default" - ] - }, "cbs_cmn_mem_map_bank_interleave_ddr4": { "description": "BIOS Policy - cbs_cmn_mem_map_bank_interleave_ddr4", "type": "string", "default": "platform-default", "enum": [ "Auto", + "Enabled", "disabled", - "enabled", "platform-default" ] }, @@ -827,29 +817,6 @@ "platform-default" ] }, - "cbs_dbg_cpu_lapic_mode7xx2": { - "description": "BIOS Policy - cbs_dbg_cpu_lapic_mode7xx2", - "type": "string", - "default": "platform-default", - "enum": [ - "Auto", - "X2APIC", - "XAPIC", - "platform-default" - ] - }, - "cbs_dbg_cpu_lapic_mode7xx3": { - "description": "BIOS Policy - cbs_dbg_cpu_lapic_mode7xx3", - "type": "string", - "default": "platform-default", - "enum": [ - "Auto", - "Compatibility", - "X2APIC", - "XAPIC", - "platform-default" - ] - }, "cbs_dbg_cpu_snp_mem_cover": { "description": "BIOS Policy - cbs_dbg_cpu_snp_mem_cover", "type": "string", diff --git a/schema/intersight/config/orgs/ip_pools.json b/schema/intersight/config/orgs/ip_pools.json index ac1db85..915d13e 100644 --- a/schema/intersight/config/orgs/ip_pools.json +++ b/schema/intersight/config/orgs/ip_pools.json @@ -334,7 +334,7 @@ ] }, "reservations": { - "description": "Blocks of IPv4 Addresses in IP Pool", + "description": "Reservations of IP Addresses in IP Pool", "type": "array", "items": { "type": "object", @@ -342,12 +342,12 @@ { "properties": { "identity": { - "description": "Identity of IP address being reserved", + "description": "Identity of IPv4 address being reserved", "type": "string", "pattern": "^$|^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" }, "ip_type": { - "description": "Identity of IP address being reserved", + "description": "IP Type of IPv4 address being reserved", "type": "string", "enum": [ "IPv4" @@ -364,12 +364,12 @@ { "properties": { "identity": { - "description": "Identity of IP address being reserved", + "description": "Identity of IPv6 address being reserved", "type": "string", "pattern": "^$|^(([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{0,4}|:[0-9A-Fa-f]{1,4})?|(:[0-9A-Fa-f]{1,4}){0,2})|(:[0-9A-Fa-f]{1,4}){0,3})|(:[0-9A-Fa-f]{1,4}){0,4})|:(:[0-9A-Fa-f]{1,4}){0,5})((:[0-9A-Fa-f]{1,4}){2}|:(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])(\\.(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])){3})|(([0-9A-Fa-f]{1,4}:){1,6}|:):[0-9A-Fa-f]{0,4}|([0-9A-Fa-f]{1,4}:){7}:)$" }, "ip_type": { - "description": "Identity of IP address being reserved", + "description": "Identity of IPv6 address being reserved", "type": "string", "enum": [ "IPv6" diff --git a/schema/intersight/config/orgs/port_policies.json b/schema/intersight/config/orgs/port_policies.json index 42e1e15..3b13215 100644 --- a/schema/intersight/config/orgs/port_policies.json +++ b/schema/intersight/config/orgs/port_policies.json @@ -978,8 +978,8 @@ "port_id_end": { "description": "Port Policy - SAN Unified Ports - Port ID End of Range", "type": "integer", - "default": 4, - "minimum": 4, + "default": 1, + "minimum": 1, "maximum": 36 } }, diff --git a/schema/intersight/config/orgs/vsan_policies.json b/schema/intersight/config/orgs/vsan_policies.json index 86f4606..f696b3b 100644 --- a/schema/intersight/config/orgs/vsan_policies.json +++ b/schema/intersight/config/orgs/vsan_policies.json @@ -93,7 +93,7 @@ ] }, "zoning": { - "description": "VSAN Policy - FC Zoning Admin State", + "description": "(DEPRECATED) VSAN Policy - FC Zoning Admin State", "type": "string", "default": "Disabled", "enum": [ diff --git a/schema/intersight/config/resource_groups.json b/schema/intersight/config/resource_groups.json index 8f54a6f..db16bc2 100644 --- a/schema/intersight/config/resource_groups.json +++ b/schema/intersight/config/resource_groups.json @@ -46,12 +46,25 @@ "description": "Resource Group Member Device Name", "type": "string", "default": "" + }, + "serial_number": { + "description": "Resource Group Member Device Serial Number", + "type": "string", + "default": "" + }, + "type": { + "description": "Resource Group Member Device Type", + "type": "string", + "enum": [ + "Blade", + "Rack" + ] } }, "additionalProperties": false, "required": [ "name" - ] + ] } ], "minItems": 1 diff --git a/schema/ucs/cimc/easyucs.json b/schema/ucs/cimc/easyucs.json index 9e40e3c..94677b4 100644 --- a/schema/ucs/cimc/easyucs.json +++ b/schema/ucs/cimc/easyucs.json @@ -158,8 +158,8 @@ "unconfigured-good" ] }, - "clear_intersight_claim_status": { - "description": "Clear Intersight Claim Status of UCS device", + "reset_device_connector": { + "description": "Reset Device Connector of UCS device", "type": "string", "default": "no", "enum": [ diff --git a/schema/ucs/easyucs.json b/schema/ucs/easyucs.json index 94fd7d7..e55f54c 100644 --- a/schema/ucs/easyucs.json +++ b/schema/ucs/easyucs.json @@ -174,8 +174,8 @@ "unconfigured-good" ] }, - "clear_intersight_claim_status": { - "description": "Clear Intersight Claim Status of UCS device", + "reset_device_connector": { + "description": "Reset Device Connector of UCS device", "type": "string", "default": "no", "enum": [ diff --git a/schema/ucs/ucsc/config/orgs/bios_policies.json b/schema/ucs/ucsc/config/orgs/bios_policies.json index 9387754..b3c599e 100644 --- a/schema/ucs/ucsc/config/orgs/bios_policies.json +++ b/schema/ucs/ucsc/config/orgs/bios_policies.json @@ -57,6 +57,23 @@ "yes" ] }, + "4_link_xgmi_max_speed": { + "description": "BIOS Policy - Processor - 4-link xGMI max speed", + "type": "string", + "default": "platform-default", + "enum": [ + "20Gbps", + "20gbps", + "25Gbps", + "25gbps", + "32Gbps", + "32gbps", + "Auto", + "Platform Default", + "auto", + "platform-default" + ] + }, "acpi10_support": { "description": "BIOS Policy - ACPI10 Support - ACPI10 Support", "type": "string", @@ -434,6 +451,21 @@ "platform-default" ] }, + "avx512": { + "description": "BIOS Policy - Processor - AVX512", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "bank_group_swap": { "description": "BIOS Policy - Processor - Bank Group Swap", "type": "string", @@ -537,9 +569,11 @@ "type": "string", "default": "platform-default", "enum": [ + "Auto", "Disabled", "Enabled", "Platform Default", + "auto", "disabled", "enabled", "platform-default" @@ -550,9 +584,41 @@ "type": "string", "default": "platform-default", "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, + "cbs_df_cmn_mem_intlv_control": { + "description": "BIOS Policy - Memory Interleaving - Memory Interleaving", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", "Disabled", "Enabled", "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, + "cbs_df_cmn_mem_intlv_sp5": { + "description": "BIOS Policy - Memory Interleaving - Memory Interleaving", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", "disabled", "enabled", "platform-default" @@ -563,6 +629,8 @@ "type": "string", "default": "platform-default", "enum": [ + "10-CCDs", + "10-ccds", "2-CCDs", "2-ccds", "3-CCDs", @@ -571,6 +639,8 @@ "4-ccds", "6-CCDs", "6-ccds", + "8-CCDs", + "8-ccds", "Auto", "Platform Default", "auto", @@ -797,6 +867,21 @@ "platform-default" ] }, + "core_watchdog_timer_enable": { + "description": "BIOS Policy - Processor - Core Watchdog Timer Enable", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "cppc": { "description": "BIOS Policy - Processor - CPPC", "type": "string", @@ -837,6 +922,31 @@ "two-(2-+-0)" ] }, + "cpu_downcore_control_f19_m10h_1fh": { + "description": "BIOS Policy - Processor - CPU Downcore control F19 M10h-1Fh", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "FIVE-(5-+-0)", + "FOUR-(4-+-0)", + "ONE-(1-+-0)", + "Platform Default", + "SEVEN-(7-+-0)", + "SIX-(6-+-0)", + "THREE-(3-+-0)", + "TWO-(2-+-0)", + "auto", + "five-(5-+-0)", + "four-(4-+-0)", + "one-(1-+-0)", + "platform-default", + "seven-(7-+-0)", + "six-(6-+-0)", + "three-(3-+-0)", + "two-(2-+-0)" + ] + }, "cpu_hardware_power_management": { "description": "BIOS Policy - CPU Hardware Power Management - CPU Hardware Power Management", "type": "string", @@ -1046,6 +1156,21 @@ "platform-default" ] }, + "dfx_osb_configuration": { + "description": "BIOS Policy - DFX OSB Configuration - DFX OSB Configuration", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "direct_cache_access": { "description": "BIOS Policy - Direct Cache Access - Direct Cache Access", "type": "string", @@ -1061,6 +1186,21 @@ "platform-default" ] }, + "dlwm_support": { + "description": "BIOS Policy - Processor - DLWM Support", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "dma_control_opt_in_flag": { "description": "BIOS Policy - Trusted Platform Module - DMA Control Opt-In Flag", "type": "string", @@ -1129,6 +1269,27 @@ "platform-default" ] }, + "dram_scrub_time": { + "description": "BIOS Policy - DRAM Scrub Time - DRAM Scrub Time", + "type": "string", + "default": "platform-default", + "enum": [ + "1-hour", + "12-hours", + "16-hours", + "24-hours", + "4-hours", + "48-hours", + "6-hours", + "8-hours", + "Auto", + "Disabled", + "Platform Default", + "auto", + "disabled", + "platform-default" + ] + }, "dram_sw_thermal_throttling": { "description": "BIOS Policy - Processor - DRAM SW Thermal Throttling", "type": "string", @@ -1157,6 +1318,21 @@ "platform-default" ] }, + "edc_control_throttle": { + "description": "BIOS Policy - Processor - EDC Control Throttle", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "efficiency_mode_enable": { "description": "BIOS Policy - Processor - Efficiency Mode Enable", "type": "string", @@ -1333,6 +1509,12 @@ "platform-default" ] }, + "fixed_soc_pstate_sp5_f19h": { + "description": "BIOS Policy - Processor - Fixed SOC Pstate SP5 F19h", + "type": "string", + "default": "platform-default", + "pattern": "platform-default|^[0-2]$" + }, "flow_control": { "description": "BIOS Policy - Console redirection - Flow Control", "type": "string", @@ -2452,6 +2634,19 @@ "platform-default" ] }, + "ioat_configuration": { + "description": "BIOS Policy - Processor - IOAT Configuration", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "ioemezz1_linkspeed": { "description": "BIOS Policy - PCI Slot Link Speed - IOEMezz1 LinkSpeed", "type": "string", @@ -2800,6 +2995,23 @@ "platform-default" ] }, + "local_apic_mode": { + "description": "BIOS Policy - Processor - Local APIC Mode", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Compatibility", + "Platform Default", + "X2APIC", + "XAPIC", + "auto", + "compatibility", + "platform-default", + "x2apic", + "xapic" + ] + }, "local_x2_apic": { "description": "BIOS Policy - Local X2 Apic - Local X2 Apic", "type": "string", @@ -2911,6 +3123,72 @@ "platform-default" ] }, + "memory_clock_speed_7xx2": { + "description": "BIOS Policy - Processor - Memory Clock Speed 7xx2", + "type": "string", + "default": "platform-default", + "enum": [ + "1067MHz", + "1067mhz", + "1200MHz", + "1200mhz", + "1333MHz", + "1333mhz", + "1467MHz", + "1467mhz", + "1600MHz", + "1600mhz", + "667MHz", + "667mhz", + "800MHz", + "800mhz", + "933MHz", + "933mhz", + "Auto", + "Platform Default", + "auto", + "platform-default" + ] + }, + "memory_clock_speed_7xx3": { + "description": "BIOS Policy - Processor - Memory Clock Speed 7xx3", + "type": "string", + "default": "platform-default", + "enum": [ + "1067MHz", + "1067mhz", + "1200MHz", + "1200mhz", + "1333MHz", + "1333mhz", + "1467MHz", + "1467mhz", + "1600MHz", + "1600mhz", + "1633MHz", + "1633mhz", + "1667MHz", + "1667mhz", + "1700MHz", + "1700mhz", + "1733MHz", + "1733mhz", + "1767MHz", + "1767mhz", + "1800MHz", + "1800mhz", + "400MHz", + "400mhz", + "800MHz", + "800mhz", + "933MHz", + "933mhz", + "Auto", + "Platform Default", + "auto", + "platform-default" + ] + }, "memory_interleaving": { "description": "BIOS Policy - Interleave Configuration - Memory Interleaving", "type": "string", @@ -3032,6 +3310,54 @@ "platform-default" ] }, + "mmio_high_base": { + "description": "BIOS Policy - MMIO High Base - MMIO High Base", + "type": "string", + "default": "platform-default", + "enum": [ + "16T", + "16t", + "1T", + "1t", + "24T", + "24t", + "2T", + "2t", + "32T", + "32t", + "40T", + "40t", + "4T", + "4t", + "512G", + "512g", + "56T", + "56t", + "Platform Default", + "platform-default" + ] + }, + "mmio_high_granularity_size": { + "description": "BIOS Policy - MMIO High Granularity Size - MMIO High Granularity Size", + "type": "string", + "default": "platform-default", + "enum": [ + "1024G", + "1024g", + "16G", + "16g", + "1G", + "1g", + "256G", + "256g", + "4G", + "4g", + "64G", + "64g", + "Platform Default", + "platform-default" + ] + }, "mraid_link_speed": { "description": "BIOS Policy - PCI Slot LINK Speed - MRAID Link Speed", "type": "string", @@ -4774,6 +5100,21 @@ "platform-default" ] }, + "pcie_ten_bit_tag_support": { + "description": "BIOS Policy - Processor - PCIe Ten Bit Tag Support", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "pciromclp": { "description": "BIOS Policy - PCI ROM CLP - PCIROMCLP", "type": "string", @@ -4826,6 +5167,21 @@ "platform-default" ] }, + "power_down_enable": { + "description": "BIOS Policy - Processor - Power Down Enable", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Disabled", + "Enabled", + "Platform Default", + "auto", + "disabled", + "enabled", + "platform-default" + ] + }, "power_on_password": { "description": "BIOS Policy - PCI Slot LINK Speed - Power On Password", "type": "string", @@ -4839,6 +5195,23 @@ "platform-default" ] }, + "power_profile_selection_f19h": { + "description": "BIOS Policy - Processor - Power Profile Selection F19h", + "type": "string", + "default": "platform-default", + "enum": [ + "Balanced-Memory-Performance-Mode", + "Efficiency-Mode", + "High-Performance-Mode", + "Maximum-IO-Performance-Mode", + "Platform Default", + "balanced-memory-performance-mode", + "efficiency-mode", + "high-performance-mode", + "maximum-io-performance-mode", + "platform-default" + ] + }, "power_technology": { "description": "BIOS Policy - Processor Energy Configuration - Power Technology", "type": "string", @@ -4856,19 +5229,49 @@ "platform-default" ] }, + "preferred_io_7xx2": { + "description": "BIOS Policy - Processor - Preferred IO 7xx2", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Manual", + "Platform Default", + "auto", + "manual", + "platform-default" + ] + }, + "preferred_io_7xx3": { + "description": "BIOS Policy - Processor - Preferred IO 7xx3", + "type": "string", + "default": "platform-default", + "enum": [ + "Auto", + "Bus", + "Platform Default", + "auto", + "bus", + "platform-default" + ] + }, "prmrr_size": { "description": "BIOS Policy - PRMRR Size Configuration - PRMRR Size", "type": "string", "default": "platform-default", "enum": [ "128G", + "128M", "128g", + "128m", "16G", "16g", "1G", "1g", "256G", + "256M", "256g", + "256m", "2G", "2g", "32G", @@ -4876,13 +5279,17 @@ "4G", "4g", "512G", + "512M", "512g", + "512m", "64G", "64g", "8G", "8g", + "Auto", "Invalid-Config.", "Platform Default", + "auto", "invalid-config.", "platform-default" ] @@ -5168,6 +5575,19 @@ "platform-default" ] }, + "re_size_bar_support": { + "description": "BIOS Policy - Resizable Bar Support - Re-Size BAR Support", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "rear_nvme1_link_speed": { "description": "BIOS Policy - PCI Slot LINK Speed - Rear NVME1 Link Speed", "type": "string", @@ -5288,6 +5708,19 @@ "stay-off" ] }, + "runtime_post_package_repair": { + "description": "BIOS Policy - PostPackageRepair - Runtime Post Package Repair", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "sas_raid": { "description": "BIOS Policy - Intel entry SAS RAID module - SAS RAID", "type": "string", @@ -5518,6 +5951,19 @@ "soft-ppr" ] }, + "serial_mux": { + "description": "BIOS Policy - Serial Mux - Serial Mux", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "serial_port_a_enable": { "description": "BIOS Policy - Serial port A enable - Serial port A enable", "type": "string", @@ -5546,14 +5992,22 @@ "platform-default" ] }, + "sev_es_asid_space_limit": { + "description": "BIOS Policy - Processor - SEV-ES ASID Space Limit", + "type": "string", + "default": "platform-default", + "pattern": "platform-default|^[1-9]$|^[1-9][0-9]$|^[1-9][0-9][0-9]$|^100[0-7]$" + }, "sev_snp_support": { "description": "BIOS Policy - Processor - SEV-SNP Support", "type": "string", "default": "platform-default", "enum": [ + "Auto", "Disabled", "Enabled", "Platform Default", + "auto", "disabled", "enabled", "platform-default" @@ -5674,6 +6128,19 @@ "platform-default" ] }, + "sha_384_pcr_bank": { + "description": "BIOS Policy - Trusted Platform Module - SHA 384 PCR Bank", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "sioc1_linkspeed": { "description": "BIOS Policy - PCI Slot Link Speed - SIOC1 LinkSpeed", "type": "string", @@ -6203,6 +6670,19 @@ "platform-default" ] }, + "tdx_secure_arbitration_mode": { + "description": "BIOS Policy - Trust Domain Extension - TDX Secure Arbitration Mode (SEAM) Loader", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "terminal_type": { "description": "BIOS Policy - Console redirection - Terminal type", "type": "string", @@ -6246,6 +6726,19 @@ "platform-default" ] }, + "trust_domain_extension": { + "description": "BIOS Policy - Trust Domain Extension - Trust Domain Extension (TDX)", + "type": "string", + "default": "platform-default", + "enum": [ + "Disabled", + "Enabled", + "Platform Default", + "disabled", + "enabled", + "platform-default" + ] + }, "trusted_execution_technology": { "description": "BIOS Policy - Intel Trusted Execution Technology - Intel Trusted Execution Technology Support", "type": "string", @@ -6308,9 +6801,11 @@ "Disable(All2All)", "Hemisphere(2-clusters)", "Platform Default", + "Quadrant(4-clusters)", "disable(all2all)", "hemisphere(2-clusters)", - "platform-default" + "platform-default", + "quadrant(4-clusters)" ] }, "uncore_frequency_scaling": { @@ -6355,6 +6850,8 @@ "14.4gt-s", "16.0GT-s", "16.0gt-s", + "20.0GT-s", + "20.0gt-s", "9.6GT-s", "9.6gt-s", "Auto", @@ -6590,6 +7087,37 @@ "platform-default" ] }, + "xgmi_force_link_width": { + "description": "BIOS Policy - Processor - xGMI Force Link Width", + "type": "string", + "default": "platform-default", + "enum": [ + "0", + "1", + "2", + "Auto", + "Platform Default", + "auto", + "platform-default" + ] + }, + "xgmi_link_configuration": { + "description": "BIOS Policy - Processor - xGMI Link Configuration", + "type": "string", + "default": "platform-default", + "enum": [ + "2-xGMI-Links", + "2-xgmi-links", + "3-xGMI-Links", + "3-xgmi-links", + "4-xGMI-Links", + "4-xgmi-links", + "Auto", + "Platform Default", + "auto", + "platform-default" + ] + }, "xhci_mode": { "description": "BIOS Policy - USB Configuration - xHCI Mode", "type": "string", diff --git a/schema/ucs/ucsm/easyucs.json b/schema/ucs/ucsm/easyucs.json index b1e2fe7..06ad4b9 100644 --- a/schema/ucs/ucsm/easyucs.json +++ b/schema/ucs/ucsm/easyucs.json @@ -163,8 +163,8 @@ "yes" ] }, - "clear_intersight_claim_status": { - "description": "Clear Intersight Claim Status of UCS device", + "reset_device_connector": { + "description": "Reset Device Connector of UCS device", "type": "string", "default": "no", "enum": [ diff --git a/static/css/base.css b/static/css/base.css index 69f3428..3c214ac 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -313,6 +313,20 @@ a.repoFolderRow { color: inherit; } +div.dataTables_wrapper div.dataTables_filter { + text-align: left !important; +} + +div.dataTables_wrapper div.dataTables_length { + text-align: right !important; +} +.phantomDevice { + filter: opacity(50%) saturate(50%); +} +nav .breadcrumb { + background-color: transparent; +} + @media (min-width: 1800px){ .col-xxl-2 { -webkit-flex: 0 0 16.666667%; @@ -349,3 +363,4 @@ a.repoFolderRow { max-width: 50%; } } + diff --git a/static/js/base.js b/static/js/base.js index 2a1426f..bd7b9f4 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -41,6 +41,30 @@ var selected_objects = { // Task related var displayed_tasks = []; var notifications = 0; +var deviceTasksTable = null; + +var devices_tasks_counts = {}; +function getDeviceTasksCount(device_uuid) { + if (!(device_uuid in devices_tasks_counts)){ + devices_tasks_counts[device_uuid] = 0; + } + return devices_tasks_counts[device_uuid]; +} + +function resetAllDeviceTasksCounts() { + devices_tasks_counts = {}; + $(".device-tasks-counter-badge").text("0"); + $(".device-tasks-counter").hide(); +} + +function incrementDeviceTasksCount(device_uuid) { + let new_value = getDeviceTasksCount(device_uuid) + 1; + devices_tasks_counts[device_uuid] = new_value; + let counter = $(".device-tasks-counter." + device_uuid); + let badge = counter.find(".device-tasks-counter-badge"); + badge.text(new_value); + counter.show(); +} // Logs related var display_logs_bool = false; @@ -53,7 +77,7 @@ var log_level = "debug"; $(document).ready(function() { $("body").tooltip({ selector: '[data-toggle=tooltip]' }); - getFromDb(displayNotifications,"notification"); + // getFromDb(displayNotifications,"notification"); getFromDb(processSavedSessionLogs, "log"); getDevicesTypesInfo(function (device_types){ saveDevicesTypesInfo(device_types); @@ -114,7 +138,6 @@ function addTaskNotification(){ document.getElementById("new-task-badge").textContent = notifications; // Updates the tasks display - console.log("Updating tasks display"); getFromDb(displayTasks, "task"); } @@ -124,7 +147,8 @@ function addTaskNotification(){ */ function alertActionStarted(action_type_message){ displayAlert("Action started", action_type_message, "success"); - addTaskNotification(); + getTasksFromDb(); +// addTaskNotification(); } /** @@ -133,7 +157,8 @@ function alertActionStarted(action_type_message){ */ function alertObjectFetched(object_type){ displayAlert("Fetching task started", "Fetching "+ object_type, "success"); - addTaskNotification(); +// addTaskNotification(); + getTasksFromDb(); } /** @@ -142,7 +167,8 @@ function alertObjectFetched(object_type){ */ function alertObjectPushed(object_type){ displayAlert("Pushing task started", "Pushing " + object_type + " file to device", "success"); - addTaskNotification(); + getTasksFromDb(); +// addTaskNotification(); } @@ -258,6 +284,9 @@ function createDataTable(tableId, order_column, date_column){ } var dataTable = $(tableId).DataTable({ + "dom": "<'row'<'col-sm-12 text-start col-md-6'f><'col-sm-12 text-end col-md-6'l>>" + + "<'row'<'col-sm-12'tr>>" + + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", "responsive": true, "lengthChange": true, "autoWidth": false, "paging": true, "orderClasses": false, @@ -511,6 +540,65 @@ function displayNotifications(data){ document.getElementById("new-task-badge").textContent = notifications; } + +function tableFromTasks(task_list, taskTable, device_column = true) { + // For each task, we create the specific row in the DataTable + task_list.map( task => { + var text_color = "text-dark"; + var status_title = "In progress"; + var status_message = ``; + var on_click = `window.location='/task/${task.uuid}';`; + var text_color = "text-dark"; + var status_title = "In progress"; + var status_message = ``; + var on_click = `window.location='/task/${task.uuid}';`; + + + if ( task.status == "pending" ) { + var task_timestamp = "To be started"; + } else { + var task_timestamp = moment(task.timestamp_start); + } + + + if(task.status == "in_progress"){ + status_title = "In progress"; + status_message = ` +
+
+
+ `; + } else { + status_message = task.status_message; + if (task.status == "successful"){ + text_color = "text-success"; + status_title = "Successful"; + } else if (task.status == "pending"){ + text_color = "text-info"; + status_title = "Pending"; + status_message = "Task in queue"; + on_click = ""; + } else { + text_color = "text-danger"; + status_title = "Failed"; + } + } + device_column_content = device_column ? `${task.device_name}` : ""; + taskTable.row.add($(` + + ${task.uuid} + ${status_title} + ${task.description} + ${task.timestamp} + ${status_message} + ${task_timestamp} + ${device_column_content} + `)).draw(); + }); + // Hides the checkbox column + taskTable.column(0).visible(false); +} + /** * Displays the tasks in the UI * @param {JSON} data - The data returned when getting the tasks from the API @@ -553,17 +641,28 @@ function displayTasks(data){ var in_progress_tasks = []; var finished_tasks = []; var pending_tasks = []; - + resetAllDeviceTasksCounts(); // Stores the tasks finished and in progress in two different arrays loaded_tasks.map( task => { if(task.status == "in_progress"){ + incrementDeviceTasksCount(task.device_uuid); in_progress_tasks.push(task); } else if (task.status == "pending"){ + incrementDeviceTasksCount(task.device_uuid); pending_tasks.push(task); } else { finished_tasks.push(task); } }); + // Display in progress and pending tasks count in the navbar tasks badge + let tasksCount = in_progress_tasks.length + pending_tasks.length; + if (tasksCount > 0){ + $("#tasks-complete-badge").hide(); + $("#task-count-badge").text(tasksCount); + } else { + $("#tasks-complete-badge").show(); + $("#task-count-badge").text(""); + } // Puts the tasks in progress first in the list of tasks loaded_tasks = []; @@ -580,8 +679,16 @@ function displayTasks(data){ $("#tasksPendingContainer").removeClass("d-flex"); $("#tasksPendingContainer").addClass("d-none"); } - - // Only displays the first 10 tasks + // Display device specific tasks if we are on the device page + if (typeof current_device_uuid !== 'undefined') { + let device_specific_tasks = loaded_tasks.filter(task => task.device_uuid == current_device_uuid); + if (deviceTasksTable == null) { + deviceTasksTable = createDataTable("#tasksTable", 3, 3); + } + deviceTasksTable.clear().draw(); + tableFromTasks(device_specific_tasks, deviceTasksTable, device_column = false); + } + // Only displays the first 10 tasks in the navbar tasks dropbdown if(allTasksNumber > 10){ loaded_tasks = loaded_tasks.slice(0, 10) } @@ -654,7 +761,7 @@ function displayTasks(data){ ` - }) + }); } /** @@ -1054,10 +1161,11 @@ function handleCheckboxClick(tableId, cb){ /** * Handles the HTTP response returned by a query - * @param {Function} callback - Optional: The function to execute while the call has returned + * @param {Function} success_callback - Optional: The function to execute while the call has returned successfully * @param {DOMString} received_http_response - The HTTP response returned by the query + * @param {Function} error_callback - Optional: The function to execute while the call has returned an error */ -function handleHttpResponse(callback, received_http_response){ +function handleHttpResponse(success_callback, received_http_response, error_callback=null){ supported_error_status_codes = [400, 404, 500]; if(!received_http_response){ @@ -1071,8 +1179,8 @@ function handleHttpResponse(callback, received_http_response){ if(received_http_response.status == 200){ // Executes the callback function if specified - if(callback){ - callback(received_http_response.responseText); + if(success_callback){ + success_callback(received_http_response.responseText); } } else { // If the returned code is supported by EasyUCS, we return the associated error message @@ -1083,6 +1191,9 @@ function handleHttpResponse(callback, received_http_response){ } else { displayAlert(received_http_response.statusText); } + if (error_callback){ + error_callback(received_http_response.responseText); + } // We refresh the data on the page since we got an error // refreshData(); // Todo: handle the error in a more user-friendly way @@ -1094,11 +1205,12 @@ function handleHttpResponse(callback, received_http_response){ * Handles the HTTP response returned by a query * @param {String} request_type - The request type to be performed {GET/PUT/POST/DELETE} * @param {String} theUrl - URL on which to execute the request - * @param {Function} callback - Optional: The function to execute while the call has returned + * @param {Function} success_callback - Optional: The function to execute while the call has returned successfully * @param {FormData|JSON} payload - Optional: The payload to pass to the request * @param {Object} url_params - Optional: A dictionary where keys are the parameter names and values are their values + * @param {Function} error_callback - Optional: The function to execute while the call has returned an error */ -function httpRequestAsync(request_type = null, theUrl = null, callback = null, payload = null, url_params = null){ +function httpRequestAsync(request_type = null, theUrl = null, success_callback = null, payload = null, url_params = null, error_callback = null){ var allowed_request_types = ["GET", "PUT", "POST", "DELETE"] if(!request_type){ @@ -1122,7 +1234,7 @@ function httpRequestAsync(request_type = null, theUrl = null, callback = null, p // Gets executed when a response to the request has been received xmlHttp.onreadystatechange = function() { - handleHttpResponse(callback, xmlHttp); + handleHttpResponse(success_callback, xmlHttp, error_callback); } if(url_params && Object.keys(url_params).length > 0){ @@ -1311,7 +1423,7 @@ function pushToDb(callback = null, object_type = null, device_uuid = null, paylo // Builds the API Endpoint and the file type based on the object type if(object_type == "device"){ - httpRequestAsync("POST", target_api_endpoint, callback, payload); + httpRequestAsync("POST", target_api_endpoint, callback, payload, null, callback); return }else if(object_type == "config"){ target_api_endpoint+= "/" + device_uuid + api_config_endpoint; diff --git a/static/js/contact.js b/static/js/contact.js index 87940dd..1895771 100644 --- a/static/js/contact.js +++ b/static/js/contact.js @@ -9,6 +9,7 @@ All functions present here are solely used on the contact.html page */ function afterDOMloaded(){ + document.getElementById("navLinkContact").className += " active"; } diff --git a/static/js/device.js b/static/js/device.js index 04344ee..de1499a 100644 --- a/static/js/device.js +++ b/static/js/device.js @@ -87,19 +87,19 @@ function claimToIntersight(){ } /** - * Clears the Intersight Claim Status of the device + * Resets the Device Connector of the device */ -function clearIntersightClaimStatus(){ +function ResetDeviceConnector(){ // The function gets executed only if the user confirms the warning Swal.fire({ - title: "Clearing Intersight Claim Status is an irreversible action. Do you wish to proceed?", + title: "Resetting Device Connector is an irreversible action. Do you wish to proceed?", showDenyButton: true, confirmButtonText: `Yes`, denyButtonText: `No`, }).then((result) => { if (result.isConfirmed) { - const target_api_endpoint = api_base_url + api_device_endpoint + "/" + current_device_uuid + "/actions/clear_intersight_claim_status"; - const action_type_message = "Clear Intersight Claim Status"; + const target_api_endpoint = api_base_url + api_device_endpoint + "/" + current_device_uuid + "/actions/reset_device_connector"; + const action_type_message = "Reset Device Connector"; httpRequestAsync("POST", target_api_endpoint, alertActionStarted.bind(null, action_type_message)); } }); @@ -322,7 +322,7 @@ function displayDevice(data){ device_version = current_device.device_version; } var username_element = ` -
+
Username:
@@ -333,7 +333,7 @@ function displayDevice(data){ // Changes the style of the card based on the type of device if(current_device.device_type == "intersight"){ username_element = ` -
+
Key ID:
@@ -343,18 +343,20 @@ function displayDevice(data){ avatar_src = "/static/img/intersight_logo.png"; color = "bg-info"; enableClearConfig(); + $("#action-generate-report").hide(); + $("#report-separator").hide(); } else if (current_device.device_type == "ucsm"){ avatar_src = "/static/img/ucsm_logo.png"; color = "bg-primary"; enableClaimToIntersight(); - enableClearIntersightClaimStatus(); + enableResetDeviceConnector(); enableClearSelLogs(); enableRegenerateCertificate(); } else if (current_device.device_type == "cimc"){ avatar_src = "/static/img/cimc_logo.png"; color = "bg-warning"; enableClaimToIntersight(); - enableClearIntersightClaimStatus(); + enableResetDeviceConnector(); enableClearSelLogs(); enableRegenerateCertificate(); } else if (current_device.device_type == "ucsc"){ @@ -405,6 +407,7 @@ function displayDevice(data){
${current_device.device_type_long}
+

${current_device.user_label ? current_device.user_label : ""}

@@ -426,7 +429,7 @@ function displayDevice(data){ '; + let output = ''; const folders = current_path.split('/').filter(e => e !== ''); folders.forEach((folder, index) => { const current_folder = folders.slice(0, index+1).join('/') @@ -433,7 +437,7 @@ function copyInputValue(input) { function computeChecksums(filename) { let target_api_endpoint = api_base_url + api_repo_checksum_endpoint; target_api_endpoint += encodeURIComponent(current_path + filename); - httpRequestAsync("POST", target_api_endpoint, (e) => trackTask(JSON.parse(e).task, "Computing checksums for " + escapeHtml(filename))); + httpRequestAsync("POST", target_api_endpoint, (e) => trackTask(JSON.parse(e).task, "Computing checksums for " + filename)); $("#checksumsModal").modal("toggle"); } diff --git a/static/js/task.js b/static/js/task.js index 4467856..ec3f7b7 100644 --- a/static/js/task.js +++ b/static/js/task.js @@ -8,6 +8,7 @@ NOTE: task.html represents the detailed view for a single task, containing the d // Global variables var loaded_task = null; +var loaded_device = null; var task_uuid = null; // Gets executed when DOM has loaded @@ -29,25 +30,41 @@ window.setInterval(function() { } }, 5000); -/** - * Displays a task in the UI - * @param {JSON} data - The data returned by getting the task from the API - */ -function displayTask(data){ +function loadTaskData(data) { if(!data){ console.error('No data to display!') return } - data = JSON.parse(data) - if(!data["task"]){ console.error("Impossible to display task no data provided"); return } + loaded_task = data["task"]; + getFromDb(loadDeviceData, "device", null, loaded_task.device_uuid); +} + +function loadDeviceData(data) { + if(!data){ + console.error('No data to display!') + return + } + data = JSON.parse(data) + if(!data["device"]){ + console.error("Impossible to display task no data provided"); + return + } + loaded_device = data["device"]; + displayTask(); + displayDevice(); +} - loaded_task = data["task"]; +/** + * Displays a task in the UI + */ +function displayTask(){ + document.getElementById('TaskCardContainer').innerHTML = `` document.getElementById('taskDisplayContainer').innerHTML = `` @@ -100,12 +117,11 @@ function displayTask(data){ ${cancel_task}
- ` - + `; + // Takes the steps from the task steps = loaded_task.steps - if(loaded_task.status != "in_progress"){ document.getElementById('taskDisplayContainer').innerHTML = `
@@ -113,7 +129,6 @@ function displayTask(data){
` } - // For each step, populates the task display container with the step's UI elements steps.map(step => { var step_status = ""; @@ -161,11 +176,6 @@ function displayTask(data){
`; }); - - - - - // Populates the task display container with the task UI elements document.getElementById('taskDisplayContainer').innerHTML += ` @@ -176,16 +186,58 @@ function displayTask(data){ ` } -/** - * Gets a task from the API - */ -function getTask(){ - getFromDb(displayTask, "task", null, task_uuid); +function displayDevice(){ + let avatar_src = ""; + // Changes the style of the card based on the type of device + if(loaded_device.device_type == "intersight"){ + username_element = ` +
+ Key ID: +
+
+ ${loaded_device.key_id} +
+ `; + avatar_src = "/static/img/intersight_logo.png"; + color = "bg-info"; + } else if (loaded_device.device_type == "ucsm"){ + avatar_src = "/static/img/ucsm_logo.png"; + color = "bg-primary"; + } else if (loaded_device.device_type == "cimc"){ + avatar_src = "/static/img/cimc_logo.png"; + color = "bg-warning"; + } else if (loaded_device.device_type == "ucsc"){ + avatar_src = "/static/img/ucsc_logo.png"; + color = "bg-dark"; + } + + document.getElementById('DeviceCardContainer').innerHTML = ` + + +
`; } /** * Refreshes dynamic data on the page */ function refreshData(){ - getTask(); + getFromDb(loadTaskData, "task", null, task_uuid); } \ No newline at end of file diff --git a/static/js/tasks.js b/static/js/tasks.js index 9a02df3..961fcd5 100644 --- a/static/js/tasks.js +++ b/static/js/tasks.js @@ -30,60 +30,8 @@ function displayPageTasks(task_list){ // Clean table before new entries taskTable.clear().draw(); - - // For each task, we create the specific row in the DataTable - loaded_tasks.map( task => { - var text_color = "text-dark"; - var status_title = "In progress"; - var status_message = ``; - var on_click = `window.location='/task/${task.uuid}';`; - - - if ( task.status == "pending" ) { - var task_timestamp = "To be started"; - } else { - var task_timestamp = moment(task.timestamp_start); - } - - - if(task.status == "in_progress"){ - status_title = "In progress"; - status_message = ` -
-
-
- `; - } else { - status_message = task.status_message; - if (task.status == "successful"){ - text_color = "text-success"; - status_title = "Successful"; - } else if (task.status == "pending"){ - text_color = "text-info"; - status_title = "Pending"; - status_message = "Task in queue"; - on_click = ""; - } else { - text_color = "text-danger"; - status_title = "Failed"; - } - } - - - taskTable.row.add($(` - - ${task.uuid} - ${status_title} - ${task.description} - ${task.timestamp} - ${status_message} - ${task_timestamp} - ${task.device_name} - `)).draw(); - }); - - // Hides the checkbox column - taskTable.column(0).visible(false); + tableFromTasks(task_list, taskTable); + } /** diff --git a/task/task_library.json b/task/task_library.json index 682168d..1bde01b 100644 --- a/task/task_library.json +++ b/task/task_library.json @@ -136,50 +136,6 @@ } ] }, - "ClearIntersightClaimStatusUcsImc": { - "description": "Clear UCS IMC Intersight Claim Status", - "device_type": "cimc", - "steps": [ - { - "name": "ConnectUcsImcDevice", - "order": 1, - "weight": 1 - }, - { - "name": "ClearIntersightClaimStatus", - "order": 2, - "weight": 1 - }, - { - "name": "DisconnectUcsImcDevice", - "optional": true, - "order": 3, - "weight": 1 - } - ] - }, - "ClearIntersightClaimStatusUcsSystem": { - "description": "Clear UCS System Intersight Claim Status", - "device_type": "ucsm", - "steps": [ - { - "name": "ConnectUcsSystemDevice", - "order": 1, - "weight": 1 - }, - { - "name": "ClearIntersightClaimStatus", - "order": 2, - "weight": 1 - }, - { - "name": "DisconnectUcsSystemDevice", - "optional": true, - "order": 3, - "weight": 1 - } - ] - }, "ClearSelLogsUcsImc": { "description": "Clear UCS IMC SEL Logs", "device_type": "cimc", @@ -804,7 +760,7 @@ "weight": 1 }, { - "name": "ClearIntersightClaimStatus", + "name": "ResetDeviceConnector", "optional": true, "order": 2, "weight": 1 @@ -987,6 +943,50 @@ } ] }, + "ResetDeviceConnectorUcsImc": { + "description": "Reset UCS IMC Device Connector", + "device_type": "cimc", + "steps": [ + { + "name": "ConnectUcsImcDevice", + "order": 1, + "weight": 1 + }, + { + "name": "ResetDeviceConnector", + "order": 2, + "weight": 1 + }, + { + "name": "DisconnectUcsImcDevice", + "optional": true, + "order": 3, + "weight": 1 + } + ] + }, + "ResetDeviceConnectorUcsSystem": { + "description": "Reset UCS System Device Connector", + "device_type": "ucsm", + "steps": [ + { + "name": "ConnectUcsSystemDevice", + "order": 1, + "weight": 1 + }, + { + "name": "ResetDeviceConnector", + "order": 2, + "weight": 1 + }, + { + "name": "DisconnectUcsSystemDevice", + "optional": true, + "order": 3, + "weight": 1 + } + ] + }, "ResetDeviceUcsImc": { "description": "Reset UCS IMC device", "device_type": "ucsm", @@ -997,7 +997,7 @@ "weight": 1 }, { - "name": "ClearIntersightClaimStatus", + "name": "ResetDeviceConnector", "optional": true, "order": 2, "weight": 1 @@ -1025,7 +1025,7 @@ "weight": 1 }, { - "name": "ClearIntersightClaimStatus", + "name": "ResetDeviceConnector", "optional": true, "order": 2, "weight": 1 diff --git a/templates/html/404.html b/templates/html/404.html index 30e2742..2d10480 100644 --- a/templates/html/404.html +++ b/templates/html/404.html @@ -1,5 +1,12 @@ {% extends "/html/base.html" %} +{% block breadcrumbs %} + +{% endblock %} + {% block content %}
@@ -8,12 +15,6 @@

404 Error Page

-
- -
diff --git a/templates/html/base.html b/templates/html/base.html index f98b410..7f432eb 100644 --- a/templates/html/base.html +++ b/templates/html/base.html @@ -36,13 +36,10 @@ - - + {% block breadcrumbs %} + {% endblock %} +