diff --git a/src/cloud/ec2/lib/elastic_ip.rb b/src/cloud/ec2/lib/elastic_ip.rb index cc34771491..dcb6cc7b61 100644 --- a/src/cloud/ec2/lib/elastic_ip.rb +++ b/src/cloud/ec2/lib/elastic_ip.rb @@ -22,7 +22,7 @@ module ElasticIP return vnet end - ips = vnet.retrieve_elements('LEASES/LEASE[USED=0]/IP') + ips = vnet.retrieve_elements('AR_POOL/AR[USED_LEASES=0 and SIZE=1]/IP') if ips.nil? rc = OpenNebula::Error.new("There is no lease available to be allocated") rc.ec2_code = "AddressLimitExceeded" @@ -230,4 +230,4 @@ module ElasticIP user.info user.id end -end \ No newline at end of file +end