From 48573deb1f945d8d663ba4d5b7262fa608e9ff3f Mon Sep 17 00:00:00 2001 From: prachi Date: Tue, 8 May 2012 12:23:15 -0700 Subject: [PATCH] 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. --- awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java index 5bbc1057faf..34c452e9164 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java @@ -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)