How to make a bigger custom AMI?
Maxime U. Garcia 2018-11-05Last modified 2018-11-07
1 minute read
Following this post set of posts on running Nextflow with AWS Batch:
- Nextflow blog: Scaling with AWS Bach
- This blog: Running CAW with AWS Batch
- Alexander Peltzer’s blog: Running nf-co.re pipelines with AWSBatch
- Anthony Underwood’s blog: Running Nextflow on AWS batch
I’m writing a small guide on how to make a custom AMI with a big enough size to run some actual data with.
All the instructions are in fact listed in the custom AMI Nextflow docs and this solution is there, but as I struggled once already, I prefer to document it for everyone and especially future me.
- On the AWS EC2 Dashboard, launch a new instance
1. Choose AMI
: Search for and chooseAmazon ECS-Optimized Amazon Linux AMI
in theAWS MArketplace
2. Choose Instance Type
: Choose at2.micro
3. Configure Instance
: Leave default configuration4. Add Storage
: Input500 GiB
or any other size, but22 GiB
is definitively not big enough for actual real life data.5. Add Tags
: Do as you want6. Configure Security Group
: Just make sure you can connect to theEC2
Instance.7. Review Instance Launch
: Procure a key pair that you have so that you can access your Instance- Launch the newly created Instance (
Actions
->Instance State
->Start
), it should be easy to find - Connect providing the key pair specified earlier.
- The
ssh
command provided by AWS is wrong, you need to replaceroot
byec2-user
sudo yum update
to update the system- Install
awscli
usingconda
, so installconda
first, and actually installwget
before
sudo yum install wget
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86\_64.sh
bash Miniconda3-latest-Linux-x86\_64.sh -p /home/ec2-user/miniconda
# You can either source .bashrc or specify the path to conda
source .bashrc
conda install -c conda-forge awscli
- Edit this file:
/etc/sysconfig/docker-storage
- Add this option
--storage-opt dm.basesize=500GB
(or specify any other size you prefer) sudo service docker restart
to restart the docker daemon- Check that you actually have the size you wanted with
docker info | grep -i base
anddocker info | grep -i data
For all their support, thanks to:
Leave a Reply
Your email address will not be published