Import Flight Solo Image to AWS
Tip
If you are looking to evaluate the latest release of Flight Solo on AWS then it is recommended to utilise the AWS Marketplace Image - this is identical to the latest release and provides a streamlined launch process
Prepare AWS Account for Image Import
CLI Prerequisites
-
To set this up, you will need to install the AWS Command Line Interface(CLI). Confirm that you have the prerequisites for the AWS CLI.
-
Install the AWS CLI by following the AWS guide.
-
Configure basic the basic AWS CLI by following this guide. There is more information about configuration in other parts of the AWS documentation.
Setup a Bucket
- Create a bucket as described in the AWS Documentation
- Create a directory within the bucket called
images
Create VM Import Policy
-
Create a
vmimport
policy file to enable vm import operations. Make a file calledtrust-policy.json
with these contents:{ "Version": "2022-11-03", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "vmie.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals":{ "sts:Externalid": "vmimport" } } } ] }
-
Create a role from the
vmimport
policy file.aws iam create-role --role-name vmimport --assume-role-policy-document "file://trust-policy.json"
-
Create a bucket association with the
vmimport
role in a file calledrole-policy.json
, replacing<bucketname>
with the name of your S3 bucket.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", "s3:PutObject", "s3:GetBucketAcl" ], "Resource": [ "arn:aws:s3:::<bucketname>", "arn:aws:s3:::<bucketname>/*" ] }, { "Effect": "Allow", "Action": [ "ec2:ModifySnapshotAttribute", "ec2:CopySnapshot", "ec2:RegisterImage", "ec2:Describe*" ], "Resource": "*" } ] }
-
Apply the role policy.
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document "file://role-policy.json"
Upload Image
-
Download the Flight Solo AWS image here
-
Upload the downloaded Flight Solo image to a directory called
images
in the S3 bucket with this command:aws s3 cp Flight_Solo_VERSION_aws.raw s3://<bucketname>/images/
-
Wait until it has finished uploaded before proceeding.
Import Image As Snapshot
-
Create a file called
containers.json
with raw disk image information. These are the contents (replace<bucketname>
with your bucket name):{ "Description": "Flight_Solo_VERSION_aws.raw", "Format": "raw", "UserBucket": { "S3Bucket": "<bucketname>", "S3Key": "images/Flight_Solo_VERSION_aws.raw" } }
-
Import the raw image as a disk snapshot.
aws ec2 import-snapshot --description "Flight_Solo_VERSION_aws.raw" --disk-container "file://containers.json"
-
Wait until the import is complete. You can check the progress with this command: (replace the import task ID with the ID output of the previous command)
aws ec2 describe-import-snapshot-tasks --import-task-ids import-snap-00000000000000000
Create AMI from Snapshot
- Once imported, the snapshot can be registered as an AMI (replacing
VERSION
with the version of Flight Solo andSNAPSHOT_ID
with the ID of the snapshot created in the previous section)aws ec2 register-image --name "Flight Solo VERSION" --description "Flight Solo VERSION from snapshot" --block-device-mappings "[{\"DeviceName\": \"/dev/sda1\",\"Ebs\":{\"VolumeSize\":10, \"SnapshotId\":\"SNAPSHOT_ID\"}}]" --root-device-name "/dev/sda1" --architecture x86_64 --ena-support