rakgenius commented on issue #3775: New feature: Acquire specific public IP for network URL: https://github.com/apache/cloudstack/pull/3775#issuecomment-567969213 > > > Code looks good. Haven't tested though. > > > One question - When the IP Address requested is invalid or unavailable in `user_ip_address` do we add that reason in exception or log it? (could'nt see it). > > > > > > The dropdown displays only the "Free" IP's available in that particular network or VPC. If there are not free IP in that network/VPC then it wont display the drop down list > > But that doesn't cover API usage outside UI @rakgenius , which is how a large number of users access CS. @anuragaw Just tested it and if the IP is already allocated, it will throw ```Insufficient address capacity``` exception ``` (local) 🐵 > associate ipaddress networkid=6efa8597-d5e8-4bf6-8686-3db26d568ed1 ipaddress=10.11.113.150 { "accountid": "9c185c1d-00b2-11ea-a7cf-069f80000fac", "cmd": "org.apache.cloudstack.api.command.admin.address.AssociateIPAddrCmdByAdmin", "completed": "2019-12-20T15:38:35+0000", "created": "2019-12-20T15:38:35+0000", "jobid": "ca7f3410-a1be-43ec-880e-448facff96c7", "jobinstanceid": "f7a584ca-8a3c-4f72-b647-c92ed31397aa", "jobinstancetype": "IpAddress", "jobprocstatus": 0, "jobresult": { "ipaddress": { "account": "test", "allocated": "2019-12-20T15:38:35+0000", "associatednetworkname": "test", "domain": "test", "fordisplay": true, "forvirtualnetwork": true, "id": "f7a584ca-8a3c-4f72-b647-c92ed31397aa", "ipaddress": "10.11.113.150", "isportable": false, "issourcenat": false, "isstaticnat": false, "issystem": false, "state": "Allocating", "tags": [], "vlanname": "vlan://untagged", "zonename": "zone113-2" } }, "jobresultcode": 0, "jobresulttype": "object", "jobstatus": 1 } ``` ``` (local) 🐵 > associate ipaddress networkid=6efa8597-d5e8-4bf6-8686-3db26d568ed1 ipaddress=10.11.113.150 Error 533: Insufficient address capacity ``` ``` 2019-12-20 15:42:35,163 WARN [c.c.n.IpAddressManagerImpl] (qtp858242339-18:ctx-9d0b2eb1 ctx-a86c335b) (logid:5b743076) Unable to get ip address in zone id=1, vlanId id=[1]: requested ip 10.11.113.150 is not available 2019-12-20 15:42:35,264 TRACE [o.a.c.a.c.u.a.AssociateIPAddrCmd] (qtp858242339-18:ctx-9d0b2eb1 ctx-a86c335b) (logid:5b743076) com.cloud.exception.InsufficientAddressCapacityException: Insufficient address capacityScope=interface com.cloud.dc.DataCenter; id=1 2019-12-20 15:42:35,264 INFO [c.c.a.ApiServer] (qtp858242339-18:ctx-9d0b2eb1 ctx-a86c335b) (logid:5b743076) Insufficient address capacity ```
---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services