Using Amazon EC2 Compute Instances Locally - AWS Snowball Edge Developer Guide

This guide is for the Snowball Edge. If you are looking for documentation for the Snowball, see the AWS Snowball User Guide.

Using Amazon EC2 Compute Instances Locally

You can use AWS OpsHub to run pre-installed software on virtual servers (instances) locally on your device, and also to manage Amazon EC2 instances on your device.

Launching an EC2 Instance

Follow these steps to launch an Amazon EC2 instance using AWS OpsHub.

To launch an Amazon EC2 instance

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page. All your compute resources appear in the Resources section.

  3. If you have Amazon EC2 instances running on your device, they appear in the Instance name column under Instances. You can see details of each instance on this page.

  4. Choose Launch instance. The launch instance wizard opens.

  5. For Device, choose the Snow device that you want to launch the EC2 instance on.

  6. For Image (AMI), choose an Amazon Machine Image (AMI) from the list. This AMI is used to launch your instance.

  7. For Instance type, choose one from the list.

  8. Choose how you want to attach an IP address to the instance. You have the following options:

    • Create public IP address (VNI)—choose this option to create a new IP address using a physical network interface. Choose a physical network interface and IP address assignment.

    • Use existing IP address (VNI)—choose this option to use an existing IP address and then use existing virtual network interfaces. Choose a physical network interface and a virtual network interface.

    • Do not attach IP address—choose this option if you don't want to attach an IP address.

  9. Choose Launch. You should see your instance launching in the Compute instances section. The State is Pending and then changes to Running when done.

Stopping an EC2 Instance

Use the following steps to use AWS OpsHub to stop an Amazon EC2 instance.

To stop an EC2 instance

  1. Open the AWS OpsHub application.

  2. In the Start computing section of the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page.

    All your compute resources appear in the Resources section.

  3. If you have Amazon EC2 instances running on your device, they appear in the Instance name column under Instances.

  4. Choose the instance that you want to stop, and choose Stop. The State changes to Stopping, and then to Stopped when done.

Starting an EC2 Instance

Use these steps to start an Amazon EC2 instance using AWS OpsHub.

To start an EC2 instance

  1. Open the AWS OpsHub application.

  2. In the Start computing section of the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page.

    Your compute resources appear in the Resources section.

  3. In the Instance name column, under Instances, find the instance that you want to start.

  4. Choose the instance, and then choose Start. The State changes to Pending, and then changes to Running when done.

Terminating an EC2 Instance

After you terminate an Amazon EC2 instance, you can't restart the instance.

To terminate an EC2 instance

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page. You can see all your compute resources in the Resources section.

  3. In the Instance name column, under Instances, find the instance that you want to terminate.

  4. Choose the instance, and choose Terminate. The State changes to Terminating, and then to Terminated when done.

    After the instance is terminated, you can't restart it.

Using Storage Volumes Locally

Amazon EC2 instances use Amazon EBS volumes for storage. In this procedure, you create a storage volume and attach it to your instance using AWS OpsHub.

To create a storage volume

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page.

  3. Choose the Storage volumes tab. If you have storage volumes on your device, the details about the volumes appear under Storage volumes.

  4. Choose Create volume to open the Create volume page.

  5. Choose the device that you want to create the volume on, enter the size (in GiBs) that you want to create, and choose the type of volume.

  6. Choose Submit. The State is Creating, and changes to Available when done. You can see your volume and details about it in the Volumes tab.

To attach a storage volume to your instance

  1. Choose the volume that you created, and then choose Attach volume.

  2. For Compute instance Id, choose the instance you want to attach the volume to.

  3. For Volume Device Name, enter the device name of your volume (for example, /dev/sdh or xvdh).

  4. Choose Attach.

If you no longer need the volume, you can detach it from the instance and then delete it.

Importing an Image into Your Device as an Amazon EC2 AMI

You can import a snapshot of your image into your Snowball Edge device and register it as an EC2 Amazon Machine Image (AMI). A snapshot is basically a copy of your storage volume that you can use to create an AMI or another storage volume. By doing this, you can bring your own image from an external source onto your device and launch it as an EC2 instance.

Follow these steps to complete the import of your image.

  1. Upload your snapshot into an Amazon S3 bucket on your device.

  2. Set up the required permissions to grant access to Amazon S3, Amazon EC2, and VM Import/Export, the feature that is used to import and export snapshots.

  3. Import the snapshot from the S3 bucket into your device as an image.

  4. Register the image as an EC2 AMI.

  5. Launch the AMI as an EC2 instance.

Note

