Skip to content

Add vmcp command - #958

Open
kunal-naik wants to merge 1 commit into
openmainframeproject:masterfrom
kunal-naik:vmcp_command_network
Open

kunal-naik wants to merge 1 commit into
openmainframeproject:masterfrom
kunal-naik:vmcp_command_network

Conversation

@kunal-naik

@kunal-naik kunal-naik commented Aug 6, 2026 •

Copy link
Copy Markdown

PR Description:

Implemented VMCP as the preferred method for detaching and uncoupling a NIC from a running guest, providing vmcp-based alternatives to the existing smcli SMAPI calls. Both operations are handled exclusively within smtclient.py, replacing the Virtual_Network_Adapter_Delete and Virtual_Network_Adapter_Disconnect SMAPI calls.

When use_smapi option is disabled (False), the NIC delete and NIC disconnect operations are dispatched through VMCPHandler using the CP FOR userid CMD mechanism instead of the corresponding SMAPI calls.

Other Implementation in this PR:

Command 1: Virtual_Network_Adapter_Delete

SMCLI: smcli Virtual_Network_Adapter_Delete -v VDEV
Equivalent VMCP: vmcp "FOR USERID CMD DETACH NIC VDEV"

Usage:
Implemented vmcp equivalent for the function that used Virtual_Network_Adapter_Delete.

  • Smtclient file uses this to detach a NIC from the active guest configuration in the network adapter delete flow.
  • Before the detach, vmcp "QUERY NIC USERID USERID VDEV" checks that the NIC exists and the detach is skipped if CP reports the NIC as not found.

Command 2: Virtual_Network_Adapter_Disconnect

SMCLI: smcli Virtual_Network_Adapter_Disconnect -v VDEV
Equivalent VMCP: vmcp "FOR USERID CMD UNCOUPLE VDEV"

Usage:
Implemented vmcp equivalent for the function that used Virtual_Network_Adapter_Disconnect.

  • smtclient file uses this to uncouple a NIC from its vswitch on the active guest configuration in the network adapter disconnect flow.
  • Before the uncouple, vmcp "QUERY NIC USERID USERID VDEV" checks that the NIC exists (an error is returned if it is not found) and vmcp "QUERY VSWITCH ALL DETAILS USERID USERID" checks that it is coupled to a vswitch (the uncouple is skipped if it is already uncoupled); after the uncouple, the vswitch query is run again to confirm that the NIC is no longer coupled.

@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch from e233ad5 to dbb35bb Compare August 10, 2026 08:25
@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch 15 times, most recently from 3da2a3c to 67eab65 Compare October 16, 2026 03:40
@Rajat-0
Rajat-0 requested a review from Bischoff October 21, 2026 06:19
@Rajat-0

Rajat-0 commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

What the PR is trying to do is sensible: add a VMCP-based alternative for active NIC detach/uncouple paths and switch to it when the config says not to use SMAPI. The problem is the implementation is incomplete in a couple of important ways.

The new VMCP path does not actually fail closed. In zvmsdk/smtclient.py, the active delete/uncouple branches do:
    call the VMCP handler
    ignore the returned status
    then continue to log success unconditionally This is a real bug because the VMCP calls can return non-zero RCs, and the code never maps those to the existing SDK exceptions (_delete_nic_active_exception, _uncouple_active_exception, etc.). That means a failed VMCP command can be treated as a successful NIC operation, which is dangerous and can leave the guest/network state inconsistent.

The config gate is inconsistent and appears undefined. The PR description mentions a prefer_vmcp_query flag, but the code checks config.CONF.zvm.use_smapi. I don’t see either key defined anywhere in the repo, so this feature likely won’t be configurable as documented. If that attribute is missing at runtime, this will explode with an attribute lookup error; if it is added elsewhere, it still creates a mismatch between the intended API and the actual implementation.

I’d call out these as blocking issues before merge:

VMCP errors are ignored instead of surfaced/translated
the feature flag is not wired consistently and may be undefined

