Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to reboot ports to factory default after assigning vport to test port #71

Closed
ThakkarJignesh opened this issue Jul 26, 2019 · 1 comment
Assignees

Comments

@ThakkarJignesh
Copy link

Hi,
I have a config file, which has certain ports. If I load that config file, during the assignment, the port goes for a reboot and come up online [green]. No issues! Now, If I do the same activity on the same port via RES, then port remains down [red]. To bring up the port, I have to explicitly issue the port reboot to factory default. Below is the code snapshot.

#######################################
import sys, os, time, traceback
import linecache
from ixnetwork_restpy.testplatform.testplatform import TestPlatform
from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant
platform = 'windows'
apiServerPort = 11009
apiServerIp = '172.22.202.213'
forceTakePortOwnership = True
ixChassisIpList = ['10.195.151.238']
portList = [[ixChassisIpList[0], 8,14],[ixChassisIpList[0], 8,1]]
testPorts = []
testPlatform = TestPlatform(ip_address=apiServerIp, rest_port=apiServerPort, platform=platform, log_file_name='restpy.log')
session = testPlatform.Sessions.add()
ixNetwork = session.Ixnetwork
ixNetwork.NewConfig()

Port_8_14 = ixNetwork.Vport.add(Name='Port_8_14')
Port_8_1 = ixNetwork.Vport.add(Name='Port_8_1')
vportList = [vport.href for vport in ixNetwork.Vport.find()]

for port in portList:
testPorts.append(dict(Arg1=port[0], Arg2=port[1], Arg3=port[2]))

hrefvport1 = ixNetwork.AssignPorts(testPorts, [], vportList, forceTakePortOwnership)

After the above step, port reboots and remains down. I have to use the below steps to bring up the ports online. Is there anything which I'm doing wrong? Any known issues?

Port_8_14.ResetPortCpuAndFactoryDefault()
Port_8_1.ResetPortCpuAndFactoryDefault()

@ajbalogh ajbalogh self-assigned this Jul 26, 2019
@ajbalogh
Copy link

There is a difference between the code paths.
Loading an ixncfg file does not restore via the automation API but uses the settings from Preferences->PortManagement to connect, reboot ports.
When using the automation API the AssignPorts will automatically connect the vport to a hardware port but the additional step to reboot is not included as part of the method.
Your approach is correct.

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

No branches or pull requests

2 participants