Uploaded image for project: 'Fast Datapath Product'
  1. Fast Datapath Product
  2. FDP-1463

[ovn-nbctl] Add a pg-list command to list port group contents in a human friendly interface.

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • ovn25.09
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide

      Given a port group pg1 with LSPs p1, p2, p3,

      When the system administrator runs ovn-nbctl pg-list pg1,

      Then the output should be a human-readable string: pg1: p1, p2, p3

      Show
      Given a port group pg1 with LSPs p1, p2, p3, When the system administrator runs ovn-nbctl pg-list pg1, Then the output should be a human-readable string: pg1: p1, p2, p3
    • ovn25.09-25.09.0-alpha.191.el9fdp
    • rhel-9
    • None
    • OVN FDP Sprint 5
    • 1
    • +

      Assuming a few logical switches are configured, each with a few ports:

      $ ovn-nbctl ls-add ls1
      $ ovn-nbctl ls-add ls2
      $ ovn-nbctl lsp-add ls1 p1
      $ ovn-nbctl lsp-add ls1 p2
      $ ovn-nbctl lsp-add ls2 p3
      $ ovn-nbctl lsp-add ls2 p4
      

      ovn-nbctl allows users to manually create port groups while specifying actual port names:

      $ ovn-nbctl pg-add pg1 p1 p2 p3
      

      ovn-nbctl automatically translated the command to the correct transaction that creates "pg1" and sets its port list to the correct list of corresponding logical_switch_port uuids:

      $ ovn-nbctl list port_group pg1
      _uuid               : afe982d0-e2c8-49fa-961c-3a59615dc7a2
      acls                : []
      external_ids        : {}
      name                : pg1
      ports               : [1e470b02-46b7-4c46-b6c5-46e7962908c0, 8a50d035-8a02-43cd-89a1-4fd105927556, da83c9bc-baa6-4474-9903-b0a3a797f467]
      
      $ ovn-nbctl --columns _uuid,name list logical_switch_port 1e470b02-46b7-4c46-b6c5-46e7962908c0
      _uuid               : 1e470b02-46b7-4c46-b6c5-46e7962908c0
      name                : p2
      $ ovn-nbctl --columns _uuid,name list logical_switch_port 8a50d035-8a02-43cd-89a1-4fd105927556
      _uuid               : 8a50d035-8a02-43cd-89a1-4fd105927556
      name                : p3
      $ ovn-nbctl --columns _uuid,name list logical_switch_port da83c9bc-baa6-4474-9903-b0a3a797f467
      _uuid               : da83c9bc-baa6-4474-9903-b0a3a797f467
      name                : p1
      

      When debugging OVN issues it would be simpler if ovn-nbctl would also list ports configured in a port group in a human-friendly way, e.g.:

      Today:

      $ ovn-nbctl pg-get-ports pg1
      ovn-nbctl: unknown command 'pg-list'; use --help for help
      

      Potential output:

      $ ovn-nbctl pg-get-ports pg1
      p1, p2, p3
      

      We already have an `ovn-nbctl acl-list <PG>` command that lists all ACLs configured on a port group so it might not be necessary for the new `ovn-nbctl pg-get-ports` command to also list ACLs.

              rh-ee-moloings Mairtin Lynch
              dceara@redhat.com Dumitru Ceara
              Ehsan Elahi Ehsan Elahi
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 week
                  1w
                  Remaining:
                  Remaining Estimate - 1 week
                  1w
                  Logged:
                  Time Spent - Not Specified
                  Not Specified