You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/ami_customization.rst
+56-4Lines changed: 56 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,28 @@ Building a custom AWS ParallelCluster AMI
10
10
.. warning::
11
11
Building a custom AMI is not the recommended approach for customizing AWS ParallelCluster.
12
12
13
-
Once you build your own AMI, you will no longer receive updates or bug fixes with future releases of AWS ParallelCluster. You will need to repeat the steps used to create your custom AMI with each new AWS ParallelCluster release.
13
+
Once you build your own AMI, you will no longer receive updates or bug fixes with future releases of AWS ParallelCluster. You will need to repeat the steps used to create your custom AMI with each new AWS ParallelCluster release.
14
14
15
15
Before reading any further, take a look at the :doc:`pre_post_install` section of the documentation to determine if the modifications you wish to make can be scripted and supported with future AWS ParallelCluster releases
16
16
17
-
While not ideal, there are a number of scenarios where building a custom AMI for AWS ParallelCluster is necessary. This tutorial will guide you through the process.
17
+
While not ideal, there are a number of scenarios where building a custom AMI for AWS ParallelCluster is necessary. This tutorial will guide you through the process.
18
18
19
19
How to customize the AWS ParallelCluster AMI
20
20
============================================
21
21
22
-
The base AWS ParallelCluster AMI is often updated with new releases. This AMI has all of the components required for AWS ParallelCluster to function installed and configured. If you wish to customize an AMI for AWS ParallelCluster, you must start with this as the base.
22
+
There are three ways to use a custom AWS ParallelCluster AMI, two of them require to build a new AMI that will be available under your AWS account and one does not require to build anything in advance. Feel free to select the
23
+
appropriate method based on your needs.
24
+
25
+
Modify an AWS ParallelCluster AMI
26
+
---------------------------------
27
+
28
+
This is the safest method as the base AWS ParallelCluster AMI is often updated with new releases. This AMI has all of the components required for AWS ParallelCluster to function installed and configured and you can start with this as the base.
23
29
24
30
#. Find the AMI which corresponds with the region you will be utilizing in the list here: https://github.com/aws/aws-parallelcluster/blob/master/amis.txt.
25
31
#. Within the EC2 Console, choose "Launch Instance".
26
32
#. Navigate to "Community AMIs", and enter the AMI id for your region into the search box.
27
33
#. Select the AMI, choose your instance type and properties, and launch your instance.
28
-
#. Log into your instance using the ec2-user and your SSH key.
34
+
#. Log into your instance using the OS user and your SSH key.
29
35
#. Customize your instance as required
30
36
#. Run the following command to prepare your instance for AMI creation::
31
37
@@ -34,3 +40,49 @@ The base AWS ParallelCluster AMI is often updated with new releases. This AMI h
34
40
#. Stop the instance
35
41
#. Create a new AMI from the instance
36
42
#. Enter the AMI id in the :ref:`custom_ami_section` field within your cluster configuration.
43
+
44
+
Build a Custom AWS ParallelCluster AMI
45
+
--------------------------------------
46
+
47
+
If you have an AMI with a lot of customization and software already in place, you can apply the changes needed by AWS ParallelCluster on top of it.
48
+
49
+
For this method you have to install the following tools in your local system, together with the AWS ParallelCluster CLI:
50
+
51
+
#. Packer: grab the latest version for your OS from `Packer website <https://www.packer.io/downloads.html>`_ and install it
52
+
#. ChefDK: grab the latest version for your OS from `ChefDK website <https://downloads.chef.io/chefdk/>`_ and install it
53
+
54
+
Verify that the commands 'packer' and 'berks' are available in your PATH after the above tools installation.
55
+
56
+
You need to configure your AWS account credentials so that Packer can make calls to AWS API operations on your behalf.
57
+
The minimal set of required permissions necessary for Packer to work are documented in the `Packer doc <https://www.packer.io/docs/builders/amazon.html#iam-task-or-instance-role>`_.
58
+
59
+
Now you can use the command 'createami' of the AWS ParallelCluster CLI in order to build an AWS ParallelCluster AMI starting from the one you provide as base::
60
+
61
+
pcluster createami --ami-id <BASE AMI> --os <BASE OS AMI>
62
+
63
+
For other parameters, please consult the command help::
64
+
65
+
pcluster createami -h
66
+
67
+
The command executes Packer, which does the following steps:
68
+
69
+
#. Launch an instance using the base AMI provided.
70
+
#. Apply the AWS ParallelCluster cookbook to the instance, in order to install software and perform other necessary configuration tasks.
71
+
#. Stop the instance.
72
+
#. Creates an new AMI from the instance.
73
+
#. Terminates the instance after the AMI is created.
74
+
#. Outputs the new AMI ID string to use to create your cluster.
75
+
76
+
To create your cluster enter the AMI id in the :ref:`custom_ami_section` field within your cluster configuration.
77
+
78
+
.. note:: The instance type to build a custom AWS ParallelCluster AMI is a t2.xlarge and does not qualify for the AWS free tier. You are charged for any instances created when building this AMI.
79
+
80
+
Use a Custom AMI at runtime
81
+
---------------------------
82
+
83
+
If you don't want to create anything in advance you can just use your AMI and create a AWS ParallelCluster from that.
84
+
85
+
Please notice that in this case the AWS ParallelCluster creation time will take longer, as it will install every software needed by AWS ParallelCluster at cluster creation time.
86
+
Also scaling up for every new node will need more time.
87
+
88
+
#. Enter the AMI id in the :ref:`custom_ami_section` field within your cluster configuration.
0 commit comments