Calsoft-Pvt-Ltd / NSX_V2T_Migration_Tool

NSX_V2T_Support
18 stars 12 forks source link

Exception: Failed to create application port profile #2

Open kerub77 opened 10 months ago

kerub77 commented 10 months ago

If there are more than one NAT rules using the same TCP custom port, the tool during the migration creates the first one but it fails on second creation as it tries to create again the same custom port instead of re-use the same. The Error is: Exception: Failed to create application port profile [ XXXXXXXXXXXXXXX ] Application Port Profile CUSTOM-TCP-1010101 already exists in Organization YYYYYYYYYYYYYYYYYYYY.

NSX-V2T-Support commented 9 months ago

Hi @kerub77, Which MT version are you using? This issue was fixed after MT 1.4.2.

kerub77 commented 9 months ago

Hi @kerub77, Which MT version are you using? This issue was fixed after MT 1.4.2.

Hi @NSX-V2T-Support , I'm using 1.4.2.1

flamby commented 9 months ago

Like @kerub77 I had this issue w/ 1.4.2.1 as well.

Looking quickly at the code, I'd say that we need to check here that the port is not already created, and if so, just return a tuple: (name, id).

https://github.com/Calsoft-Pvt-Ltd/NSX_V2T_Migration_Tool/blob/e6422f028ca24efaf6dcde159b99699fb63d682f/src/core/vcd/vcdConfigureEdgeGatewayServices.py#L906

The UI is doing this kind of GET request to list all custom port profiles: GET /applicationPortProfiles?page=1&pageSize=128&filterEncoded=true&filter=(_context==urn:vcloud:vdc:{vdc_id};scope!=SYSTEM)&sortAsc=name&links=true

Of course, we need to take into account pagination since we might have more than 128 records there.