Be aware of the following limitations when uploading snapshots to Snow Family Devices.

  • Snow Family Devices currently only support importing snapshots that are in the RAW image format.

  • Snow Family Devices currently only support importing snapshots with sizes from 1 GB to 1 TB.

Step 1: Upload a Snapshot into an Amazon S3 Bucket on Your Device

You must upload your snapshot to Amazon S3 on your device before you import it. This is because snapshots can only be imported from Amazon S3 available on your device or cluster. During the import process, you choose the S3 bucket on your device to store the image in.

To upload a snapshot to S3

Step 3: Import the Snapshot from an S3 Bucket

When your snapshot is uploaded to Amazon S3, you can import it to your device. All snapshots that have been imported or are in the process of being imported are shown in Snapshots tab.

To import the snapshot to your device

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page. All your compute resources appear in the Resources section.

  3. Choose the Snapshots tab to see all the snapshots that have been imported to your device. The image file in Amazon S3 is a .raw file that is imported to your device as a snapshot. You can filter by snapshot ID or the state of the snapshot to find specific snapshots. You can choose a snapshot ID to see details of that snapshot.

  4. Choose the snapshot that you want to import, and choose Import snapshot to open the Import snapshot page.

  5. For Device, choose the IP address of the Snow Family device that you want to import to.

  6. For Import description and Snapshot description, enter a description for each.

  7. In the Role list, choose a role to use for the import. Snow Family Devices use VM Import/Export to import snapshots. AWS assumes this role and uses it to import the snapshot on your behalf. If you don't have a role, open the AWS Identity and Access Management (IAM) console, where you can create role. The role also needs a policy that has the required VM Import/Export permissions to perform the import. You must attach this policy to the role.

    The following is an example of the policy.

    { "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Principal":{ "Service":"vmie.amazonaws.com" }, "Action":"sts:AssumeRole" } ] }

    Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.

    The role you create should have minimum permissions to access Amazon S3 The following is example of a minimum policy.

    { "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", "s3:GetMetadata" ], "Resource":[ "arn:aws:s3:::import-snapshot-bucket-name", "arn:aws:s3:::import-snapshot-bucket-name/*" ] } ] }
  8. Choose Browse S3 and choose the S3 bucket that contains the snapshot that you want to import. Choose the snapshot, and choose Submit. The snapshot begins to download onto your device. You can choose the snapshot ID to see the details. You can cancel the import process from this page.

Step 3: Register the Snapshot as an Amazon EC2 AMI

The process of creating an Amazon EC2 AMI from an image imported as a snapshot is known as registering. Images that are imported to your device must be registered before they can be launched as Amazon EC2 instances.

To register an image imported as a snapshot

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page. All your compute resources appear in the Resources section.

  3. Choose the Images tab. You can filter the images by name, ID, or state to find a specific image.

  4. Choose the image that you want to register, and choose Register image.

  5. On the Register image page, provide a Name and Description.

  6. For Root volume, specify the name of the root device.

    In the Block device section, you can change the size of the volume and the volume type.

  7. If you want the volume to be deleted when the instance is terminated, choose Delete on termination.

  8. If you want to add more volumes, choose Add new volume.

  9. When you are done, choose Submit.

Step 4: Launch the Amazon EC2 AMI

Deleting a Snapshot

If you no longer need a snapshot, you can delete it from your device. The image file in Amazon S3 is a .raw file that is imported to your device as a snapshot. If the snapshot that you are deleting is used by an image, it can't be deleted. After import is completed, you can also delete the .raw file that you uploaded to Amazon S3 on your device.

To delete a snapshot

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page. All your compute resources appear in the Resources section.

  3. Choose the Snapshot tab to see all snapshots that have been imported. You can filter by snapshot ID or state of the snapshot to find specific snapshots.

  4. Choose the snapshot that you want to delete, and choose Delete. You can choose multiple snapshots.

  5. In the Delete snapshot confirmation box, choose Delete snapshot. If your deletion is successful, the snapshot is removed from the list under the Snapshots tab.

Deregistering an AMI

To deregister an AMI

  1. Open the AWS OpsHub application.

  2. In the Start computing section on the dashboard, choose Get started. Or, choose the Services menu at the top, and then choose Compute (EC2) to open the Compute page. All your compute resources appear in the Resources section.

  3. Choose the Images tab. All your images are listed. You can filter the images by name, ID, or state to find a specific image.

  4. Choose the image that you want to deregister, and choose Deregister.

  5. In the confirmation dialog box, confirm the image ID and choose Deregister image. When deregistering is successful, the image is removed from the list of images.