Adding swapfile and building new AMI


#1

I need to create a new AMI for (right now v1.0.3) of rancher OS in a few AWS regions. The AMI should be identical to the official but with a swapfile pre-allocated.

I can’t seem to find instructions for this process on the documentation site. The closest I’ve been able to come so far is to boot an existing instance of rancher and attach a volume as indicated in this post but then use:

ros install -c cloud-config.yml -d /dev/xvdf

Unfortunately then the host reboots. Is there a toolchain that can be used outside of aws to do this? Is this the wrong approach?

Thanks in advance.


#2

Anyone got any ideas here?


#3

Hi @SvenDowideit would you be able to point me to any ami building tooling that you guys use so I can accomplish this, or suggest an alternative?

Thanks in advance


#4

I use a script based cloud-init to format my disks and then install on initial startup - for example https://github.com/SvenDowideit/bin-dir/blob/master/cloud-configs/airgap/install-bastion.sh

or conversely, you can use https://github.com/rancher/os-packer to generate a custom AMI