Main Content

Create a Custom Amazon Machine Image (AMI)

You can use an Amazon® Machine Image (AMI) when creating a cloud cluster. To create your custom AMI for this purpose, you modify an AMI provided in Cloud Center. Then you can install drivers, libraries, or other utilities, so that they are available for subsequent clusters without having to reinstall them each time.

Use the following procedure to create and customize a cluster AMI in the Amazon EC2® Dashboard of the AWS Management Console.

  1. Start a cluster in Cloud Center as usual, specifying the MATLAB Version you need. This cluster needs only one worker, and under Advance Options you can choose None for persisted storage space.

  2. In a separate browser window, navigate to the AWS Management Console at Select Services > EC2, then click Running Instances. Your instances will include clusters you start in Cloud Center.

  3. Select the running instance you started in step 1. It has the same name as the cluster in Cloud Center.

  4. In the Instance Details section (lower half of page), look for the AMI ID of your new instance. Note or copy the value shown in parentheses. It will be the string starting with ami- followed by some hexadecimal code.

  5. Shut down the cluster in Cloud Center. You no longer need it; you can delete it if you want to.

  6. In the AWS Management Console, click Launch Instance at the top of the page. This starts a wizard with the steps shown in tabs at the top of the page; the first tab is Choose AMI.

  7. On the left side, choose the following settings:

    1. Select My AMIs.

    2. Select Ownership: Shared with me.

  8. In the Search My AMIs field, enter the AMI ID value noted above (starts with ami-, do not include parentheses). When your instance is shown, click Select.

  9. Click the tab Choose Instance Type, and select a type.

  10. Click the tab Configure Security Groups.

  11. Modify or add a security rule with the following settings:

    Port Range22
    SourceMy IP
  12. Click Review and Launch.

    If you see a dialog box asking about booting from General Purpose (SSD), select your preferred option and click Next.

  13. If everything looks correct in the review dialog box, click Launch.

  14. You will be asked to select a key pair. You can use an existing key pair that you have access to. After acknowledging, click Launch Instances.

    You can track the progress of your instance. Click View Instances. The Instance State for your new instance should say Running before you proceed.

  15. If necessary, log on to the new instance via SSH and install any libraries, drivers, etc.

  16. Stop the running instance by selecting it in the AWS Management Console, then clicking Actions > Stop.

  17. In the AWS Management Console select the instance (it might still be selected) and click Actions > Create Image.

  18. Provide a name and description that will help you identify your new AMI. Use a name that suggests the MATLAB version, installed libraries or drivers, etc. Click Create Image. Note its AMI ID.

In Cloud Center, you can now use that AMI when starting a new cluster. It will be available in the Operating System Image drop-down list in the Advanced Options of the Create Cluster dialog box.

Related Topics