get_segment_port_for_vm
Map a VM name to its NSX segment ports via VIF attachments. Troubleshoot network connectivity by identifying the segment port a VM is using.
Instructions
[READ] Find which segment(s) a VM is attached to via its VIF attachments.
Start here for "why can this VM not reach the network?" — it is the only tool mapping a VM name onto NSX topology. Looks the VM up in the fabric inventory, fetches its VIFs, and matches segment ports by lport_attachment_id. Returns one dict (not the list envelope): VM info (external_id, host, power state) and matched_ports (segment id/name, port id/name). Matching is on exact display name, and empty matched_ports means no VIF is attached, not that the VM is missing.
Then get_logical_port_status on the segment it names. VM power and placement are not managed here — use vmware-aiops.
Args: vm_display_name: VM display name as shown in vCenter/NSX inventory. target: NSX Manager target from config (default if omitted).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| vm_display_name | Yes |