The general direction is good, but the implementation should either:

validate the VMCP result and raise the same SDK errors as the SMAPI path, or
explicitly choose a single config key and make sure it is actually defined and tested

@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch from 67eab65 to fe096f6 Compare October 22, 2026 10:11
@kunal-naik

Copy link
Copy Markdown
Author

VMCP results are validated and raise the same SDK errors as the SMAPI path.

Config registration is tracked in a separate PR - #954.

@Bischoff Bischoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eric

Thanks as usual for the PR.

I see no doc nor unit tests.

Claude, prompted by Eric

I reviewed the current head of the branch (fe096f6).

Thanks for having checked the VMCP return codes since Rajat's review.

Points common to the whole VMCP series

For the problems of the shared vmcpHandler.py, of the single option name, and of CP privilege classes, please see my review of #954.

Points specific to this PR:

  1. Bug: possible race condition

As in #956, SMTClient.__init__() creates a single shared ReqHandle, with the same concurrency issues; please see my review of #956 for a way to fix that.

  1. Inconsistency with SMAPI: tolerated errors are now failures

On the SMAPI path, delete_nic() only logs a warning when the NIC does not exist on the active system (rc 204 / rs 8), and uncouple_nic() when the NIC is already disconnected (rc 204 / rs 48).

On the VMCP path, any failure of FOR <userid> CMD DETACH NIC or UNCOUPLE raises SDKConflictError.

For delete_nic(), the switch table record has already been deleted at that point, so the caller gets an error while the database is already updated. I suggest recognizing the equivalent CP messages and handling them like the SMAPI path.

  1. Inconsistency with SMAPI: error mapping

The SMAPI path uses _delete_nic_active_exception() and _uncouple_active_exception(), which distinguish conflicts (rs 28) from other errors. The VMCP path always raises SDKConflictError, so callers get different exceptions depending on the option.

  1. Unit tests

There are no tests for delete_nic_for_guest(), uncouple_nic_for_guest() and the new branches.

Without #954, the existing test_delete_nic and test_uncouple_nic fail with AttributeError: 'CONF' object has no attribute 'use_smapi'.

  1. Documentation

Nothing documents that the NIC detach and uncouple on an active guest go through VMCP when the option is disabled, nor the privilege classes needed by FOR ... CMD.

@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch 4 times, most recently from 8b9db0b to 033745d Compare October 29, 2026 09:07
@kunal-naik

Copy link
Copy Markdown
Author

@Bischoff Thanks for the detailed review.

All points addressed:

  1. Race condition: fresh ReqHandle created per call, no shared instance.
  2. Tolerated errors: HCPNIC040E → LOG.warning (mirrors SMAPI rc=204/rs=8); HCPCPL2791E → LOG.warning (mirrors rc=204/rs=48); HCPCPL040E → SDKObjectNotExistError (mirrors rc=204/rs=8 in _uncouple_active_exception).
  3. Error mapping: VMCP else-branch raises SDKConflictError matching the rs=28 path; HCPCPL040E raises SDKObjectNotExistError matching rs=8.
  4. Unit tests: added tests for delete_nic_for_guest(), uncouple_nic_for_guest(), and all new VMCP branches in smtclient.
  5. use_smapi AttributeError: resolved by Introduced VMCP configuration in the zvmsdk file for the VMCP query execution #954 (already merged into this branch).
  6. Documentation: quickstart.rst step 7 now lists FOR userid CMD UNCOUPLE and FOR userid CMD DETACH NIC with class C, G.

@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch from 033745d to b501b4d Compare October 29, 2026 09:59
@Bischoff
Bischoff self-requested a review October 29, 2026 10:31

@Bischoff Bischoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude, prompted by Eric

I reviewed the current head of the branch (b501b4d). Thank you Kunal for this thorough update.

Solved issues

  1. Shared ReqHandle: a fresh ReqHandle is now created per call.
  2. Tolerated errors: HCPNIC040E on detach and HCPCPL2791E on uncouple now only log a warning, like the SMAPI path.
  3. Error mapping: SDKConflictError rs 8 / rs 12 and SDKObjectNotExistError now mirror _delete_nic_active_exception() and _uncouple_active_exception().
  4. Unit tests: the new tests cover delete_nic_for_guest(), uncouple_nic_for_guest() and the new branches of SMTClient; all unit tests pass (zvmsdk 1083, smtLayer 108).
  5. Merging master brought no regression: no test and no function from master was lost.

Remaining points

  1. Style

    tox -e pep8 fails:

    • zvmsdk/smtclient.py:53: F811, ReqHandle (and vmcpHandler) are already imported a few lines above since master brought them; the existing VMCPHandler(rh) import can be
      reused;
    • smtLayer/vmcpHandler.py:147: E303, one blank line too many after _run_for().
  2. Return code of FOR ... CMD

    The error handling in SMTClient.delete_nic() and _uncouple_nic() relies on vmcp exiting with a non-zero code when the inner command fails. The test data contain HCPFOR069I Command Complete. CP return code = 0040, which suggests that FOR itself may complete while reporting the inner return code. Could you confirm how vmcp behaves in that case, and
    attach real outputs for a successful detach and uncouple, a non-existent NIC (for both commands) and an already uncoupled NIC? That would also confirm the HCPNIC040E,
    HCPCPL040E and HCPCPL2791E message ids.

  3. Overlap with #957

    #957 adds a nearly identical VMCPHandler._run_for() and also edits step 7 of quickstart.rst (its title becomes "A, B and C"). The two branches conflict on both files.
    Whichever is merged second will need a careful conflict resolution, keeping a single _run_for().

  4. Documentation

    Thanks for the two rows in doc/source/quickstart.rst. Two small additions would complete it:

    • the title of step 7 still says "A and B" while this PR needs class C (see point 3);
    • the help of the use_smapi option in zvmsdk/config.py mentions only power operations; it would be nice to mention the NIC detach and uncouple on an active guest too (and to regenerate doc/source/zvmsdk.conf.sample).

@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch from b501b4d to cc02893 Compare October 29, 2026 10:35
This was referenced Oct 29, 2026
@kunal-naik
kunal-naik force-pushed the vmcp_command_network branch 7 times, most recently from d972e92 to dbf19f2 Compare October 30, 2026 09:34
@Rajat-0

Rajat-0 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Open

1.	Every vmcp failure turns into a 409. On the SMAPI path, only rc=204/rs=28 becomes SDKConflictError; anything else is re-raised as SDKSMTRequestFailed, which is a 500. The vmcp else: branches raise SDKConflictError for every failure, including "FOR not authorized", "guest not logged on" and an exception inside the handler. Callers that retry on 409 or treat it as a state conflict will act differently depending on use_smapi. Suggest using SDKConflictError only for the conflict case and SDKSMTRequestFailed (or SDKInternalError) for the rest.
2.	The CP message IDs in the code don't seem to come from real z/VM output. The code tolerates HCPNIC040E and HCPCPL2791E and maps HCPCPL040E. The test fixtures use invented text ("HCPNIC040E No virtual NIC 1000"). The message prefix depends on which CP module answers, and getting it wrong is costly: an "already gone" detach would fail with a 409 instead of a warning. Ask for real output from FOR <id> CMD DETACH NIC <bad vdev> and FOR <id> CMD UNCOUPLE <uncoupled vdev>. Matching only the message number, e.g. HCP\w{3}040E as check_userid_exist does, would be safer.
3.	The use_smapi help text claims more than exists. It now says vmcp is also used for "FCP WWPN query" and "disk link on an active guest". Neither is on master or in this PR; the only use_smapi checks are in power, deleteVM, getHost and these two NIC paths. Drop those lines until the code for them lands.
4.	Minor:
•	_run_for reports failures with message 0405 ("Unable to obtain information related to…"), which reads oddly for a detach or uncouple.

@Bischoff
Bischoff self-requested a review October 30, 2026 13:04
@kunal-naik

kunal-naik commented Nov 16, 2026 •

Copy link
Copy Markdown
Author

@Bischoff @Rajat-0 Thanks for the detailed reviews. Updated and rebased on current master.

  • CP message IDs removed: the HCPNIC040E / HCPCPL040E / HCPCPL2791E / HCPDTV040E checks and the test fixtures that used them are removed. vmcp does not return the result of the command run through "FOR CMD ": it can exit with rc 0 and no output when the inner command failed, so the inner messages cannot be relied on. IBM documents that some vmcp commands do not return their messages through diagnose X'08':
    https://www.ibm.com/docs/en/linux-on-systems?topic=zcidd-what-you-should-know
  • The code now matches only the replies of the two QUERY pre-checks (separate vmcp calls, not inner replies):
    HCPNIC2836E for a missing NIC (QUERY NIC USERID) and HCPSWQ2836E for a guest with no adapter on any vswitch
    (QUERY VSWITCH ... USERID, reported as already uncoupled, like the SMAPI 204/48 case).
  • Race condition: fresh ReqHandle per call. Unit tests cover delete_nic_for_guest(), uncouple_nic_for_guest() and the
    VMCP branches in smtclient. use_smapi is defined by Introduced VMCP configuration in the zvmsdk file for the VMCP query execution #954. quickstart.rst step 7 lists the new commands and classes.
  • flake8 is clean on the changed files.

Known limitation and follow-up:
Because the result of the inner FOR command is not visible and every vmcp failure still raises SDKConflictError (409) instead of the finer SMAPI mapping, we will raised an issue to handle failures of the inner FOR command better - #993

@Bischoff Bischoff left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eric

I was not sure I was requested to proofread this one, but your comment started with "@Bischoff @Rajat-0", so I did it after all.

I saw nothing with a quick human glance, so I offloaded the details to Claude. It found a possible inconsistency with the database, so I requested changes.

Claude, prompted by Eric

I reviewed the current head of the branch (ca1841f). Thank you Kunal for this rework and for opening #993. The PR now checks that the NIC exists, and whether it is coupled, before it runs FOR ... CMD DETACH NIC and FOR ... CMD UNCOUPLE. The guessed CP message ids are gone. The PR also reuses VMCPHandler._run_for() from master.

Checks

After the rebase on master (cae3071), nothing was lost. All the files of the previous diff (b501b4d) are still there. No function or test of master disappeared. _run_for(), the imports and the two quickstart.rst rows were dropped from the PR because they are now on master. The three removed tests (*_hcpnic040e_*, *_hcpcpl040e_*, *_hcpcpl2791e_*) belonged to the message ids you removed on purpose.

tox -e pep8 passes. Unit tests, Python 3.13: master gives 1106 (zvmsdk) and 197 (smtLayer), all passing. With the PR: 1113 and 211, all passing, no new failure.

No test on a real z/VM.

Previous remarks

