If we consider the official “CentOS 7” AMI as the first generation AMI, I’m able to create a 2nd generation AMI for internal use using the 1st gen as the source AMI. It works great. The biggest reason we needed to rebuild the 1st gen and not just use it straight is to reconfigure the underlying disk to break apart the file systems (/tmp, /var, etc) and set up LVM. For this, I used the packer “amazon-ebssurrogate” type. Again, works great. Been using it for over a year, no problems AFACIT.
I’m trying to use this second gen AMI to create a third generation, this time using the simpler “amazon-ebs” type. All I want to do is build on the work of the 2nd gen image to build an AMI with Vault pre-installed. Seems pretty straight forward. I cannot for the life of me get Amazon to recognize that this third gen AMI is also “CentOS 7”. It will only say “Other Linux” for the platform when looking at the resulting AMI.
I’ve been through a bunch of weird issues with it, but I’ve at least got it to where I can launch and ssh into instances from this 3rd gen AMI. I have no idea, however, what’s going on with this “Other Linux” label. I don’t know if Packer is feeding that to AWS, or it’s something that AWS tries to detect and can’t. I also don’t know what else this “Other Linux” (rather than the proper “CentOS 7”) might be affecting w/r/t instances launched from this AMI.
I’m very perplexed, and can’t figure out what I’m doing wrong. I made a gist of the 2nd and 3rd gen Packer templates here: https://gist.github.com/rjhornsby/d81ebac283daa847543c0ae821968cb4
A bit of explanation – Why go from 2nd to 3rd gen instead of 1st gen directly to what I’m calling here the 3rd gen with Vault installed? Because of the underlying filesystem changes that happen during the transition to the 2nd gen, it seems much easier to end Packer at that point. This is our sort of general purpose image we use for everything. By not trying to combine 2nd and 3rd generations into one step, it avoids trying to reboot in the middle of the Packer run, or chroot to get chef-client installed, run chef-client to get vault set up etc.