You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by "kiranchavala (via GitHub)" <gi...@apache.org> on 2024/06/03 06:57:43 UTC

[D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

GitHub user kiranchavala created a discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

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](https://github.com/apache/cloudstack/assets/1401014/fba32dbd-f353-4b90-bca6-32988b51a9b2)

3. 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

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


**Bug part**


5. 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 


GitHub link: https://github.com/apache/cloudstack/discussions/9162

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by Marty Godsey <ma...@rudio.net>.
It would be amazing to be able to hide disabled offerings (network, compute, etc.).

Also, it would it be an easy method to just have it as permission. Something like “Ability to see hidden offerings”?

I know you can get more complicated, but this could be a starting point.

From: alexandremattioli (via GitHub) <gi...@apache.org>
Date: Monday, June 3, 2024 at 3:00 AM
To: users@cloudstack.apache.org <us...@cloudstack.apache.org>
Subject: Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]
WARNING: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


GitHub user alexandremattioli added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

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

GitHub link: https://atpscan.global.hornetsecurity.com/index.php?atp_str=YQpJg9SbMLdimdBz7MFfbCdFsuHiIOJQuohYUEj7txCFKLESsdv-MhFdu_l1r0wzdOqtXKbR_vTM6y0vbeTIJcSAiCNB7oH2RsZUDKNEUN2L_VFfcvbbOCN7gzWoMoMRnCHjwJ0oV7YyZaXJi6ZfcrBMix2tQVsF3Rbs6l3P7pkXaA1ZCy33pKgZsZw9otgnmf1KJ68J5tDcZmRBiyxOwrlTj7Uymq7acxDBkU80qU75KFR1JAdfv6oWh8sAQ4N4GVOHm-EJ_JlS0s9jgUNhWpcce-hkTiJzHCfdCFdyHvmvYxbGS5Z_yQlW99ZmH4LTWfHPv2HqfHf0PeZgCaaHUbjVuAv-gw2c4akFRyYzgZG7BlftduglnfFDUeRZok-tyk_r2CNoeZQjEuUjOjojqV_mYNR1lILlnOZUIzo6I0JFlgszt8bKQbBGebs5NQs

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org

Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
GitHub user weizhouapache added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

> 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.

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643961

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
GitHub user DaanHoogland added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

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.

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643960

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "kiranchavala (via GitHub)" <gi...@apache.org>.
GitHub user kiranchavala added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

@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

2.  Execute list networks

cmk>  list networks name=test

The output is displayed correctly

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

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


4. Execute the list network api call again 

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

No response


5.  Create a new network  say test2

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

6. 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",
```

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643963

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
GitHub user shwstppr added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

@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, https://github.com/apache/cloudstack/commit/bbf5a912c61c42587f4403ea6f64301d421d3204

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643964

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
GitHub user DaanHoogland added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

@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?

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643958

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "TadiosAbebe (via GitHub)" <gi...@apache.org>.
GitHub user TadiosAbebe added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

@shwstppr @DaanHoogland @weizhouapache  I came across this issue today and I believe @kiranchavala raised a valid point. I disabled the `Display Network` parameter on a network as a ROOT admin and it disappeared from the list of networks in the UI even when logged in as the ROOT Admin.

I also verified this using cmk, it is the same thing, executing the above mentioned `list networks displaynetwork=false filter=name,displaynetwork` doesn't list the network either. 

The only way I was able to make the network visible without knowing the network id was to set the display_network network value back to  1 on Cloudstack database. 

If i had known the network id the `update network` cmk command would work without an issue `update network id=c2716c0b-95cb-4c86-bf65-61ed7870fdf4 displaynetwork=true`

IMO, the display network parameter shouldn't affect the visibility for the Root admin (as its label suggest it should only affect the End user). However, even if the current behavior is intentional, the CMK command should still be able to list networks where display_network=0.

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-16706675

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "alexandremattioli (via GitHub)" <gi...@apache.org>.
GitHub user alexandremattioli added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

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

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643962

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org


Re: [D] Provide the option of disabling/Enabling Shared/Isolated/L2 networks, [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
GitHub user weizhouapache added a comment to the discussion: Provide the option of disabling/Enabling Shared/Isolated/L2 networks,

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

GitHub link: https://github.com/apache/cloudstack/discussions/9162#discussioncomment-9643959

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@cloudstack.apache.org