Skip to content

Conversation

@rohityadavcloud
Copy link
Member

@rohityadavcloud rohityadavcloud commented Mar 25, 2019

Problem: Admins don’t want to charge for IP address usage on certain (shared) networks.
Root Cause: There is no flag or detail for admins to provide using UI or API when creating networks to specify if they want IP address usage of the network hidden.
Solution: A new boolean hideipaddressusage flag is added to the createNetwork API and a checkbox in the ‘Add guest network’ UI for the root admins to specify if they want the shared network’s IP address usage to be hidden in the listUsageRecords API response. The provided flag is saved as the ‘hideIpAddressUsage’ detail in the cloud.network_details table for the network. For existing (shared) networks, root admins can also specify the same boolean API parameter hideipaddressusage with the updateNetwork API request to configure the behaviour for an existing network. When the detail/flag is true, the IP address usage for the (shared) network is not exported in the listUsageRecords API response. The listNetworks API response will include the details of a network for root admin only. (note usage is still recorded in the usage database but not return by the listUsageRecords API)

The API flag works for any kind of network via the API, but the checkbox is only shown while creating shared networks in the UI.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

This adds a new API arg only accessible to admins to specify if they
want the network's ip address usage hidden. This then saves this setting
in the network_details table for a network, and the listUsageRecords
API response creator checks for an IP address if it needs to be exported
or skipped/hidden.

The setting is available only to root admin via the listNetworks API response (details key).
Root admin can also update existing networks by using updateNetwork API and passing hideipaddressusage=true|false

UI screenshot, that adds this checkbox only for admins creating a shared network:
51316923-21645080-1a7c-11e9-8c78-9769aa84b7c1

**note: it's possible for all other kinds of networks to have their ip address usages skipped as well, available via the API.

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2649

@rohityadavcloud rohityadavcloud changed the title network: allow ability to specify if network's ipaddress usage need to be hidden [WIP DO NOT MERGE] network: allow ability to specify if network's ipaddress usage need to be hidden Mar 29, 2019
@rohityadavcloud rohityadavcloud force-pushed the hide-network-usage-in-api-response branch from 1814828 to ea8343b Compare April 1, 2019 10:31
@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2664

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, IP usage record is now displayed or not depending on the flag of the network
@blueorangutan test

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-3460)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 25349 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3235-t3460-kvm-centos7.zip
Smoke tests completed. 70 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@apache apache deleted a comment from blueorangutan May 30, 2019
@apache apache deleted a comment from blueorangutan May 30, 2019
@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2824

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-3628)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32229 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3235-t3628-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 69 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_04_rvpc_network_garbage_collector_nics Failure 296.72 test_vpc_redundant.py

Copy link
Member

@PaulAngus PaulAngus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM manually tested, when hideipaddressusage = true ip usage for the designated network is not shown (list networkusage usagetype=3 )

@rohityadavcloud rohityadavcloud changed the title [WIP DO NOT MERGE] network: allow ability to specify if network's ipaddress usage need to be hidden network: allow ability to specify if network's ipaddress usage need to be hidden Jun 19, 2019
@rohityadavcloud rohityadavcloud merged commit 0e87040 into apache:master Jun 19, 2019
@olivierlemasle olivierlemasle mentioned this pull request Sep 7, 2020
5 tasks
olivierlemasle added a commit to olivierlemasle/cloudstack that referenced this pull request Sep 14, 2020
With this commit, listUsageRecords filters out usages made on
IP addresses on networks with "Hide IP Address Usage". This was
previously introduced in apache#3235.

This requires a DB schema change, to introduce a flag is_hidden
in table cloud_usage.cloud_usage.
olivierlemasle added a commit to olivierlemasle/cloudstack that referenced this pull request Sep 14, 2020
With this commit, listUsageRecords filters out usages made on
IP addresses on networks with "Hide IP Address Usage". This was
previously introduced in apache#3235.

This requires a DB schema change, to introduce a flag is_hidden
in table cloud_usage.cloud_usage.
olivierlemasle added a commit to olivierlemasle/cloudstack that referenced this pull request Oct 30, 2020
With this commit, listUsageRecords filters out usages made on
IP addresses on networks with "Hide IP Address Usage". This was
previously introduced in apache#3235.

This requires a DB schema change, to introduce a flag is_hidden
in table cloud_usage.cloud_usage.
olivierlemasle added a commit to apalia/cloudstack that referenced this pull request Nov 6, 2020
With this commit, listUsageRecords filters out usages made on
IP addresses on networks with "Hide IP Address Usage". This was
previously introduced in apache#3235.

This requires a DB schema change, to introduce a flag is_hidden
in table cloud_usage.cloud_usage.
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

Successfully merging this pull request may close these issues.

4 participants