Did a quick fix to give priority to 'zone' over 'availabilityZone' when spinning instances.
On Wed, Nov 18, 2015 at 6:06 AM, Isuru Haththotuwa <isu...@apache.org> wrote: > AFAIU the reason for Stratos not picking the correct availability zone > from the NW partition is because we have the property name as > *availabilityZone > *in the cloud-controller.xml and *zone *in the cartridge definition. So, > it will not be overridden. > > On Wed, Nov 18, 2015 at 5:55 AM, Isuru Haththotuwa <isu...@apache.org> > wrote: > >> Hi Akila, >> >> Can you attach the complete log here? If you enable DEBUG logs for [1], >> we can get more information on what is the exact zone selected by Stratos >> prior to starting the instance. >> >> [1]. org.apache.stratos.cloud.controller.util.CloudControllerUtil >> >> On Wed, Nov 18, 2015 at 12:46 AM, Akila Ravihansa Perera < >> raviha...@wso2.com> wrote: >> >>> Hi, >>> >>> I'm still seeing the $subject in latest pack. I've the following >>> configuration in cloud-controller.xml >>> >>> <iaasProvider type="ec2" name="Amazon EC2"> >>> >>> <className>org.apache.stratos.cloud.controller.iaases.ec2.EC2Iaas</className> >>> <provider>aws-ec2</provider> >>> <identity >>> svns:secretAlias="cloud.controller.ec2.identity">XXX</identity> >>> <credential >>> svns:secretAlias="cloud.controller.ec2.credential">XXX</credential> >>> <property name="jclouds.ec2.ami-query" >>> value="owner-id=742434826329;state=available;image-type=machine"/> >>> <property name="availabilityZone" value="us-east-1d"/> >>> <property name="securityGroups" value="test1"/> >>> <property name="autoAssignIp" value="true" /> >>> <property name="keyPair" value="ravihansa-ec2"/> >>> </iaasProvider> >>> >>> >>> My cartridge definition IaaS section as follows; >>> >>> "iaasProvider": [ >>> { >>> "type": "ec2", >>> "imageId": "ap-southeast-1/ami-9232f5f1", >>> "property": [ >>> { >>> "name": "instanceType", >>> "value": "t2.micro" >>> }, >>> { >>> "name": "keyPair", >>> "value": "ravihansa-ec2" >>> }, >>> { >>> "name": "securityGroups", >>> "value": "test1" >>> } >>> ], >>> >>> >>> Network partition as follows; >>> >>> "partitions": [ >>> { >>> "id": "partition-1", >>> "property": [ >>> { >>> "name": "region", >>> "value": "ap-southeast-1" >>> }, >>> { >>> "name": "zone", >>> "value": "ap-southeast-1a" >>> } >>> >>> ] >>> >>> Stratos prints the following log when deploying the app; >>> >>> [2015-11-18 00:39:57,652] INFO >>> {org.apache.stratos.cloud.controller.iaases.ec2.EC2Iaas} - ZONE has been >>> set as us-east-1d with id: us-east-1d >>> >>> >>> But the network partition is set to ap-southeast-1a availability zone. >>> It is not picking up correct values. >>> >>> >>> Also I'm getting the following error when deploying an app on ec2; >>> >>> >>> [2015-11-18 00:40:00,316] ERROR >>> {org.apache.stratos.cloud.controller.iaases.JcloudsIaas} - Failed to start >>> an instance. MemberContext [applicationId=single-cartridge-app-ec2, >>> cartridgeType=php-ec2, >>> clusterId=single-cartridge-app-ec2.my-php-app-ec2.php-ec2.domain, >>> memberId=single-cartridge-app-ec2.my-php-app-ec2.php-ec2.domaincd6f406a-9278-466e-9ab9-7198ca948a5a, >>> instanceId=null, partition=Partition [id=partition-1, description=null, >>> isPublic=false, provider=ec2, properties=Properties [properties=[Property >>> [name=region, value=ap-southeast-1], Property [name=zone, >>> value=ap-southeast-1a]]]], defaultPrivateIP=null, defaultPublicIP=null, >>> allocatedIPs=null, publicIPs=null, privateIPs=null, initTime=1447787397961, >>> lbClusterId=null, networkPartitionId=network-partition-ec2, >>> kubernetesPodId=null, kubernetesPodName=null, loadBalancingIPType=Private, >>> instanceMetadata=null, properties=Properties [properties=[Property >>> [name=MIN_COUNT, value=1], Property [name=SCALING_DECISION_ID, >>> value=single-cartridge-app-ec2.my-php-app-ec2.php-ec2.domain-373113aa-7fa9-4bfa-8bd3-93f845488d1a], >>> Property [name=EC2_REGION, value=ap-southeast-1], Property >>> [name=EC2_AVAILABILITY_ZONE, value=ap-southeast-1a]]]] Cause: The image id >>> '[ami-9232f5f1]' does not exist >>> org.jclouds.rest.ResourceNotFoundException: The image id >>> '[ami-9232f5f1]' does not exist >>> at >>> org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.refineException(ParseAWSErrorFromXmlContent.java:108) >>> at >>> org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError(ParseAWSErrorFromXmlContent.java:89) >>> at >>> org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65) >>> at >>> org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:136) >>> at >>> org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:105) >>> at >>> org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90) >>> at >>> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73) >>> at >>> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) >>> at >>> org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117) >>> at >>> com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) >>> at com.sun.proxy.$Proxy120.runInstancesInRegion(Unknown Source) >>> at >>> org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.createNodesInRegionAndZone(EC2CreateNodesInGroupThenAddToSet.java:240) >>> at >>> org.jclouds.aws.ec2.compute.strategy.AWSEC2CreateNodesInGroupThenAddToSet.createNodesInRegionAndZone(AWSEC2CreateNodesInGroupThenAddToSet.java:104) >>> at >>> org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.createKeyPairAndSecurityGroupsAsNeededThenRunInstances(EC2CreateNodesInGroupThenAddToSet.java:215) >>> at >>> org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.runInstancesAndWarnOnInvisible(EC2CreateNodesInGroupThenAddToSet.java:151) >>> at >>> org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddToSet.execute(EC2CreateNodesInGroupThenAddToSet.java:132) >>> at >>> org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:210) >>> at >>> org.jclouds.ec2.compute.EC2ComputeService.createNodesInGroup(EC2ComputeService.java:149) >>> at >>> org.apache.stratos.cloud.controller.iaases.JcloudsIaas.startInstance(JcloudsIaas.java:137) >>> at >>> org.apache.stratos.cloud.controller.services.impl.InstanceCreator.startInstance(InstanceCreator.java:99) >>> at >>> org.apache.stratos.cloud.controller.services.impl.InstanceCreator.run(InstanceCreator.java:67) >>> at >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >>> at java.lang.Thread.run(Thread.java:745) >>> Caused by: org.jclouds.aws.AWSResponseException: request POST >>> https://ec2.us-east-1.amazonaws.com/ HTTP/1.1 failed with code 400, >>> error: AWSError{requestId='0b183790-561b-4089-8414-87ff8251f8cb', >>> requestToken='null', code='InvalidAMIID.NotFound', message='The image id >>> '[ami-9232f5f1]' does not exist', context='{Response=, Errors=}'} >>> at >>> org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError(ParseAWSErrorFromXmlContent.java:75) >>> ... 22 more >>> [2015-11-18 00:40:00,318] ERROR >>> {org.apache.stratos.cloud.controller.services.impl.InstanceCreator} - >>> Could not start instance: [cartridge-type] php-ec2 [cluster-id] >>> single-cartridge-app-ec2.my-php-app-ec2.php-ec2.domain >>> >>> >>> It says image id does not exist. But I've verified that it does actually >>> exist. Any thoughts? >>> >>> Thanks. >>> >>> -- >>> Akila Ravihansa Perera >>> WSO2 Inc.; http://wso2.com/ >>> >>> Blog: >>> http://ravihansa3000.blogspot.com >>> >>> -- >>> <http://ravihansa3000.blogspot.com> >>> <http://ravihansa3000.blogspot.com> >>> Thanks and Regards, >>> >>> Isuru H. >>> <http://ravihansa3000.blogspot.com> >>> +94 716 358 048 <http://ravihansa3000.blogspot.com>* <http://wso2.com/>* >>> >>> >>> * <http://wso2.com/>* >>> >>> >>> > > > -- > Thanks and Regards, > > Isuru H. > +94 716 358 048* <http://wso2.com/>* > > > -- Thanks and Regards, Isuru H. +94 716 358 048* <http://wso2.com/>*