bernardodemarco opened a new pull request, #10568:
URL: https://github.com/apache/cloudstack/pull/10568

   ### Description
   
   Currently, when enabling static NAT or adding PF and LB rules to VPC public 
IPs, Apache CloudStack wrongly validates whether the account reached the limit 
of consumed public IPs. As a consequence of that, accounts that are with their 
public IP quota completely used, for example, are unable to execute such 
operations on VPCs public IPs.
   
   This PR fixes this bug by removing the validation of the amount of acquired 
public IPs when performing the above-mentioned operations. This validation has 
been moved to the method 
`com.cloud.network.IpAddressManagerImpl#markPublicIpAsAllocated`, in which the 
increment of resource count for public IPs is effectively performed.
   
   ---
   
   Fixes #10566
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] 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)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   1. Created an `User` account, called `u1`.
   2. Configured its limit of public IP addresses to 2.
   3. Created a VPC with the `u1` account, created a tier and deployed a VM on 
it.
   4. Acquired one additional public IP for the VPC. As a consequence of that, 
the `u1` account reached its limit of acquired public IPs.
   5. Before applying the PR changes, verified that it was not possible to 
enable static NAT and apply PF and LB rules to the VPC IP.
   6. After applying the PR changes, verified that it was possible to perform 
such operations.
   7. Executed the following scripts to verify that race conditions were not 
happening:
       ```bash
       #!/bin/bash
       for i in 15 16 17 18 19 20 21 22 23
       do
       cmk associate ipaddress zoneid=9bf00732-3355-4d81-aa0c-2206498db84a 
domainid=6b5335fb-4b6f-11ef-87b4-cec422422af1 account=u1 
networkid=d2e3c74c-c47f-4a29-9dcb-92ee2a30c1bb ipaddress=192.168.122.$i & 
       done
       ```
       ```bash
       #!/bin/bash
       for i in 16 17 18 19 20 21 22 23
       do
       cmk associate ipaddress zoneid=9bf00732-3355-4d81-aa0c-2206498db84a 
domainid=6b5335fb-4b6f-11ef-87b4-cec422422af1 account=u1 
vpcid=503ebaa3-002d-42c2-8e53-49bc5b899625 ipaddress=192.168.122.$i & 
       done
       ```
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to