Remark Status
Eric, 26/10: no documentation, no unit tests Fixed
Eric, 26/10, common to the series (#954): shared handler, one option name, privilege classes Fixed on master: single use_smapi option, privilege table in quickstart.rst
Eric, 26/10, 1: shared ReqHandle Fixed: one ReqHandle per call
Eric, 26/10, 2: tolerated errors become failures Fixed with pre-checks: an absent NIC on detach and an uncoupled NIC on uncouple only log a warning
Eric, 26/10, 3: error mapping Partly fixed: absent NIC on uncouple gives SDKObjectNotExistError; every other failure still gives SDKConflictError (see point 2)
Eric, 26/10, 4: unit tests, AttributeError without #954 Fixed: 7 new tests in test_smtclient.py, 14 in test_vmcpHandler.py; #954 is merged
Eric, 26/10, 5: documentation Fixed: see point 4 for what is still missing
Eric, 29/10, 1: pep8 (F811, E303) Fixed: tox -e pep8 passes
Eric, 29/10, 2: return code of FOR, real outputs Answered: vmcp does not report the inner result, hence the pre-checks. Real outputs are still not attached (see points 1 and 3)
Eric, 29/10, 3: overlap with #957 Resolved: one _run_for(), on master
Eric, 29/10, 4: title of step 7, use_smapi help, zvmsdk.conf.sample Fixed: master rewrote the paragraph; the PR extends the help and regenerates the sample
Rajat, 22/10: VMCP errors ignored Partly fixed: a non-zero rc is now raised, but a failed inner command can still look like a success (point 1)
Rajat, 22/10: config flag undefined Fixed: use_smapi from #954
Rajat, 30/10, 1: every vmcp failure is a 409 Open, deferred to #993 (point 2)
Rajat, 30/10, 2: invented CP message ids Old ids removed; the new ids still include the module prefix, and the outputs are not shown (point 3)
Rajat, 30/10, 3: use_smapi help mentions FCP WWPN and LINK Resolved: these lines now come from master, where both operations exist
Rajat, 30/10, 4: message 0405 in _run_for() _run_for() is now master code, so this PR is no longer the place to fix it

Remaining points

  1. Bug: a failed detach or uncouple can still be reported as a success

    You wrote that vmcp can exit with rc 0 and no output when the inner command of FOR fails. In that case VMCPHandler.delete_nic_for_guest() and uncouple_nic_for_guest() return success. Then SMTClient.delete_nic() and _uncouple_nic() log "successfully", but the NIC is still present, or still coupled, on the active guest. The directory and the switch table are already updated at that point, so the two views disagree. This is the "fail closed" problem Rajat raised on 22/10.

    On master, create_nic_for_guest() already handles this case: after DEFINE NIC it runs QUERY NIC USERID to confirm the result. I suggest doing the same here. After DETACH NIC, QUERY NIC should report the NIC as absent. After UNCOUPLE, is_nic_coupled() should return False. If not, raise an error. It is a small change and does not need the IUCV approach of #993.

  2. Error mapping (Rajat's point 1)

    I understand that the inner FOR failures are left to #993. The failures of the two QUERY pre-checks, though, are ordinary vmcp failures. "Not authorized" or "guest not found" are not conflicts. Right now SMTClient.delete_nic() and _uncouple_nic() turn them into SDKConflictError (409). It would be nice to raise SDKSMTRequestFailed or SDKInternalError for them, as the SMAPI path does for anything other than rs 28. Also, _run() returns an empty response on failure unless you pass output=True. The exception then only says "QUERY NIC failed for X 0600, rc: 1", without the CP reply. Passing output=True and putting the CP text (the output key) in the message would help diagnose problems.

  3. CP message ids of the pre-checks

    • NIC_NOT_FOUND_PATTERN = r'HCPNIC2836E' and NO_VSWITCH_ADAPTER_PATTERN = r'HCPSWQ2836E' in smtLayer/vmcpHandler.py hard-code the CP module prefix. The patterns already on master (NOT_ATTACHED_PATTERN = r'HCP\w*040E') and Rajat's suggestion match only the message number. Could you use r'HCP\w{3}2836E', or explain why the prefix is needed?
    • The fixtures in test_vmcpHandler.py still look hand-written. For example, HCPSWQ2836E USERID was not found. is interpreted as "no adapter on any vswitch". Is that really the reply of QUERY VSWITCH ALL DETAILS USERID for a logged-on guest without a vswitch adapter? Could you attach real outputs of QUERY NIC USERID <id> <vdev> for an existing and a missing NIC, and of QUERY VSWITCH ALL DETAILS USERID <id> for a guest with a coupled NIC and for a guest without one? That would also confirm the regular expression in is_nic_coupled().
    • is_nic_coupled() only looks at vswitches. A NIC coupled to a guest LAN would be reported as "already uncoupled", and UNCOUPLE would be skipped. Is it safe to assume that Feilong only couples NICs to vswitches (couple_nic_to_vswitch())? If so, a comment would help.
  4. Documentation

    This PR adds two CP commands to what Feilong needs when use_smapi = False. The rows for FOR userid CMD UNCOUPLE and FOR userid CMD DETACH NIC are already on master. To complete the documentation:

    • doc/source/quickstart.rst: the new row gives class B for QUERY VSWITCH ALL DETAILS USERID userid, while the existing QUERY VSWITCH DETAILS row says B, G. Could you check both against the CP Commands and Utilities Reference, as well as class B for QUERY NIC USERID?
    • The help of use_smapi in zvmsdk/config.py (and doc/source/zvmsdk.conf.sample): it would be nice to mention the known limitation tracked in #993 there, until it is fixed. With use_smapi = False, a NIC delete or disconnect on an active guest returns 409 where the SMAPI path returns 500. It may also miss a failure of the inner command.
    • The PR description is out of date: it still mentions only FOR ... CMD and the dependency on #954. It would help reviewers to describe the pre-checks there.

When use_smapi=False, issue the following CP commands through vmcp
instead of SMAPI:
- FOR <userid> CMD UNCOUPLE (NIC uncouple on an active guest)
- FOR <userid> CMD DETACH NIC (NIC detach on an active guest)

Before running them, check the state of the NIC:
- QUERY NIC USERID <userid> <vdev> verifies that the NIC exists. A
  missing NIC (message number 2836E) is tolerated: detach is skipped
  and reported as nic_not_found with overallRC 0; uncouple reports
  nic_not_found with overallRC 1.
- QUERY VSWITCH ALL DETAILS USERID <userid> tells whether the NIC is
  coupled to a vswitch. A guest with no adapter on any vswitch
  (message number 2836E) is reported as not coupled. An already
  uncoupled NIC is not uncoupled again and is reported as
  already_uncoupled.

After UNCOUPLE, the vswitch query is run again. If the NIC is still
coupled, an error is returned.

vmcp does not return the result of the command run through FOR ... CMD:
it can exit with rc 0 and no output when the inner command failed, as
CP does not return the messages of some commands through diagnose X'08'.
The CP messages of the inner command are therefore not parsed. Only a
failure of the FOR itself (non-zero exit) is detected. The result of
DETACH NIC is not verified afterwards.

A failed QUERY returns the CP reply in strError. SMTClient.delete_nic
logs a warning when the NIC is not found, and SMTClient._uncouple_nic
raises SDKObjectNotExistError for a missing NIC and only logs a warning
for an already uncoupled one. Any other failure raises
SDKSMTRequestFailed.

Document the new CP commands and their privilege classes in the
quickstart step 7 table and in the use_smapi help of config.py and
zvmsdk.conf.sample.

Signed-off-by: Kunal Naik <kunalnaik@Kunals-MacBook-Pro.local>
@kunal-naik

kunal-naik commented Nov 26, 2026 •

Copy link
Copy Markdown
Author

Hi @Bischoff
Thank you for your review. I went through all four points and tested on a z/VM host. The commit is amended and force-pushed.

  1. Failed detach or uncouple reported as success
    UNCOUPLE: uncouple_nic_for_guest() now runs is_nic_coupled() again after UNCOUPLE. If the NIC is still coupled, it returns an error.

DETACH NIC: I could not add a check, because QUERY NIC USERID does not show whether the NIC was detached. After a successful FOR RJSH0003 CMD DETACH NIC 1003, the guest reports HCPQVD040E Device 1003 does not exist for q v 1003. From the hypervisor, QUERY NIC USERID still returns the MAC record:

vmcp q nic userid RJSH0003 1003
 A MAC: 02-01-75-11-DF-0D RJSH0003  1003

It stayed that way until the guest was restarted, and after the restart it returned HCPNIC2836E VDEV was not found. A post-check on QUERY NIC USERID would therefore report every successful detach as a failure. I did not find another CP command that shows the detach without going into the guest, so the detach check we can plan to add in #993.

  1. Error mapping and CP text
    A failed QUERY NIC or QUERY VSWITCH now runs with output=True, and the CP reply is in the message, for example QUERY NIC failed for X 0600, rc: 1: HCP045E ....
    delete_nic() and _uncouple_nic() now raise SDKSMTRequestFailed for vmcp failures instead of SDKConflictError. The 409 is gone from the vmcp path. The SMAPI path is unchanged.

  2. CP message ids and fixtures

Both patterns are now r'HCP\w{3}2836E'. The two ids are the same message number from two modules: HCPNIC2836E for QUERY NIC and HCPSWQ2836E for QUERY VSWITCH.
Real outputs (guest RJSH0003):
for an existing nic

vmcp q nic userid RJSH0003 1000
Default System MAC Protection: OFF
Network Device Allocation: Permitted
 A MAC: 02-01-75-00-29-A6 RJSH0003  1000

for a missing nic

 vmcp q nic userid RJSH0003 1009
HCPNIC2836E VDEV was not found.
Error: non-zero CP response for command 'q nic userid RJSH0003 1009': #2836

QUERY VSWITCH ALL DETAILS USERID for a logged-on guest -

With 1003 vdev coupled

[root@vm-2-cmp-boeb4901 ~]# vmcp QUERY VSWITCH ALL DETAILS USERID RJSH0003
 
VSWITCH SYSTEM VSICIC     Type: QDIO    Connected: 21   Maxconn: INFINITE
  PERSISTENT  RESTRICTED    ETHERNET                  Accounting: OFF
  USERBASED LOCAL
  VLAN Unaware
  MAC address: 02-01-75-00-00-02    MAC Protection: Unspecified
  IPTimeout: 5   QueueStorage Range: 8-256M     Current: 8M
  Isolation Status: OFF        VEPA Status: OFF
  Unicast IP address count: 19
 Uplink Port:
  State: Ready                         PriQueuing: OFF
  PMTUD setting: EXTERNAL   PMTUD value: 9000     Trace Pages: 8
  LOG: Off
  RDEV: 3001.P00 VDEV: 3001 Controller: SYSTEM   ACTIVE
        Adapter ID: 9175000C5BA8.0174
    Uplink Port Connection:
      RX Packets: 67487998   Discarded: 0          Errors: 0
      TX Packets: 14317457   Discarded: 0          Errors: 0
      RX Bytes: 15623267836          TX Bytes: 7599483740
      Device: 3001  Unit: 000   Interface: Activated   Port: 2049
      Options: Ethernet
      Partner Switch Capabilities: No_Reflective_Relay
  RDEV: 3101.P00 VDEV: 3101 Controller: SYSTEM   BACKUP
        Adapter ID: 9175000C5BA8.0288
    Uplink Port Connection:
      RX Packets: 0          Discarded: 0          Errors: 0
      TX Packets: 0          Discarded: 0          Errors: 0
      RX Bytes: 0                    TX Bytes: 0
      Device: 3101  Unit: 000   Interface: Inactive    Port: 2050
      Options: Ethernet
 Adapter Connections:                            Connected: 21
    Adapter Owner: RJSH0003 NIC: 1000.P00 Name: HYD1G1      Type: QDIO
      PQUplinkTX: Normal
      RX Packets: 570361     Discarded: 0          Errors: 0
      TX Packets: 154        Discarded: 0          Errors: 0
      RX Bytes: 52988823             TX Bytes: 21006
      Device: 1002  Unit: 002   Role: DATA       Port: 2277
      Options: Ethernet Broadcast
        Unicast MAC Addresses:
          02-01-75-00-29-A6 IP: 172.26.40.103
        Multicast MAC Addresses:
          01-00-5E-00-00-01
          33-33-00-00-00-01
          33-33-FF-00-29-A6
    Adapter Owner: RJSH0003 NIC: 1003.P00 Name: HYD1G1      Type: QDIO
      PQUplinkTX: Normal
      RX Packets: 1332       Discarded: 0          Errors: 0
      TX Packets: 0          Discarded: 0          Errors: 0
      RX Bytes: 138170               TX Bytes: 0
      Device: 1005  Unit: 002   Role: DATA       Port: 2180
      Options: Ethernet Broadcast
        Unicast MAC Addresses:
          02-01-75-00-00-0A
        Multicast MAC Addresses:
          01-00-5E-00-00-01
          33-33-00-00-00-01
[root@vm-2-cmp-boeb4901 ~]# 
[root@vm-2-cmp-boeb4901 ~]# 


With 1003 vdev uncoupled


vmcp QUERY VSWITCH ALL DETAILS USERID RJSH0003
 
VSWITCH SYSTEM VSICIC     Type: QDIO    Connected: 20   Maxconn: INFINITE
  PERSISTENT  RESTRICTED    ETHERNET                  Accounting: OFF
  USERBASED LOCAL
  VLAN Unaware
  MAC address: 02-01-75-00-00-02    MAC Protection: Unspecified
  IPTimeout: 5   QueueStorage Range: 8-256M     Current: 8M
  Isolation Status: OFF        VEPA Status: OFF
  Unicast IP address count: 19
 Uplink Port:
  State: Ready                         PriQueuing: OFF
  PMTUD setting: EXTERNAL   PMTUD value: 9000     Trace Pages: 8
  LOG: Off
  RDEV: 3001.P00 VDEV: 3001 Controller: SYSTEM   ACTIVE
        Adapter ID: 9175000C5BA8.0174
    Uplink Port Connection:
      RX Packets: 66251862   Discarded: 0          Errors: 0
      TX Packets: 13951071   Discarded: 0          Errors: 0
      RX Bytes: 15387422864          TX Bytes: 7466129395
      Device: 3001  Unit: 000   Interface: Activated   Port: 2049
      Options: Ethernet
      Partner Switch Capabilities: No_Reflective_Relay
  RDEV: 3101.P00 VDEV: 3101 Controller: SYSTEM   BACKUP
        Adapter ID: 9175000C5BA8.0288
    Uplink Port Connection:
      RX Packets: 0          Discarded: 0          Errors: 0
      TX Packets: 0          Discarded: 0          Errors: 0
      RX Bytes: 0                    TX Bytes: 0
      Device: 3101  Unit: 000   Interface: Inactive    Port: 2050
      Options: Ethernet
 Adapter Connections:                            Connected: 20
    Adapter Owner: RJSH0003 NIC: 1000.P00 Name: HYD1G1      Type: QDIO
      PQUplinkTX: Normal
      RX Packets: 38384918   Discarded: 1094       Errors: 0
      TX Packets: 1016       Discarded: 0          Errors: 0
      RX Bytes: 3488206844           TX Bytes: 99857
      Device: 1002  Unit: 002   Role: DATA       Port: 2277
      Options: Ethernet Broadcast
        Unicast MAC Addresses:
          02-01-75-00-29-A6 IP: 172.26.40.103
        Multicast MAC Addresses:
          01-00-5E-00-00-01
          33-33-00-00-00-01
          33-33-FF-00-29-A6

For a user that does not exist

vmcp QUERY VSWITCH ALL DETAILS USERID RJSH0008
HCPSWQ2836E USERID was not found.
Error: non-zero CP response for command 'QUERY VSWITCH ALL DETAILS USERID RJSH0008': #2836

Guest LAN: Feilong's only coupling path is couple_nic_to_vswitch() (SMAPI Virtual_Network_Adapter_Connect_Vswitch), and there is no API for a guest LAN. A NIC coupled to a guest LAN by other means would be reported as not coupled, and UNCOUPLE would be skipped.

  1. Documentation

QUERY VSWITCH ALL DETAILS USERID is now B, G in the quickstart table. The CP reference lists QUERY VSWITCH as class B, G. QUERY NIC USERID is class B, which matches the reference.
The use_smapi help in config.py and zvmsdk.conf.sample now mentions that a failed inner FOR command may not be reported (#993).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants