OpenIxia / ixnetwork_restpy

The IxNetwork python client.
https://openixia.github.io/ixnetwork_restpy/#/
MIT License
30 stars 16 forks source link

IxExplorer streams are cleared #83

Open nlbrown2 opened 3 months ago

nlbrown2 commented 3 months ago

Hello,

Our team typically uses IxExplorer to setup traffic streams & run tests. I am automating some of my work using IxNetwork RestPy. I have discovered that doing so will clear any IxExplorer streams on the physical ports used by my RestPy script. How do I prevent this from happening? If this is not possible, we will not be able to adopt ixnetwork_restpy.

To reproduce this issue:

  1. Login to the chassis through IxExplorer, and create a stream on a port
  2. Run an ixnetwork_restpy script which attaches that port to a vport
  3. Exit IxExplorer, as it shows outdated information at this point
  4. Login to the chassis via IxExplorer again, and discover the stream is missing

A minimal ixnetwork_restpy script:

 import json
 from ixnetwork_restpy import SessionAssistant, Files

 # create a test tool session
 session_assistant = SessionAssistant(
     IpAddress=CHASSIS_IP,
     LogLevel=SessionAssistant.LOGLEVEL_INFO,
     ClearConfig=False,
 )
 ixnetwork = session_assistant.Ixnetwork

 # create a virtual port
 virtual_port = ixnetwork.Vport.add()
 # create dict of physical port to bind to
 # will bind to card 2 port 2 in this example
 physical_port_info = {
     "Arg1": CHASSIS_IP,
     "Arg2": 2,
     "Arg3": 2,
 }

 # following assign_ports.py sample from https://openixia.github.io/ixnetwork_restpy/#/samples
 connected_ports = ixnetwork.AssignPorts([physical_port_info], [], [virtual_port], False)

From the script logs, I see we are Using IxNetwork api server version 9.31.2302.4. The IxExplorer version is IxExplorer 9.31.3201.13 Patch1.