Skip to content

Enhancement: Allow creating network with duplicate name#3807

Merged
yadvr merged 1 commit into
apache:masterfrom
ravening:network_enhancements
Jan 31, 2020
Merged

Enhancement: Allow creating network with duplicate name#3807
yadvr merged 1 commit into
apache:masterfrom
ravening:network_enhancements

Conversation

@ravening
Copy link
Copy Markdown
Member

Add a global setting to disable creating networks with
same name in an account

Add a global setting to disable creating network without
mentioning the start and end IPv4 or IPv6 address

Description

By default we can create networks with the same name in the account. Sometimes we should not create the networks with same name. This change adds a global setting which prevents creating the network with same name. The default value is true and set it to false to prevent creating network with same names.

Also its possible to create a shared network without mentioning the start and the end IPv4 or IPv6 address. This change adds a global setting which prevents creating a shared network without specifying the start and the end IPv4 or IPv6 address

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)

Screenshots (if appropriate):

How Has This Been Tested?

Creating a network with same names
1 . Set the global setting allow.duplicate.networkname to true
2. Create a new network with the name "test".
3. Try to create another network with the same name. This should create the second network with the same name
4. Now set the above global setting value to false
5. Try to create another network with same name.
6. No exception will be thrown while creating the network with same name

Creating a network without specifying the start and end IPv4 or IPv6 address

  1. Set the global setting allow.empty.start.end.ipaddress to true
  2. Create a shared network without mentioning the start and the end IPv4 or IPv6 address
  3. You will be able to create network successfully
  4. Now set the above global setting value to false
  5. Try to create another shared network without mentioning the start or the end IPv4 or IPv6 address
  6. An exception will be thrown while creating the shared network

Comment thread server/src/main/java/com/cloud/network/NetworkServiceImpl.java Outdated
@ravening ravening force-pushed the network_enhancements branch from 17b087d to 43a5b71 Compare January 14, 2020 13:19
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

nioce code
tests included
pudding needs eating

@wido wido self-requested a review January 15, 2020 20:19
Copy link
Copy Markdown
Contributor

@wido wido left a comment

Choose a reason for hiding this comment

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

LGTM based on code

@ravening
Copy link
Copy Markdown
Member Author

@DaanHoogland can this be merged?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

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

@apache apache deleted a comment from blueorangutan Jan 22, 2020
@apache apache deleted a comment from blueorangutan Jan 22, 2020
@DaanHoogland
Copy link
Copy Markdown
Contributor

@ravening "pudding needs eating" so i am starting a full regression suite. (if it comes back good i'm fine with it.)

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-652

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File

@DaanHoogland
Copy link
Copy Markdown
Contributor

I am not investing time in testing this now, but regrtession passes on all platforms. feel free to merge, @wido @weizhouapache ?

"allow.duplicate.networkname", "true", "Allow creating networks with same name in account", true, ConfigKey.Scope.Account);
private static final ConfigKey<Boolean> AllowEmptyStartEndIpAddress = new ConfigKey<Boolean>("Advanced", Boolean.class,
"allow.empty.start.end.ipaddress", "true", "Allow creating network without mentioning start and end IP address",
true, ConfigKey.Scope.Account);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ravening for backward compatibility, should this be false?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@rhtyd In the current/default behavior we can create network without mentioning the start and end IP address. So the default value is "true". If the default value is "false" then it means we cant create a network with an empty start and end IP address which is not backward compatible.

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 29, 2020

@ravening if the newly added test test/integration/component/test_network_create_with_dup_name.py does not take more than 5-10mins to run, please move it under smoke and also add to Travis (see `.travis.yml).

Add a global setting to disable creating networks with
same name in an account

Add a global setting to disable creating network without
mentioning the start and end IPv4 or IPv6 address

By default we can create networks with the same name in the account.
Sometimes we should not create the networks with same name.
This change adds a global setting which prevents creating the network with same name.
The default value is true and set it to false to prevent creating network with same names.

Also its possible to create a shared network without mentioning the
start and the end IPv4 or IPv6 address.
This change adds a global setting which prevents creating a shared
network without specifying the start and the end IPv4 or IPv6 address
@ravening ravening force-pushed the network_enhancements branch from 43a5b71 to 8525f77 Compare January 30, 2020 08:59
@ravening
Copy link
Copy Markdown
Member Author

@ravening if the newly added test test/integration/component/test_network_create_with_dup_name.py does not take more than 5-10mins to run, please move it under smoke and also add to Travis (see `.travis.yml).

@rhtyd moved the marvin test to smoke folder and added an entry in travis.yml as well

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 31, 2020

Thanks @ravening I'll merge this as soon as Travis (simulator) passes (rekicked the job).

@yadvr yadvr added this to the 4.14.0.0 milestone Jan 31, 2020
@yadvr yadvr merged commit a2a4968 into apache:master Jan 31, 2020
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
Add a global setting to disable creating networks with same name in an account

Add a global setting to disable creating network without
mentioning the start and end IPv4 or IPv6 address

By default we can create networks with the same name in the account.
Sometimes we should not create the networks with same name.
This change adds a global setting which prevents creating the network with same name.
The default value is true and set it to false to prevent creating network with same names.

Also its possible to create a shared network without mentioning the
start and the end IPv4 or IPv6 address.
This change adds a global setting which prevents creating a shared
network without specifying the start and the end IPv4 or IPv6 address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants