Skip to content

Provide the option of disabling/Enabling Shared/Isolated/L2 networks,  #8442

Description

@kiranchavala

ISSUE TYPE

Enhancement/Improvement Request /Bug

COMPONENT NAME

Component: API/ UI

CLOUDSTACK VERSION

Cloudstack version 4.18,

SUMMARY

Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

Steps to reproduce the issue

  1. Create a Shared network

  2. Click on edit network

displaynetwork

  1. Currently, the only option is to use the updateNetwork api call and update the parameter "displaynetwork" or perform the action from UI

https://cloudstack.apache.org/api/apidocs-4.18/apis/updateNetwork.html

  1. But once the network is displaynetwork is set to true, there is no option to enable it back from UI

Bug part

  1. Also listNetwork api call doesn't list the networks where displaynetwork is set even when the listall parameter is passeed

https://cloudstack.apache.org/api/apidocs-4.18/apis/listNetworks.html

list networks filter=name,displaynetwork, listall=true

Expected behavior

It would be great, if we can add enable/disable network option or provide an option to disable the display network, in the UI

or show some sort of filter column in the Ui for the list network page.

Currently the admin user has update the database or execute the api call to display the network back again

Activity

  1. added this to the unplanned milestone on Jan 22, 2024
  2. DaanHoogland commented on Jan 22, 2024

    @DaanHoogland
    Contributor

    @alexandremattioli can you comment
    @kiranchavala I see some discrepancies in your description, though I think there is some merit to this issue. Can you check and improve it?

  3. weizhouapache commented on Jan 22, 2024

    @weizhouapache
    Member

    display or not-display, not enable/disable, right ?

  4. DaanHoogland commented on Jan 23, 2024

    @DaanHoogland
    Contributor

    yes @weizhouapache ,

    to allow to undo the on-display flag, we must display it, so an exemption to the non-display directive must be defined to do that. A trivial solution is the non-display networks are visible to admins, but then again they would have to not see them during deploy... I think this is overcomplicated for what we are trying to achieve for the user.

  5. weizhouapache commented on Jan 23, 2024

    @weizhouapache
    Member

    yes @weizhouapache ,

    to allow to undo the on-display flag, we must display it, so an exemption to the non-display directive must be defined to do that. A trivial solution is the non-display networks are visible to admins, but then again they would have to not see them during deploy... I think this is overcomplicated for what we are trying to achieve for the user.

    yes
    we could add a switch button next to the "Projects". this is only for root admins, and applies on other resources (volumes, vm, etc) as well.
    for the non-display networks, since they are not displayed, they should not be in the list of networks in vm deployment.

  6. alexandremattioli commented on Feb 2, 2024

    @alexandremattioli
    Contributor

    @kiranchavala I'm struggling to see the use case.
    Is the idea to disable a network so no new VMs can use it?

  7. kiranchavala commented on Feb 9, 2024

    @kiranchavala
    MemberAuthor

    @alexandremattioli @DaanHoogland @weizhouapache

    From the Ui point of view

    As an admin user from the UI if I can disable "Display network" for a particular network. The admin user must also have the option to enable the "Display network" back.


    The bug related to the issue is

    Steps to reproduce the bug.

    1. Create a isolated network

    cmk > create network name=test networkofferingid=1f106372-654f-40ab-abe4-c0258e1b51f1 zoneid=412fd1ab-8341-4fef-9d94-c178fd816613

    1. Execute list networks

    cmk> list networks name=test

    The output is displayed correctly

    1. Update the network to disable the "Display network"

    cmk >update network displaynetwork=false id=9ba79732-9e85-4f21-8af0-c930cece8010

    1. Execute the list network api call again

    cmk > list networks name=test
    cmk > list networks listall=true

    No response

    1. Create a new network say test2

    cmk > create network name=test2 networkofferingid=1f106372-654f-40ab-abe4-c0258e1b51f1 zoneid=412fd1ab-8341-4fef-9d94-c178fd816613

    1. Execute the list network api call again name as test

    cmk > list networks name=test

    The api response displays that of test2 network which is incorrect

    
    {
      "count": 1,
      "network": [
        {
          "account": "admin",
          "acltype": "Account",
          "broadcastdomaintype": "Vlan",
          "canusefordeploy": true,
          "cidr": "10.1.1.0/24",
          "created": "2024-02-09T10:08:33+0000",
          "details": {},
          "displaynetwork": true,
          "displaytext": "kiranisoaltednet2",
          "dns1": "10.0.32.1",
          "dns2": "8.8.8.8",
          "domain": "ROOT",
          "domainid": "6bd03bc7-c649-11ee-a7b4-1e006b0003e2",
          "egressdefaultpolicy": false,
          "gateway": "10.1.1.1",
          "hasannotations": false,
          "id": "abd4fd9c-7e9b-4662-b413-df55d0c76921",
          "ispersistent": false,
          "issystem": false,
          "name": "test2",
    
  8. modified the milestones: unplanned, 4.20.0.0 on Apr 30, 2024
  9. shwstppr commented on May 9, 2024

    @shwstppr
    Contributor

    @kiranchavala and others If I'm understanding it right I guess we are mixing listall functionality with displaynetwork functionality.
    displaynetwork param description says an optional field, whether to the display the network to the end user or not.
    It is an admin only parameter to allow making network not viewable to the end user.

    Later admin can list such networks using API, passing the same network:

    > list networks displaynetwork=false filter=name,displaynetwork,
    {
      "count": 1,
      "network": [
        {
          "displaynetwork": false,
          "name": "hidden-nw"
        }
      ]
    }
    

    Also, Kiran there is no param name in listNetworks API.

    IMO, list* apis should list all resources for root admins irrespective of the value of displaynetwork, displayvm, displayvolume fields but we have prevented that for all types of accounts for a long, bbf5a91

  10. locked and limited conversation to collaborators on Jun 3, 2024
  11. converted this issue into a discussion #9162 on Jun 3, 2024
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