OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

loadConfigFile.py cannot load bgp_ngpf_9.00.ixncfg #108

Closed matsuda73 closed 4 years ago

matsuda73 commented 4 years ago

Hi,

loadConfigFile.py always fails to load bgp_ngpf_9.00.ixncfg. I confirmed that IxNetwork GUI can load the ixncfg file and run test without any issues. How can I troubleshoot?

I use Linux API server on ESXi: Version 9.00.100.213 (Update 3) and ixnetwork-restpy 1.0.53. (restpy.log snippet)

2020-07-03 02:09:10 [ixnetwork_restpy.connection] [INFO] Loading config file: bgp_ngpf_9.00.ixncfg
2020-07-03 02:09:11 [ixnetwork_restpy.connection] [DEBUG] POST https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig {"Arg1": "bgp_ngpf_9.00.ixncfg"}
2020-07-03 02:09:16 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'{"executionTimeMs":5002.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:17 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:17 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":6166.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:18 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:18 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":7394.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:19 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:19 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":8562.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:20 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:21 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":9733.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:22 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:22 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":10902.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:23 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:23 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":12055.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:24 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:24 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":13210.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:25 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:25 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":14388.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:26 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:26 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":15541.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:27 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:28 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":16691.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:29 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":17852.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:30 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:30 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":19056.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:31 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:31 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":20213.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:32 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:32 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":21382.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 02:09:33 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/69/ixnetwork/operations/loadconfig/1 
2020-07-03 02:09:33 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":21954.0,"id":"1","state":"ERROR","progress":100,"message":null,"url":"/api/v1/sessions/69/ixnetwork/operations/loadconfig/1","resultUrl":"","result":"Failed to load \'/root/.local/share/Ixia/sdmStreamManager/common/bgp_ngpf_9.00.ixncfg\'.\\n"}'

On the other hand, bgp-sample.ixncfg which I created myself can be loaded with the same environment. (restpy.log snippet)

2020-07-03 01:58:35 [ixnetwork_restpy.connection] [INFO] Loading config file: bgp-sample.ixncfg
2020-07-03 01:58:35 [ixnetwork_restpy.connection] [DEBUG] POST https://10.39.19.251:443/api/v1/sessions/68/ixnetwork/operations/loadconfig {"Arg1": "bgp-sample.ixncfg"}
2020-07-03 01:58:40 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted b'{"executionTimeMs":5001.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/68/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 01:58:41 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/68/ixnetwork/operations/loadconfig/1 
2020-07-03 01:58:41 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":6167.0,"id":"1","state":"IN_PROGRESS","progress":0,"message":null,"url":"/api/v1/sessions/68/ixnetwork/operations/loadconfig/1","resultUrl":"","result":null}'
2020-07-03 01:58:42 [ixnetwork_restpy.connection] [DEBUG] GET https://10.39.19.251:443/api/v1/sessions/68/ixnetwork/operations/loadconfig/1 
2020-07-03 01:58:43 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":7266.0,"id":"1","state":"SUCCESS","progress":100,"message":null,"url":"/api/v1/sessions/68/ixnetwork/operations/loadconfig/1","resultUrl":"","result":"kVoid"}'

bgp-sample.ixncfg is smaller than bgp_ngpf_9.00.ixncfg.

user01@6S15NH2:~/work/IxNetwork/RestPy/SampleScripts$ ls -l | grep .ixncfg
-rw-rw-rw- 1 user01 user01 130043 Sep  6  2019 QuickTestNgpf_vm8.20.ixncfg
-rwxrwxrwx 1 user01 user01  91312 Jul  2 18:38 bgp-sample.ixncfg
-rwxrwxrwx 1 user01 user01 158713 Jul  3 10:20 bgp_ngpf_9.00.ixncfg
-rwxrwxrwx 1 user01 user01 154182 Sep 17  2019 ngpfQuickTest2ports_8.50.ixncfg

Similarly, loadQuicTest.py with ngpfQuickTest2ports_8.50.ixncfg doesn't work at my environment.

Thanks, Matsuda

therkong commented 4 years ago

Hi, I just tested loadConfigFile.py to load bgp_ngpf_9.00.ixncfg. I'm using Linux API server on ESXi: Version 9.00.100.213 (Update 3) and ixnetwork-restpy 1.0.53. Basically try to mimic your environment. And I'm able to load the config file. Can you check if you can load the bgp_ngpf_9.00.ixncfg manually on the Linux API server webUI? There's 'Browse to upload file' button at the left/bottom of the webUI. Capture

therkong commented 4 years ago

Does your VM have enough mem and cpu resource?

matsuda73 commented 4 years ago

Hi,

I have been able to load bgp_ngpf_9.00.ixncfg manually via WebUI.

Strangely, I found that the file sizes of ixncfg files which I had not been able to load were 1KB before I uploaded the ixncfg file via WebUI. before Note: I created bgp-sample.ixncfg which can be loaded by loadConfigFile.py on this WebUI. So, I imagine that uploading ixncfg file always fails.

And, I tried Windows API server and saw the similar upload issues. windows

Linux API server Resources: 8vCPUs/16GB RAM/128GB HDD (default values) is assigned to the VM. Host CPU is 16 CPUs x Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz.

Thanks, Matsuda

matsuda73 commented 4 years ago

Hi,

Config load issue has been resolved after I assigned the full path of the file to configFile variable. It seemed that the local ixncfg file had not been found due to my misconfiguration.

Doesn't loadConfig() method throw any specific exception when there isn't local file?

Thanks, Matsuda

therkong commented 4 years ago

Looks like it's trying to load the file on the API Server, but eventually fails with following error: 2020-07-06 18:13:02 [ixnetwork_restpy.connection] [DEBUG] 200 OK b'{"executionTimeMs":21290.0,"id":"1","state":"ERROR","progress":100,"message":null,"url":"/api/v1/sessions/54/ixnetwork/operations/loadconfig/1","resultUrl":"","result":"Failed to load \'/root/.local/share/Ixia/sdmStreamManager/common/bgp_ngpf_9.00_test.ixncfg\'

If you catch exception on the python script, you will get ixnetwork_restpy.errors.BadRequestError: Failed to load '/root/.local/share/Ixia/sdmStreamManager/common/bgp_ngpf_9.00_test.ixncfg'