+ iaasInfo.getName();
log.fatal(msg);
throw new CloudControllerException(msg);
}
TemplateBuilder templateBuilder = iaasInfo.getComputeService()
.templateBuilder();
// set image id specified
templateBuilder.imageId(iaasInfo.getImage());
if(!(iaasInfo instanceof IaasProvider)) {
templateBuilder.locationId(iaasInfo.getType());
}
if(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE) != null) {
Set<? extends Location> locations = iaasInfo.getComputeService().listAssignableLocations();
for(Location location : locations) {
if(location.getScope().toString().equalsIgnoreCase(CloudControllerConstants.ZONE_ELEMENT) &&
location.getId().equals(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE))) {
templateBuilder.locationId(location.getId());
log.info("ZONE has been set as " + iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE)
+ " with id: " + location.getId());
break;
}
}
}
if (iaasInfo.getProperty(CloudControllerConstants.INSTANCE_TYPE) != null) {
// set instance type eg: m1.large
templateBuilder.hardwareId(iaasInfo.getProperty(CloudControllerConstants.INSTANCE_TYPE));
}
// build the Template
Template template = templateBuilder.build();
if(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE) != null) {
if(!template.getLocation().getId().equals(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE))) {
log.warn("couldn't find assignable ZONE of id :" +
iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE) + " in the IaaS. " +