I am attempting to write my first cloudformation template. I am basing it on the ELB example.
In my case I will have 64-bit instances only, t1.micro sized. However I cannot see where to specify that my instance requires 64-bit architecture in the template file. When I attempt to create my new stack, it duly thinks about it for a bit and then fails/rolls back with the error creating the first instance:
"The requested instance type's architecture (i386) does not match the architecture in the manifest".
It's correct that the manifest arch is 64-bit — I think my problem is that because I am not explicitly specifying an architecture, it is defaulting to i386. How can I correct this? There is nothing that jumps out at me in the template reference doc.
Assuming you are addressing the example template downloadable via Create a Load-Balanced Apache Website, the instance type and architecture mappings are wired via these two tables:
This wiring works as follows:
The AWSInstanceType2Arch mapping table specifies the desired architecture per instance type ( which is matching your needs already [i.e. "t1.micro" : { "Arch" : "64" }]).
The AWSRegionArch2AMI mapping table specifies the architecture specific AMIs per region. i.e. which AMI is actually providing the correct architecture mapped above.
For example, if you are starting a t1.micro instance in the eu-west-1 region with this template, it will first deduce the architecture 64 from AWSInstanceType2Arch and then the AMI identifier ami-31c2f645 from AWSRegionArch2AMI in turn.
The example should work correctly in principle (though I haven't tested it myself right now), so AWSRegionArch2AMI is the fragment you would need to customize by replacing the example AMI identifiers with the correct architecture bound ones you want to use for your t1.micro 64bit instances; however:
The error message suggests that the AMI which is used to start the instance is a 32-bit AMI in fact - could it be that you accidentally replaced the 64-bit AMI identifiers in the example with 32-bit ones?
Actually, I figured this out. I had followed up with an answer to this on the AWS Cloudformation forum but I forgot (sorry) that this thread was also active.
The issue is that the ELB template example is incomplete - so when I copied it, my example was also incomplete: you need to specify an instance type (t1.micro for example, or m1.large) explicitly, or else a default is assumed.
To quote my post to the AWS forum
So for example, this is an extract from a properly specified template:
`
I haven't tried it but I expect the AWS example wouldn't work for all combinations of AMIs without this parameter added either.
Cloudformation is nice, but it's quite early days yet. I've come across several bugs in the documentation so far. So don't assume if you hit a roadblock that you are doing something wrong ... you might not be.