Skip to content

Commit 64f66e1

Browse files
authored
Hipersocket changes (#2036)
Details: * Changed the name of the Partition Link created in AdapterManager.create_hipersocket() by using the name of the Hipersocket adapter unchanged, without the previously used "HS" prefix. * Added an example script "hipersocket_lifecycle.py" for creating and deleting Hipersocket adapters. * Updated the descriptions of AdapterManager.create_hipersocket() and Adapter.delete() to better describe the dependency on the API feature. * Updated the description of the Nic.create() method to describe the limitation of not supporting SSC management NICs backed by Hipersocket adapters on z16 CPCs, and how to lift this limitation. * Added a design file "hipersocket-changes-z16.md" that summarizes the changes related to Hipersocket operations since z16. Signed-off-by: Andreas Maier <[email protected]>
1 parent d475997 commit 64f66e1

File tree

9 files changed

+247
-25
lines changed

9 files changed

+247
-25
lines changed

changes/noissue.89.1.feature.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Changed the name of the Partition Link created in
2+
:meth:`zhmcclient.AdapterManager.create_hipersocket`, by using the name of the
3+
Hipersocket adapter unchanged, without the previously used "HS" prefix.

changes/noissue.89.2.feature.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added an example script hipersocket_lifecycle.py for creating and deleting
2+
Hipersocket adapters.

changes/noissue.89.3.feature.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Docs: Updated the descriptions of the :meth:`zhmcclient.NicManager.create`,
2+
:meth:`zhmcclient.Partition.attach_network_link`,
3+
:meth:`zhmcclient.PartitionLinkManager.create` and
4+
:meth:`zhmcclient.PartitionLink.update_properties` methods
5+
to describe the limitation of not supporting SSC management NICs backed by
6+
Hipersocket adapters on z16 CPCs that have the API feature
7+
"dpm-hipersockets-partition-link-management" enabled, and how to lift this
8+
limitation.

design/hipersocket-changes-z16.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Hipersocket changes since z16
2+
3+
This summarizes the changes to Hipersocket related operations at the HMC WS-API
4+
since z16.
5+
6+
These changes apply to the indicated CPC version, regardless of the HMC version
7+
(as long as the HMC version is supported for the CPC, of course).
8+
9+
## Changes in z16 CPCs (GA 1.0)
10+
11+
* Support for Partition Links for SMC-D was added.
12+
- indicated by firmware feature "dpm-smcd-partition-link-management"
13+
14+
* Virtual Switches are still supported.
15+
16+
* No changes to Hipersocket related operations:
17+
- Hipersocket adapters can be created only by "Create Hipersocket".
18+
- Hipersocket-backed NICs can be created only by "Create NIC" with backing
19+
vswitch.
20+
- Creating an SSC management NIC backed by Hipersockets is supported.
21+
22+
## Changes in z16 CPCs (GA 1.5)
23+
24+
* Support for Partition Links was extended to add Hipersocket (and CTC) support.
25+
- indicated by API feature "dpm-hipersockets-partition-link-management".
26+
27+
* Virtual Switches are still supported.
28+
29+
* Hipersocket adapters now can be created in two ways:
30+
- "Create Hipersocket", as before.
31+
- "Create Partition Link" with type hipersocket.
32+
33+
* Hipersocket-backed NICs now can be created in two ways:
34+
- "Create NIC", with backing vswitch, as before.
35+
- "Modify Partition Link" with "added-connections".
36+
37+
* Creating an SSC management NIC backed by Hipersockets is not supported, unless
38+
the "dpm-hipersockets-partition-link-management" API feature gets disabled.
39+
That can be achieved by installing the firmware feature "DPM IQD Links - Disable",
40+
which can be requested by customers from IBM support.
41+
42+
## Changes in z17 CPCs (GA 1.0)
43+
44+
* "Create Hipersocket" is no longer supported.
45+
- indicated by API feature "network-express-support".
46+
47+
* Virtual Switches are no longer supported.
48+
- indicated by API feature "network-express-support".
49+
50+
* Hipersocket adapters now can be created only by:
51+
- "Create Partition Link" with type hipersocket.
52+
53+
* Hipersocket-backed NICs can still be created in two ways:
54+
- "Create NIC", but now with backing adapter port.
55+
- The requirement to use the backing port is indicated by API feature
56+
"network-express-support".
57+
- "Modify Partition Link" with "added-connections".
58+
59+
* Creating an SSC management NIC backed by Hipersockets is supported again,
60+
using any of the two ways to create NICs.

examples/hipersocket_lifecycle.py

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/usr/bin/env python
2+
# Copyright 2025 IBM Corp. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
"""
17+
Example that creates and deletes a Hipersocket adapter in a CPC in DPM mode.
18+
"""
19+
20+
import sys
21+
import uuid
22+
import urllib3
23+
24+
import zhmcclient
25+
from zhmcclient.testutils import hmc_definitions, setup_hmc_session
26+
27+
28+
def main():
29+
"Main function of the script"
30+
31+
urllib3.disable_warnings()
32+
33+
print(__doc__)
34+
35+
# Get HMC info from HMC inventory and vault files
36+
hmc_def = hmc_definitions()[0]
37+
host = hmc_def.host
38+
print(f"Creating a session with the HMC at {host} ...")
39+
try:
40+
session = setup_hmc_session(hmc_def)
41+
except zhmcclient.Error as exc:
42+
print(f"Error: Cannot establish session with HMC {host}: "
43+
f"{exc.__class__.__name__}: {exc}")
44+
return 1
45+
46+
try:
47+
client = zhmcclient.Client(session)
48+
49+
print("Determining the CPC to use ...")
50+
cpc_name = None
51+
for name, props in hmc_def.cpcs.items():
52+
if props.get("dpm_enabled", False) is True:
53+
cpc_name = name
54+
break
55+
if cpc_name:
56+
print(f"Finding CPC {cpc_name} specified in HMC inventory ...")
57+
try:
58+
cpc = client.cpcs.find_by_name(cpc_name)
59+
except zhmcclient.Error as exc:
60+
print(f"Error: Cannot find CPC {cpc_name}: "
61+
f"{exc.__class__.__name__}: {exc}")
62+
return 1
63+
else:
64+
print("Finding any CPC in DPM mode ...")
65+
cpcs = client.cpcs.list(filter_args={'dpm-enabled': True})
66+
if not cpcs:
67+
print(f"Error: HMC at {host} does not manage any CPCs in DPM "
68+
"mode")
69+
return 1
70+
cpc = cpcs[0]
71+
print(f"Using CPC {cpc.name}")
72+
73+
ad_name = f"zhmc_test_{uuid.uuid4()}"
74+
print(f"Creating Hipersocket adapter {ad_name} ...")
75+
ad_props = {
76+
'name': ad_name,
77+
'description': 'Original adapter description.',
78+
}
79+
try:
80+
ad = cpc.adapters.create_hipersocket(properties=ad_props)
81+
except zhmcclient.Error as exc:
82+
print(f"Error: Cannot create Hipersocket adapter {ad_name} on CPC "
83+
f"{cpc.name}: {exc.__class__.__name__}: {exc}")
84+
return 1
85+
86+
print(f"Deleting Hipersocket adapter {ad_name} ...")
87+
try:
88+
ad.delete()
89+
except zhmcclient.Error as exc:
90+
print(f"Error: Cannot delete Hipersocket adapter {ad_name} on CPC "
91+
f"{cpc.name}: {exc.__class__.__name__}: {exc}")
92+
return 1
93+
94+
return 0
95+
96+
finally:
97+
print("Logging off ...")
98+
session.logoff()
99+
100+
101+
if __name__ == '__main__':
102+
sys.exit(main())

zhmcclient/_adapter.py

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ def create_hipersocket(self, properties):
193193
Create and configure a HiperSockets Adapter in this CPC.
194194
195195
z17 CPCs removed the "Create Hipersocket" operation. This method uses
196-
the "Create Hipersocket" operation z15 and earlier CPCs, and the
197-
"Create Partition Link" operation on z16 and later CPCs. The distinction
198-
is made based on the "dpm-hipersockets-partition-link-management"
199-
API feature on the CPC.
196+
the "Create Partition Link" operation when the API feature
197+
"dpm-hipersockets-partition-link-management" is enabled, and otherwise
198+
the earlier "Create Hipersocket" operation. As a result, this method
199+
supports all generations of CPCs.
200200
201201
HMC/SE version requirements:
202202
@@ -206,17 +206,18 @@ def create_hipersocket(self, properties):
206206
Authorization requirements:
207207
208208
* Object-access permission to the scoping CPC.
209-
* On CPCs of z15 and earlier: Task permission to the
210-
"Create HiperSockets Adapter" task.
211-
* On CPCs of z16 and later: Task permission to the
212-
"Create Partition Link" task.
209+
* When the "dpm-hipersockets-partition-link-management" API feature is
210+
enabled, task permission to the "Create Partition Link" task;
211+
otherwise task permission to the "Create HiperSockets Adapter" task.
213212
214213
Parameters:
215214
216215
properties (dict): Initial property values.
217216
Allowable properties are the following:
218217
219-
* "name" (str): Required: The adapter's 'name' property.
218+
* "name" (str): Required: The adapter's 'name' property. When
219+
the Hipersocket adapter is created via a Partition Link, this
220+
also becomes the name of the Partition Link.
220221
221222
* "description" (str): Optional: The adapter's 'description'
222223
property. Default: An empty string.
@@ -230,7 +231,8 @@ def create_hipersocket(self, properties):
230231
231232
These properties are defined in section 'Request body contents'
232233
in section 'Create Hipersocket' in the :term:`HMC API` book, but
233-
they are valid for both approaches.
234+
they are valid also when the Hipersocket adapter is created via
235+
a Partition Link.
234236
235237
Returns:
236238
@@ -252,13 +254,8 @@ def create_hipersocket(self, properties):
252254
if pl_feature:
253255
name = properties['name']
254256
console = cpc.manager.console
255-
pl_name = f"Hipersocket {name}"
256-
if len(pl_name) > 64:
257-
pl_name = f"HS {name}"
258-
if len(pl_name) > 64:
259-
pl_name = pl_name[0:64]
260257
part_link = console.partition_links.create({
261-
"name": f"HS {properties['name']}",
258+
"name": name,
262259
"type": "hipersockets",
263260
"cpc-uri": cpc.uri,
264261
})
@@ -472,16 +469,16 @@ def maximum_crypto_domains(self):
472469
@logged_api_call
473470
def delete(self):
474471
"""
475-
Delete this Adapter.
472+
Delete this Hipersocket Adapter.
476473
477474
The Adapter must be a HiperSockets Adapter and must not currently be
478475
the backing adapter of any partition NICs.
479476
480477
z17 CPCs removed the "Delete Hipersocket" operation. This method uses
481-
the "Delete Hipersocket" operation z15 and earlier CPCs, and the
482-
"Delete Partition Link" operation on z16 and later CPCs. The distinction
483-
is made based on the "dpm-hipersockets-partition-link-management"
484-
API feature on the CPC.
478+
the "Delete Partition Link" operation when the API feature
479+
"dpm-hipersockets-partition-link-management" is enabled, and otherwise
480+
the earlier "Delete Hipersocket" operation. As a result, this method
481+
supports all generations of CPCs.
485482
486483
HMC/SE version requirements:
487484
@@ -491,10 +488,9 @@ def delete(self):
491488
Authorization requirements:
492489
493490
* Object-access permission to the HiperSockets Adapter to be deleted.
494-
* On CPCs of z15 and earlier: Task permission to the
495-
"Delete HiperSockets Adapter" task.
496-
* On CPCs of z16 and later: Task permission to the
497-
"Delete Partition Link" task.
491+
* When the "dpm-hipersockets-partition-link-management" API feature is
492+
enabled, task permission to the "Delete Partition Link" task;
493+
otherwise task permission to the "Delete HiperSockets Adapter" task.
498494
499495
Raises:
500496

zhmcclient/_nic.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ def create(self, properties):
213213
214214
properties['virtual-switch-uri'] = vswitch.uri
215215
216+
Limitations:
217+
218+
* When the API feature "dpm-hipersockets-partition-link-management"
219+
is enabled on a z16 CPC (and only there), SSC management NICs
220+
cannot be backed by Hipersocket adapters. This limitation can be
221+
lifted by installing the firmware feature "DPM IQD Links - Disable",
222+
which can be requested by customers from IBM support.
223+
216224
HMC/SE version requirements:
217225
218226
* SE version 2.13.1

zhmcclient/_partition.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,20 @@ def attach_network_link(
16801680
16811681
By default, this method waits for completion of its asynchronous job.
16821682
1683+
SSC management NICs backed by a Hipersocket adapter can be created
1684+
by first attaching a Hipersocket-typed Partition Link to this
1685+
partition, and then updating the created NIC with the
1686+
:meth:`zhmcclient.Nic.update_properties` method to become an SSC
1687+
management NIC.
1688+
1689+
Limitations:
1690+
1691+
* When the API feature "dpm-hipersockets-partition-link-management"
1692+
is enabled on a z16 CPC (and only there), SSC management NICs
1693+
cannot be backed by Hipersocket adapters. This limitation can be
1694+
lifted by installing the firmware feature "DPM IQD Links - Disable",
1695+
which can be requested by customers from IBM support.
1696+
16831697
HMC/SE version requirements:
16841698
16851699
* SE version >= 2.16.0

zhmcclient/_partition_link.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ def create(self, properties=None):
245245
This method performs the "Create Partition Link" HMC operation and
246246
waits for completion of its asynchronous job.
247247
248+
SSC management NICs backed by a Hipersocket adapter can be created
249+
by first creating a Partition Link using this method with a
250+
"bus-connections" property that specifies partitions to be linked, and
251+
then updating the created NIC(s) with the
252+
:meth:`zhmcclient.Nic.update_properties` method to become an SSC
253+
management NIC.
254+
255+
Limitations:
256+
257+
* When the API feature "dpm-hipersockets-partition-link-management"
258+
is enabled on a z16 CPC (and only there), SSC management NICs
259+
cannot be backed by Hipersocket adapters. This limitation can be
260+
lifted by installing the firmware feature "DPM IQD Links - Disable",
261+
which can be requested by customers from IBM support.
262+
248263
HMC/SE version requirements:
249264
250265
* SE version >= 2.16.0
@@ -617,6 +632,20 @@ def update_properties(self, properties):
617632
This method performs the "Modify Partition Link" HMC operation and
618633
waits for completion of its asynchronous job.
619634
635+
SSC management NICs backed by a Hipersocket adapter can be created
636+
by first attaching this partition link to a partition using the
637+
"added-connections" property, and then updating the created NIC(s) with
638+
the :meth:`zhmcclient.Nic.update_properties` method to become an SSC
639+
management NIC.
640+
641+
Limitations:
642+
643+
* When the API feature "dpm-hipersockets-partition-link-management"
644+
is enabled on a z16 CPC (and only there), SSC management NICs
645+
cannot be backed by Hipersocket adapters. This limitation can be
646+
lifted by installing the firmware feature "DPM IQD Links - Disable",
647+
which can be requested by customers from IBM support.
648+
620649
HMC/SE version requirements:
621650
622651
* SE version >= 2.16.0

0 commit comments

Comments
 (0)