Change in awsapi to get Default Zone for the account during runInstances, CreateVolume etc.

- If zoneName is specified we use that
- If not, we choos the default zone marked for the account
- If no such default zone is found, fall back to choosing the first available zone.
This commit is contained in:
prachi 2012-05-08 12:23:15 -07:00
parent af3758eb62
commit 48573deb1f
1 changed files with 6 additions and 0 deletions

View File

@ -1646,7 +1646,13 @@ public class EC2Engine {
if ( null != zoneName) {
interestedZones = new String[1];
interestedZones[0] = zoneName;
}else {
CloudStackZone zone = findZone();
if(zone != null){
return zone.getId();
}
}
zones = listZones(interestedZones, domainId);
if (zones == null || zones.getZoneIdAt( 0 ) == null)