openmainframeproject / feilong

Feilong is a open source z/VM cloud connector project under the Open Mainframe Project umbrella that will accelerate the z/VM adoption, extending its ecosystem and its user experience. It provides a set of APIs to operate z/VM including guest, image, network, volume etc.
https://www.openmainframeproject.org/projects/feilong
Apache License 2.0
35 stars 70 forks source link

move the check of pchids_info to later stage after FCP multipath template is set #752

Closed dongyanyang closed 12 months ago

dongyanyang commented 12 months ago

Before this fix, when calling the get_volume_connector: if

  1. fcp_multipath_template is not specified which means to use default template, and
  2. some PCHID info is not contained in the pchid_info

Then the following keyerror would be reported: Failed to reserve FCP devices for assigner xj00000e by FCP Multipath Template aee11840-5185-11ee-b8ec-02010d42ff55 error: Database operation failed, error: Execute SQL statements error: '0240'

This fix makes the following changes:

  1. the check of pchids_info to a later stage after the FCP multipath template is selected based on the default rule.
  2. Enhance the error msg, avoid printing the whole pchids_info as it will contain all the PCHIDs info of the CPC which can be very long string.
dongyanyang commented 12 months ago

The error msg reported after this fix:

Failed to get volume connector of DYDS000d: 'The PCHIDs configured in the FCP multipath template (id=5aa0ff76-52d3-11ee-ab22-02010d08986a) are ['0240', '0260'], but the statistics of PCHIDs ['0260'] are missing.'", 'output': ''}.
dongyanyang commented 12 months ago

@jackydalong please help to review.