nagaboinaramgopal commented on PR #14087:
URL: https://github.com/apache/cloudstack/pull/14087#issuecomment-5604454531

   > @nagaboinaramgopal have you reproduced the issue and verified the fix ?
   
   Yes, reproduced and verified live on a KVM advanced zone.
   
   Repro steps:
   
   1. Create an Isolated network offering with SpecifyIpRanges=true and no 
SourceNat (Dhcp and Dns via VirtualRouter), and enable it.
   2. Create an Isolated network from that offering with a /24 CIDR but a small 
direct IP range, e.g. gateway 10.199.50.1, netmask 255.255.255.0, startip 
10.199.50.10, endip 10.199.50.13 (4 addresses).
   3. Deploy VMs into it until the router plus the VMs use up that 4 address 
range.
   4. Deploy one more VM.
   
   Results, before this change:
   
       iso-b1   Running   ip=10.199.50.11
       iso-b2   Running   ip=10.199.50.13
       iso-b3   Running   ip=10.199.50.12
       (router holds 10.199.50.10, so the .10-.13 direct range is now full)
       iso-b4   FAILED    InsufficientAddressCapacityException
   
   Step 4 fails even though the /24 CIDR still has plenty of free addresses, 
because allocate() takes the allocateDirectIp path (direct pool) for the 
Isolated network and never uses the network CIDR:
   
   ```
       ERROR [c.c.v.UserVmManagerImpl] error during resource reservation and 
allocation com.cloud.exception.InsufficientAddressCapacityException: 
Insufficient address capacity Scope=interface com.cloud.dc.DataCenter; id=1
           at 
com.cloud.network.IpAddressManagerImpl.allocateDirectIp(IpAddressManagerImpl.java:2436)
           at 
com.cloud.network.guru.GuestNetworkGuru.allocate(GuestNetworkGuru.java:446)
           at 
com.cloud.network.guru.ExternalGuestNetworkGuru.allocate(ExternalGuestNetworkGuru.java:262)
           at 
org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.allocateNic(...)
   ```
   
   Results, after this change (same network, direct range still exhausted):
   
       iso-after2   Running   ip=10.199.50.9
   
   Step 4 now succeeds, and the VM gets 10.199.50.9 from the /24 CIDR, outside 
the exhausted 10.199.50.10-13 direct range, so allocation comes from the 
network CIDR as expected. Shared networks are unchanged. The unit test covers 
the same behaviour: for an Isolated network with SpecifyIpRanges, allocate() no 
longer calls allocateDirectIp.


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