Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Latest commit

 

History

History
511 lines (348 loc) · 13.8 KB

File metadata and controls

511 lines (348 loc) · 13.8 KB

Import Clear Linux Image and Launch Instance on AWS

Clear Linux is available on the AWS marketplace. However, it may not be the latest version because we only update the marketplace on a periodic basis, as often as weekly or but maybe monthly as well. If you want to use the latest release from us or upload your own custom image, follow this guide.

  • You are familiar with AWS and how to use it

Obtain an AWS |CL| image using one of these methods.

Download pre-built image

  1. Go to the Downloads page and download the Amazon* Web Services (AWS) image.
  2. Uncompress it.

Create a custom image using clr-installer

  1. On a |CL| system, open a terminal.

  2. Install the clr-installer bundle.

    sudo swupd bundle-add clr-installer
  3. Download a sample aws.yaml configuration file.

  4. Make changes to the configuration file as needed. See Installer YAML Syntax for more information on clr-installer configuration YAML syntax.

  5. Download the AWS image post-install script and make it executable.

  6. Produce an image with clr-installer.

    clr-installer --template $PWD/aws.yaml
  1. Log into AWS.

  2. Go to :guilabel:`Services`, :guilabel:`Storage`, and select :guilabel:`S3`. See Figure 1.

    AWS Services - S3 Management Console

    Figure 1: AWS Services - S3 Management Console

  3. Click :guilabel:`+ Create bucket`.

    AWS S3 - Create bucket

    Figure 2: AWS S3 - Create bucket

  4. Set a bucket name and select a region. See Figure 3.

    AWS S3 - Create bucket - Set bucket name and region

    Figure 3: AWS S3 - Create bucket - Set bucket name and region

  5. Leave the :guilabel:`Configure options` and :guilabel:`Set permissions` settings as is or configure as desired. See Figure 4 and 5.

    AWS S3 - Create bucket - Configure options

    Figure 4: AWS S3 - Create bucket - Configure options

    AWS S3 - Create bucket - Set permissions

    Figure 5: AWS S3 - Create bucket - Set permissions

  6. At the :guilabel:`Review` screen, click :guilabel:`Create bucket`.

    AWS S3 - Create bucket - Review

    Figure 6: AWS S3 - Create bucket - Review

    The created bucket should appear. See Figure 7.

    AWS S3 - Created bucket

    Figure 7: AWS S3 - Created bucket

Upload the |CL| image into the bucket

  1. Click on the bucket. See Figure 8.

    AWS S3 - Select bucket

    Figure 8: AWS S3 - Select bucket

  2. Click :guilabel:`Upload`. See Figure 9.

    AWS S3 - Upload

    Figure 9: AWS S3 - Upload

  3. Click :guilabel:`Add files` and select the |CL| image file to upload. See Figure 10.

    AWS S3 - Add files

    Figure 10: AWS S3 - Add files

  4. Click :guilabel:`Next`. Leave remaining settings as is or set as desired. See Figure 11, Figure 12, and Figure 13.

    AWS S3 - Add files

    Figure 11: AWS S3 - Add files

    AWS S3 - Set permissions

    Figure 12: AWS S3 - Set permissions

    AWS S3 - Set properties

    Figure 13: AWS S3 - Set properties

  5. Click :guilabel:`Upload` to upload the image. See Figure 14.

    AWS S3 - Upload

    Figure 14: AWS S3 - Upload

  1. Go to :guilabel:`Services`, :guilabel:`Security, Identity, & Compliance`, and select :guilabel:`IAM`. See Figure 15.

    AWS Services - IAM

    Figure 15: AWS Services - IAM

  2. On the left navigation bar under :guilabel:`Access management`, select :guilabel:`Users`. See Figure 16.

    AWS AIM - Access management

    Figure 16: AWS AIM - Access management

  3. Click :guilabel:`Add user`. See Figure 17.

    AWS AIM - Add user

    Figure 17: AWS AIM - Add user

  4. Under the :guilabel:`Set user details` section, enter a user name. See Figure 18.

    AWS AIM - Enter user name and select access type

    Figure 18: AWS AIM - Enter user name and select access type

  5. Under the :guilabel:`Select AWS access type` section, checkmark :guilabel:`Programmatic access`. See Figure 18.

  6. Click :guilabel:`Next: Permissions`.

  7. Under :guilabel:`Set permissions`, select :guilabel:`Add user to group`. See Figure 19.

    AWS AIM - Set user permissions

    Figure 19: AWS AIM - Set user permissions

  8. Under :guilabel:`Add user to group`, enter AWS_CLI into search window. Checkmark :guilabel:`AWS_CLI`. See Figure 19.

  9. Click :guilabel:`Next: Tags`.

  10. Click :guilabel:`Next: Review`.

  11. Click :guilabel:`Create user`. See Figure 20.

    AWS AIM - Create user

    Figure 20: AWS AIM - Create user

  12. After the user is successfully added, save the :guilabel:`Access key ID` and the :guilabel:`Secret access key`. These will be used when setting up the AWS CLI tool at a later step. See Figure 21.

    AWS AIM - Access key ID and secret access key

    Figure 21: AWS AIM - Access key ID and secret access key

  13. Click :guilabel:`Close`.

  1. To install the tool on |CL|, simply run:

    sudo swupd bundle-add cloud-api
  2. Configure it with your security credentials, default region, and default output format. See Configuring the AWS CLI for more information.

    aws configure

    Below is an example (using the security credentials that was created in the previous section):

    AWS Access Key ID [None]: AKIA5LEGQPQ3EUB3JMS7
    AWS Secret Access Key [None]: EcvbWpWr+Gp7NhBoVEacwR3EifzN7xTTg8B1PHvO
    Default region name [None]: us-west-2
    Default output format [None]: json
  3. Verify your credentials are good.

    aws iam list-access-keys

    If you get something like the example below, then make sure you set your system date and time properly.

    An error occurred (SignatureDoesNotMatch) when calling the ListAccessKeys operation: Signature expired: 20200305T153154Z is now earlier than 20200305T231847Z (20200305T233347Z - 15 min.)
  1. Create a :file:`container.json` with the description of the image to import. Specify the name of the S3 bucket that was created earlier for the S3Bucket field and the name of |CL| image that was uploaded to the S3 bucket for the S3Key.

    Here's an example:

    {
      "Description": "My Clear Linux AWS 32400 Image",
      "Format": "raw",
      "UserBucket": {
        "S3Bucket": "my-clearlinux-bucket",
        "S3Key": "clear-32400-aws.img"
      }
    }
  2. Import a snapshot of the image.

    aws ec2 import-snapshot \
    --description "My Clear Linux AWS 32400 Snapshot" \
    --disk-container file://container.json

    You should get an output similar this example:

      {
        "Description": "My Clear Linux AWS 32400 Snapshot",
        "ImportTaskId": "import-snap-00fa9ccd98e9b8378",
        "SnapshotTaskDetail": {
            "Description": "My Clear Linux AWS 32400 Snapshot",
            "DiskImageSize": 0.0,
            "Format": "RAW",
            "Progress": "3",
            "Status": "active",
            "StatusMessage": "pending",
            "UserBucket": {
                "S3Bucket": "my-clearlinux-bucket",
                "S3Key": "clear-32400-aws.img"
            }
        }
    }
  3. Using the ImportTaskId from the previous step, check the status of the import. For example:

    snapshot_id=$(aws ec2 describe-import-snapshot-tasks \
    --import-task-ids "import-snap-00fa9ccd98e9b8378" \
    | grep SnapshotId | awk -F '"' '{print $4}')

    Wait for the Status field to show completed before proceeding.

    The resulting snapshot_id will be used to create an AMI in the next section.

There are 2 methods to create an AMI from the snapshot.

  1. Go to :guilabel:`Services`, :guilabel:`Compute`, and select :guilabel:`EC2`. See Figure 26.

    AWS Services - EC2

    Figure 26: AWS Services - EC2

  2. Click the :guilabel:`Launch Instance` dropdown and select :guilabel:`Launch Instance`. See Figure 27.

    AWS Services - Launch instance

    Figure 27: AWS Services - Launch instance

  3. On the left navigation bar, select :guilabel:`My AMIs`. See Figure 28.

    AWS Services - Select AMI

    Figure 28: AWS Services - Select AMI

  4. Find your AMI and click :guilabel:`Select`.

  5. From here onward, configure the details of your instance as desired and launch it.

  1. Follow these steps to :ref:`connect to your instance<aws-web-connect>`.