rakgenius opened a new pull request #3780: Enhancement: Allow creating atmost 1 
physical network with null tag
URL: https://github.com/apache/cloudstack/pull/3780
 
 
   ## Description
   Currently, we can create multiple physical networks in the same traffic
   types with null tags. This feature will ensure that we can create at most
   1 physical network in the same traffic type with a null tag.
   
   Every physical network should be associated with a tag so that when we create
   a new shared network, using the tags we can match the shared network with
   the physical network
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the 
boxes that apply: -->
   - [ ] 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)
   - [X] 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?
   
   This feature has been tested through cloudmonkey commands
   
   First we need to ensure that there is a spare NIC in the hypervisor on which 
we can create a new
   physical network.
   
   We are going to create a bridge with name "cloudbr9" on this new interface
   
   
   1 . Create a physical network
   ```
   create physicalnetwork zoneid=76aecb3c-c246-4cf7-9410-1116596a26f7 
isolationmethods=VLAN name=TEST
   ```
   
   2 . Create another physical network without any tag
   ```
   create physicalnetwork zoneid=76aecb3c-c246-4cf7-9410-1116596a26f7 
isolationmethods=VLAN name=TEST-2
   ```
   
   3 . Now try to add traffic type to any of the physical network created 
above. This should fail since there are more than 1 physical network without 
any tags
   ```
   add traffictype physicalnetworkid=fed2091b-9db9-40be-be32-4bdc2c4cdd23 
traffictype=Guest kvmnetworklabel=cloudbr9
   
   
   Error 530: There are more than 1 physical network without tags in the zone= 1
   ```
   
   4 . Now add the tag to one of the physical network
   ```
   update physicalnetwork id=fed2091b-9db9-40be-be32-4bdc2c4cdd23 tags=NGN
   ```
   
   5 . Now we can successfully add the traffic type
   ```
    add traffictype physicalnetworkid=fed2091b-9db9-40be-be32-4bdc2c4cdd23 
traffictype=Guest kvmnetworklabel=cloudbr9
   
   
   cmd = org.apache.cloudstack.api.command.admin.usage.AddTrafficTypeCmd
   jobid = 15afffb2-c600-428a-a691-a7767a145e84
   jobinstanceid = 3995aec3-1cea-4f57-bce2-c99e34e54298
   jobinstancetype = TrafficType
   jobprocstatus = 0
   jobresult:
   traffictype:
   id = 3995aec3-1cea-4f57-bce2-c99e34e54298
   kvmnetworklabel = cloudbr9
   physicalnetworkid = fed2091b-9db9-40be-be32-4bdc2c4cdd23
   traffictype = Guest
   jobresultcode = 0
   jobresulttype = object
   jobstatus = 1
   ```
   
   6 .  If we try to update the network to delete the tags, it should fail 
because there is already another network without tag
   
   ```
   update physicalnetwork id=fed2091b-9db9-40be-be32-4bdc2c4cdd23 tags=Error
   
   Async job 7d1e9b8a-95d1-4dd3-be3d-125e314a6bd5 failed
   Error 530, There are more than 1 physical network without tags in the zone= 1
   
   cmd = 
org.apache.cloudstack.api.command.admin.network.UpdatePhysicalNetworkCmd
   jobid = 7d1e9b8a-95d1-4dd3-be3d-125e314a6bd5
   jobprocstatus = 0
   jobresult:
   errorcode = 530
   errortext = There are more than 1 physical network without tags in the zone= 
1
   jobresultcode = 530
   jobresulttype = object
   jobstatus = 2
   ```
   
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md)
 document -->
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to