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

No Peer issue in manifest output #106

Closed
juztas opened this issue May 20, 2024 · 4 comments
Closed

No Peer issue in manifest output #106

juztas opened this issue May 20, 2024 · 4 comments

Comments

@juztas
Copy link
Collaborator

juztas commented May 20, 2024

While reviewing code, dashboard generations, identified this. The following instance:

{'alias': 'RTMON-IT6-Caltech-SDSC IP on UCSD',
 'archived': False,
 'intents': [{'creation_time': '2024-05-19 22:06:11',
              'id': '6b16a14e-abe3-4e30-bcc0-8de5b428dc81',
              'json': '{"service_instance_uuid":"63ee9df4-c273-4d24-8556-364eaa5b0a71","data":{"type":"Multi-Path '
                      'P2P '
                      'VLAN","connections":[{"bandwidth":{"qos_class":"bestEffort"},"name":"Connection '
                      '1","ip_address_pool":{"netmask":"\\/30","name":"AutoGOLE-IPv4-Test-Pool"},"terminals":[{"vlan_tag":"any","assign_ip":false,"uri":"urn:ogf:network:ultralight.org:2013:sandie-7.ultralight.org"},{"vlan_tag":"any","assign_ip":true,"uri":"urn:ogf:network:nrp-nautilus.io:2020:k8s-gen4-01.sdsc.optiputer.net"}]}]},"service":"dnc","options":[],"service_profile_uuid":"49d722dc-2f8f-49f9-a7ab-92c2f26822ed","queries":[]}',
              'provisioned': True,
              'serviceDeltaUUID': 'c7f5638c-a8d5-45a4-b5f1-0eadc67fbb7a',
              'serviceInstanceUUID': '63ee9df4-c273-4d24-8556-364eaa5b0a71'}],
 'lastState': 'COMMITTED',
 'owner': 'admin',
 'profileUUID': '49d722dc-2f8f-49f9-a7ab-92c2f26822ed',
 'referenceUUID': '63ee9df4-c273-4d24-8556-364eaa5b0a71',
 'state': 'REINSTATE - READY',
 'timestamp': '2024/05/03 18:11:04'}

returns the following manifest:

{'Ports': [{'Name': '?port_name?',
            'Node': 'T2_US_SDSC:sn3700_s0',
            'Peer': '?peer?',   # NO Peer? Issue
            'Port': 'urn:ogf:network:nrp-nautilus.io:2020:sn3700_s0:PortChannel501',
            'Site': 'urn:ogf:network:nrp-nautilus.io:2020',
            'Vlan': '3608'},
           {'Host': [{'IPv4': '10.251.86.229/30',
                      'Interface': 'enp193s0f1np1',
                      'Name': 'T2_US_SDSC:k8s-gen4-01.sdsc.optiputer.net'}],
            'Name': 'Ethernet72',
            'Node': 'T2_US_SDSC:sn3700_s0',
            'Peer': '?peer?',
            'Port': 'urn:ogf:network:nrp-nautilus.io:2020:sn3700_s0:Ethernet72',
            'Site': 'urn:ogf:network:nrp-nautilus.io:2020',
            'Vlan': '3608'},
           {'Name': 'Port-channel 103',
            'Node': 'T2_US_Caltech_Test:dellos9_s0',
            'Peer': 'urn:ogf:network:tier2.ultralight.org:2024:dellos10_s1:Port-channel_101',
            'Port': 'urn:ogf:network:ultralight.org:2013:dellos9_s0:Port-channel_103',
            'Site': 'urn:ogf:network:ultralight.org:2013',
            'Vlan': '3608'},
           {'Host': [{'IPv4': '?ipv4?',
                      'Interface': 'mlx5p1s1',
                      'Name': 'T2_US_Caltech_Test:sandie-7.ultralight.org'}],
            'Name': 'hundredGigE 1/32',
            'Node': 'T2_US_Caltech_Test:dellos9_s0',
            'Peer': '?peer?',
            'Port': 'urn:ogf:network:ultralight.org:2013:dellos9_s0:hundredGigE_1-32',
            'Site': 'urn:ogf:network:ultralight.org:2013',
            'Vlan': '3608'},
           {'Name': 'Port-Channel502',
            'Node': 'NRM_CENIC:aristaeos_s0',
            'Peer': 'urn:ogf:network:sense-oasis-nrp-nautilus.io:2020:oasis:Pc502',
            'Port': 'urn:ogf:network:sc-test.cenic.net:2020:aristaeos_s0:Port-Channel502',
            'Site': 'urn:ogf:network:sc-test.cenic.net:2020',
            'Vlan': '3608'},
           {'Name': 'Port-Channel501',
            'Node': 'NRM_CENIC:aristaeos_s0',
            'Peer': 'urn:ogf:network:tier2.ultralight.org:2024:dellos10_s1:Port-channel_102',
            'Port': 'urn:ogf:network:sc-test.cenic.net:2020:aristaeos_s0:Port-Channel501',
            'Site': 'urn:ogf:network:sc-test.cenic.net:2020',
            'Vlan': '3608'},
           {'Name': 'Pc502',
            'Node': 'T2_US_UCSD_OASIS:oasis',
            'Peer': 'urn:ogf:network:sc-test.cenic.net:2020:aristaeos_s0:Port-Channel502',
            'Port': 'urn:ogf:network:sense-oasis-nrp-nautilus.io:2020:oasis:Pc502',
            'Site': 'urn:ogf:network:sense-oasis-nrp-nautilus.io:2020',
            'Vlan': '3608'},
           {'Name': '?port_name?',
            'Node': 'T2_US_UCSD_OASIS:oasis',
            'Peer': '?peer?', # NO Peer? Issue
            'Port': 'urn:ogf:network:sense-oasis-nrp-nautilus.io:2020:oasis:Pc501',
            'Site': 'urn:ogf:network:sense-oasis-nrp-nautilus.io:2020',
            'Vlan': '3608'},
           {'Name': 'Port-channel 101',
            'Node': 'T2_US_Caltech:dellos10_s1',
            'Peer': 'urn:ogf:network:ultralight.org:2013:dellos9_s0:Port-channel_103',
            'Port': 'urn:ogf:network:tier2.ultralight.org:2024:dellos10_s1:Port-channel_101',
            'Site': 'urn:ogf:network:tier2.ultralight.org:2024',
            'Vlan': '3608'},
           {'Name': 'Port-channel 102',
            'Node': 'T2_US_Caltech:dellos10_s1',
            'Peer': 'urn:ogf:network:sc-test.cenic.net:2020:aristaeos_s0:Port-Channel501',
            'Port': 'urn:ogf:network:tier2.ultralight.org:2024:dellos10_s1:Port-channel_102',
            'Site': 'urn:ogf:network:tier2.ultralight.org:2024',
            'Vlan': '3608'}]}

And that produces a wrong mermaid diagram due to missing Peer between T2_US_UCSD_OASIS:oasis and T2_US_SDSC:sn3700_s0, see # NO Peer? Issue. Template used to query is the following:

{
            "Ports": [
                {
                    "Port": "?terminal?",
                    "Name": "?port_name?",
                    "Vlan": "?vlan?",
                    "Node": "?node_name?",
                    "Peer": "?peer?",
                    "Site": "?site?",
                    "Host": [
                        {
                            "Name": "?host_name?",
                            "Interface": "?host_port_name?",
                            "IPv4": "?ipv4?",
                            "sparql": "SELECT DISTINCT ?host_port ?ipv4 WHERE { ?vlan_port nml:isAlias ?host_vlan_port. ?host_port nml:hasBidirectionalPort ?host_vlan_port. OPTIONAL {?host_vlan_port mrs:hasNetworkAddress  ?ipv4na. ?ipv4na mrs:type \"ipv4-address\". ?ipv4na mrs:value ?ipv4.} FILTER NOT EXISTS {?sw_svc mrs:providesSubnet ?vlan_subnt. ?vlan_subnt nml:hasBidirectionalPort ?host_vlan_port.} }",
                            "sparql-ext": "SELECT DISTINCT ?host_name ?host_port_name  WHERE {?host a nml:Node. ?host nml:hasBidirectionalPort ?host_port. OPTIONAL {?host nml:name ?host_name.} OPTIONAL {?host_port mrs:hasNetworkAddress ?na_pn. ?na_pn mrs:type \"sense-rtmon:name\". ?na_pn mrs:value ?host_port_name.} }",
                            "required": "false"
                        }
                    ],
                    "sparql": "SELECT DISTINCT  ?vlan_port  ?vlan  WHERE { ?subnet a mrs:SwitchingSubnet. ?subnet nml:hasBidirectionalPort ?vlan_port. ?vlan_port nml:hasLabel ?vlan_l. ?vlan_l nml:value ?vlan. }",
                    "sparql-ext": "SELECT DISTINCT ?terminal ?port_name ?node_name ?peer ?site WHERE { {?node a nml:Node. ?node nml:name ?node_name. ?node nml:hasBidirectionalPort ?terminal.  ?terminal nml:hasBidirectionalPort ?vlan_port. OPTIONAL {?terminal mrs:hasNetworkAddress ?na_pn. ?na_pn mrs:type \"sense-rtmon:name\". ?na_pn mrs:value ?port_name.} OPTIONAL {?terminal nml:isAlias ?peer.} OPTIONAL {?site nml:hasNode ?node.} OPTIONAL {?site nml:hasTopology ?sub_site. ?sub_site nml:hasNode ?node.} } UNION { ?site a nml:Topology. ?site nml:name ?node_name. ?site nml:hasBidirectionalPort ?terminal. ?terminal nml:hasBidirectionalPort ?vlan_port. OPTIONAL {?terminal mrs:hasNetworkAddress ?na_pn. ?na_pn mrs:type \"sense-rtmon:name\". ?na_pn mrs:value ?port_name.} OPTIONAL {?terminal nml:isAlias ?peer.}}}",
                    "required": "true"
                }
            ]
        }
@xi-yang
Copy link
Collaborator

xi-yang commented May 24, 2024

This is correct result. In this example, Host T2_US_SDSC:k8s-gen4-01.sdsc.optiputer.net with port enp193s0f1np1 is a sub-block. So it is the "peer" of this port. We do not get a peer URI due to isAlias is missing, which is also fine as that is implied by the peering isAlias from the host. If we really want the host port URI, I can add that to under the Host.

So we are not missing any information here. If the diagram is wrong, it must have processed the information incorrectly.

{'Ports': [{'Name': '?port_name?',
            'Node': 'T2_US_SDSC:sn3700_s0',
            'Peer': '?peer?',   # NO Peer? Issue
            'Port': 'urn:ogf:network:nrp-nautilus.io:2020:sn3700_s0:PortChannel501',
            'Site': 'urn:ogf:network:nrp-nautilus.io:2020',
            'Vlan': '3608'},
           {'Host': [{'IPv4': '10.251.86.229/30',
                      'Interface': 'enp193s0f1np1',
                      'Name': 'T2_US_SDSC:k8s-gen4-01.sdsc.optiputer.net'}],
            'Name': 'Ethernet72',

@juztas
Copy link
Collaborator Author

juztas commented May 24, 2024

I think the right thing to do, would be to ensure we have isAlias pointing back (so that switch port has isAlias and also host port has it too). For reference: sdn-sense/siterm#524

For host port URI - yes, please - it would be easier mapping back

@xi-yang
Copy link
Collaborator

xi-yang commented May 24, 2024

It doesn't really matter. One way isAlias is perfectly fine for SENSE model. It may be inconvenient in some cases but the opposite can said for some other cases.

@juztas
Copy link
Collaborator Author

juztas commented May 28, 2024

No peer issue was of unavailable port - that port was removed from siterm fe - but not cleaned.

@juztas juztas closed this as completed May 28, 2024
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