Skip to content

listNetworkOfferings api does not handle phyiscal network tags correctly #6747

Closed

Description

@samapraku
ISSUE TYPE
  • Bug Report
COMPONENT NAME
API, UI
CLOUDSTACK VERSION
4.17.0.1
CONFIGURATION

Advanced Network

OS / ENVIRONMENT

Ubuntu 20.04

SUMMARY

listNetworkOfferings api endpoint does not handle physical network tags correctly.

When creating a new Shared Guest network and a Physical network is selected, which has tags, the network offerings list in the dropdown is always empty

However, if the selected physical network does not have tags, the network offerings are populated

STEPS TO REPRODUCE

Create a Physical network with and without tags

In Networks -> Guest Network -> Add Network -> Shared

If the physical network has tags, the network offering dropdown is always empty.

Or make a listNetworkOfferings api request and pass a zoneid that has physical network that has no tags.

Issue likely caused by this line:

if (isTagged != null) {
            if (isTagged) {
                sc.addAnd("tags", SearchCriteria.Op.NNULL);
            } else {
                sc.addAnd("tags", SearchCriteria.Op.NULL);
            }
        }
EXPECTED RESULTS
When a physical network has tags, listNetworkOfferings should take the tags into account
ACTUAL RESULTS

listNetworkOfferings always return empty when a physical network has tags


Activity

  1. boring-cyborg commented on Sep 18, 2022

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. Pearl1594 commented on Sep 19, 2022

    @Pearl1594
    Contributor

    @samapraku Can you please confirm if for the given physical network, (Zone -> Specific Zone -> Physical Network (sub Tab) -> Specific Physical Network -> Network Service Providers (sub Tab) ) the necessary service providers enabled i.e, Virtual Router,etc? If not, can you enable the virtualrouterelement (via cmk, using configure virtualrouterelement cmd and you can get the id of the virtual router element, using list virtualrouterelements), once You've enabled the virtualrouterelement, enable the network service provider via UI.

  3. samapraku commented on Sep 19, 2022

    @samapraku
    Author

    @Pearl1594 These are already enabled under Network service providers

    BaremetalPxeProvider, InternalLbVm, VirtualRouter, and VpcVirtualRouter

  4. Pearl1594 commented on Sep 19, 2022

    @Pearl1594
    Contributor

    Thanks for confirming. Do the network offerings have the same tags as set for the physical network?

  5. samapraku commented on Sep 19, 2022

    @samapraku
    Author

    Yes. Even when the same tags are set, the api still returns empty. If you look at the code snippet I added to the report, you will notice that that the if condition is redundant since both if and else blocks are doing the same thing

  6. samapraku commented on Sep 19, 2022

    @samapraku
    Author

    I tried both from the UI and also with cmk and got same results

  7. moved this to Triaged in ACS Backlogon Sep 28, 2022
  8. self-assigned this
    on Jan 4, 2023
  9. weizhouapache commented on Jan 5, 2023

    @weizhouapache
    Member

    @samapraku
    I tried to reproduce the issue with latest main branch but failed.

    both api/ui work for me.

    (localcloud) 🐱 > list networkofferings tags=test zoneid=7c9769a1-ba70-4f3a-a976-5a6ae7d946bb state=Enabled filter=id,name,tags
    {
      "count": 1,
      "networkoffering": [
        {
          "id": "3db2b279-db80-40c5-a013-c1b236194641",
          "name": "test-tag",
          "tags": "test"
        }
      ]
    }
    

    can you share the results of your cmk commands ?

  10. weizhouapache commented on Jan 5, 2023

    @weizhouapache
    Member

    if (isTagged) {
    sc.addAnd("tags", SearchCriteria.Op.NNULL);
    } else {
    sc.addAnd("tags", SearchCriteria.Op.NULL);
    }
    }

    @samapraku
    this is fine. You may not notice the difference between NNULL and NULL

  11. added this to the 4.18.1.0 milestone on Jan 9, 2023
  12. removed their assignment
    on Feb 14, 2023
  13. kiranchavala commented on Aug 7, 2023

    @kiranchavala
    Member

    Unable to reproduce the issue,

    @samapraku Please check if the network offering contains the same tag as the physical networks,

    Please let us know if we can close the issue

  14. weizhouapache commented on Aug 15, 2023

    @weizhouapache
    Member

    @samapraku
    can you test with 4.18.0.0 ?
    I am closing this issue. If you still face same issue, please reopen the issue

    (could be related to #6781)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions