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

Privilege class B is needed to use fiber channel volumes #803

Open Bischoff opened 7 months ago

Bischoff commented 7 months ago

The problem

When trying to use "Attach Volume" Feilong API call (https://cloudlib4zvm.readthedocs.io/en/latest/restapi.html#attach-volume) one gets an error message like:

{HTTP status: 404, body: {"overallRC": 404, "modID": 30, "rc": 404, "rs": 1, "errmsg":
 "FCP with id: fc04 does not exist.", "output": ""}

After debugging, it appears it is because the information about the FCP device was not stored in the database at the startup of zvmsdk. This is turn is caused by:

[2024-01-17 16:56:18] [ERROR] Failed to get PCHID for the CHPID '60' with command
 '['sudo', '/sbin/vmcp', 'query chpid', '60', 'pchid']'. Check the z/VM userid 'FEILONG' on the z/VM
  'S390ZL0C' is authorized to run the CP command: 'QUERY CHPID yy PCHID'. 

The solutions

The remediation is to add privilege class B to the ZVM connector VM (Feilong).

Ideally, Feilong should use something else than vmcp query chpid XX pchid to query zVM, because this command requires class B.

If that is not technically possible, the issue should at least be documented in Feilong's documentation. I suggest adding:

6. Add privilege class B

If you are planning to use Fiber Channel volumes, you need to add privilege class B to your BYOL:

replace G with BG at the end of the first definition line (starting with USER).

to section 3.1.1. Preparation on BYOL (https://cloudlib4zvm.readthedocs.io/en/latest/quickstart.html#preparation-on-byol), and changing final note:

Note Preparation step 2 and step 3 require to logoff then re-logon the BYOL to make
the updates become effective.

to:

Note Preparation step 2 , step 3, and step 6 require to logoff then re-logon the BYOL to make
the updates become effective.
bjhuangr commented 7 months ago

@dongyanyang any comments on this? Thanks