Skip to content

Add NIC attach and detach support for NetH VMs - #972

Open
Rachana-Kodal wants to merge 2 commits into
openmainframeproject:masterfrom
Rachana-Kodal:attac/detach_nic_neth
Open

Rachana-Kodal wants to merge 2 commits into
openmainframeproject:masterfrom
Rachana-Kodal:attac/detach_nic_neth

Conversation

@Rachana-Kodal

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Implements attach/detach NIC to the NetH VMs

Result:
Screenshot 2026-10-24 at 1 04 05 AM
Screenshot 2026-10-24 at 1 04 12 AM
Screenshot 2026-10-24 at 12 59 52 AM
Screenshot 2026-10-24 at 1 00 34 AM

@Rachana-Kodal
Rachana-Kodal force-pushed the attac/detach_nic_neth branch 4 times, most recently from 960dfbb to d74e1d6 Compare October 27, 2026 07:43
@Rajat-0

Rajat-0 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

The feature itself is clearly aimed at a real gap, but the NETH attach/config path has a couple of blockers in the new network configuration logic.

zvmsdk/networkops.py: zdirect_network_configuration() calls self._create_invokeScript(network_file_path, clean_cmd, files_map, znetconfig=False), but the method defined in the same class only accepts (network_file_path, commands, files_map). That mismatch will raise a TypeError as soon as guest_configure_network_interface_ip() is used, so the attach flow cannot work end-to-end.
zvmsdk/networkops.py: in _create_neth_configuration_files(), cfg_str is reassigned inside the loop instead of being appended to a per-interface config, so if guest_networks contains more than one entry, only the last network’s configuration survives. Earlier entries are silently dropped, which makes multi-NIC or repeated attach config incorrect.

@Rajat-0

Rajat-0 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Also check PEP8 failure

@Rachana-Kodal

Copy link
Copy Markdown
Contributor Author

Issue 1 – Fix: This issue has been fixed in #970

Issue 2 – Fix: Replaced the loop with direct indexing (net = network[0]) because each function call handles a single network interface. This ensures the intended network configuration is processed without accidentally overwriting it with subsequent entries.

Signed-off-by: Rachana Kodal <rachana.kodal@ibm.com>
Signed-off-by: Rachana Kodal <rachana.kodal@ibm.com>
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.

2 participants