weizhouapache commented on issue #11607: URL: https://github.com/apache/cloudstack/issues/11607#issuecomment-3284320633
> I tried luck with AI, and after analyzing CloudStack sources it stated: > > > The vRouter IP assignment and storage process in shared networks operates completely independently from the user_ip_address table. There is no automatic update to the user_ip_address table's allocation status when a vRouter receives an IP address in a shared network, as these serve different purposes in CloudStack's IP management system. > > After additional clarification requests: > > > Based on my research, no, "Saving placeholder nic" for vRouter also does NOT update the user_ip_address table. > > "Saving placeholder nic" Process: > > What it does: > > Creates a placeholder NIC entry in the nics table > > Assigns an IPv4 address to the vRouter's network interface > > Reserves the IP address for the vRouter within the shared network > > What it does NOT do: > > Does NOT update the user_ip_address table > > Does NOT change any allocation status in user_ip_address > > And from another AI: > > > What actually touches user_ip_address is the IP allocation path in IpAddressManagerImpl (e.g., when a new IP is needed). In 4.21, assignAndAllocateIpAddressEntry sets fields like allocatedToAccountId, associatedWithNetworkId, vpcId, state, and then calls markPublicIpAsAllocated—that’s the bit that updates the user_ip_address table.  > > > By contrast, the “placeholder NIC” flow in DirectPodBasedNetworkGuru#getIp() first tries to reuse an IP by reading user_ip_address (_ipAddressDao.findByIpAndSourceNetworkId), and only if no IP is present does it call the allocator. After that it logs “Saving placeholder nic with ip4 address …” and saves a NIC entry for the VR; this step doesn’t modify user_ip_address. > > Could you verify that anything in vRouter IP assignment updates user_ip_address (according to AIs nothing) > > And thank you for your involvement, very appreciated. @akrasnov-drv saving placeholder nic does not update user_ip_address. however, right before it, ACS allocates the IP to the VR and update user_ip_address. so, we can see two nics created at same time ``` mysql> select id,instance_id,mac_address,ip4_address,mode,state,strategy,created from nics where id>=45 and id <=46; +----+-------------+-------------------+----------------+------+--------------+-------------+---------------------+ | id | instance_id | mac_address | ip4_address | mode | state | strategy | created | +----+-------------+-------------------+----------------+------+--------------+-------------+---------------------+ | 45 | NULL | NULL | 172.16.100.100 | NULL | Reserved | PlaceHolder | 2025-09-11 10:00:33 | | 46 | 24 | 1e:00:68:00:00:29 | 172.16.100.100 | Dhcp | Deallocating | Create | 2025-09-11 10:00:33 | +----+-------------+-------------------+----------------+------+--------------+-------------+---------------------+ 2 rows in set (0.00 sec) ``` the Public IP is also Allocated at the same time ``` mysql> select id,uuid,account_id,domain_id,public_ip_address,allocated,state from user_ip_address where public_ip_address like "172.16.100.100"; +----+--------------------------------------+------------+-----------+-------------------+---------------------+-----------+ | id | uuid | account_id | domain_id | public_ip_address | allocated | state | +----+--------------------------------------+------------+-----------+-------------------+---------------------+-----------+ | 21 | 2c46b121-3cce-4257-b0a9-702464b9a99f | 1 | 1 | 172.16.100.100 | 2025-09-11 10:00:33 | Allocated | +----+--------------------------------------+------------+-----------+-------------------+---------------------+-----------+ 1 row in set (0.01 sec) ``` -- 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]
