Re: [API]How to check how many IPs are available in guest network

2014-06-17 Thread Chiradeep Vittal
...@citrix.com>> Date: Tuesday, June 17, 2014 at 10:49 PM To: "dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>" mailto:dev@cloudstack.apache.org>> Subject: Re: [API]How to check how many IPs are available in guest network Not sure I understand. Would this be a

Re: [API]How to check how many IPs are available in guest network

2014-06-17 Thread Chiradeep Vittal
Tuesday, June 17, 2014 at 6:39 PM To: "dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>" mailto:dev@cloudstack.apache.org>> Subject: Re: [API]How to check how many IPs are available in guest network Chiradeep, So i did a little more digging in your example, I als

Re: [API]How to check how many IPs are available in guest network

2014-06-17 Thread ilya musayev
Chiradeep, So i did a little more digging in your example, I also realized you code has assumption that i have /24 entirely dedicated to CloudStack :) Welcome to enterprise madness where IP space, while being internal and free - is close guarded and restricted. Do we have a concept of IP P

Re: [API]How to check how many IPs are available in guest network

2014-06-16 Thread Wei ZHOU
try adding listall=true to cloudmonkey command? 2014-06-17 7:44 GMT+02:00 ilya musayev : > It returns nothing, just a blank like. > > I will be upgrading our CloudStack instances this week to see if the issue > still persists with 4.3.0, but i dont believe it will change my result. > > > On 6/16

Re: [API]How to check how many IPs are available in guest network

2014-06-16 Thread ilya musayev
It returns nothing, just a blank like. I will be upgrading our CloudStack instances this week to see if the issue still persists with 4.3.0, but i dont believe it will change my result. On 6/16/14, 10:14 PM, Chiradeep Vittal wrote: Can you explain "does not work" -- Chiradeep On Jun 16, 2

Re: [API]How to check how many IPs are available in guest network

2014-06-16 Thread Chiradeep Vittal
Can you explain "does not work" -- Chiradeep > On Jun 16, 2014, at 10:02 PM, "ilya musayev" > wrote: > > Thanks Chiradeep and Wei > > Unfortunately neither gave me what i needed, so i wrote this SQL script: > > SELECT b.name, count(*) FreeIPCount > FROM cloud.user_ip_address a, cloud.network

Re: [API]How to check how many IPs are available in guest network

2014-06-16 Thread ilya musayev
Thanks Chiradeep and Wei Unfortunately neither gave me what i needed, so i wrote this SQL script: SELECT b.name, count(*) FreeIPCount FROM cloud.user_ip_address a, cloud.networks b WHERE b.id=a.source_network_id AND a.state = "Free" and b.name is not null group by b.name; Chiradeep, for some re

Re: [API]How to check how many IPs are available in guest network

2014-06-16 Thread Chiradeep Vittal
used=$(cloudmonkey list virtualmachines networkid=f5119c7a-a5b8-47aa-bf26-d0f41dfa2d6b | grep ipaddress | wc -l) space=$(cloudmonkey list networks id=f5119c7a-a5b8-47aa-bf26-d0f41dfa2d6b | grep cidr | awk -F":" '{print $2}' | awk -F "/" '{print $2}') space=${space%\",} let space="32 - $space" let

Re: [API]How to check how many IPs are available in guest network

2014-06-16 Thread Wei ZHOU
lisPublicIpAddresses can list all public ips in a shared network, or public ips used in isolated network. state=Free means the ip is available. 2014-06-16 21:21 GMT+02:00 ilya musayev : > Is there a way to check how many guest IPs are available in specific guest > network? > > Current cloudstac