如何在 Snowball Edge 上启动 Amazon EC2 实例?

2 分钟阅读
0

我想在 AWS Snowball Edge 设备上启动 Amazon Elastic Compute Cloud (Amazon EC2) 实例。

解决方法

开始之前,请确认您的 AWS 账户中存在支持 AMI。另外请务必查看 Snowball Edge 设备上实例的配额

准备 Snowball Edge 客户端、Snowball Edge 设备和 AWS 命令行界面 (AWS CLI)

1.    下载 Snowball Edge 客户端

2.    为 Snowball Edge 客户端配置配置文件

3.    使用 Snowball Edge 客户端,并通过 unlock-device 命令解锁 Snowball Edge 设备:

$ snowballEdge unlock-device

4.    设备可能需要几分钟才能解锁。使用 Snowball Edge 客户端,运行 describe-device 命令检查解锁状态:

$ snowballEdge describe-device

5.    每个 Snowball Edge 设备都具有其唯一的一组 AWS CLI 证书。运行以下命令,为您的设备获取证书

$ snowballEdge list-access-keys

$ snowballEdge get-secret-access-key --access-key-id (Enter access key)

6.    安装配置最新版本的 AWS CLI。

**注意:**要将数据传输到 Snowball Edge 设备上的 Amazon Simple Storage Service (Amazon S3) 存储桶,必须使用 AWS CLI 版本 1.16.14

启动您的 Amazon EC2 实例

1.    运行 describe-device Snowball 客户端命令:

$ snowballEdge describe-device

2.    在命令输出中,记下所连接的网络连接的 physical-network-interface-id

3.    运行 create-virtual-network-interface Snowball 客户端命令,并确保输入以下内容:

对于 --physical-network-interface-id,输入您在上一步中记下的 ID。

对于 --ip-address-assignment,请输入 DHCPSTATIC

$ snowballEdge create-virtual-network-interface --physical-network-interface-id s.ni-xxxxxxxxxxxx --ip-address-assignment DHCP

$ snowballEdge create-virtual-network-interface --physical-network-interface-id s.ni-xxxxxxxxxxxx --ip-address-assignment STATIC --static-ip-address-configuration IpAddress=xxxx.xx.xx.xx,Netmask=255.255.255.0

4.    记下命令输出中的 IP 地址。

5.    运行 describe-images AWS CLI 命令,以列出您订购的实例的映像 ID。

$ aws ec2 describe-images --endpoint http://xx.xx.xx.xx:8008 --profile snowballEdge

**注意:**如果在运行 AWS CLI 命令时收到错误,请确保您使用的是最新的 AWS CLI 版本

6.    记下命令输出中的映像 ID。

7.    运行 run-instances AWS CLI 命令,并确保输入在第 6 步中记下的映像 ID:

$ aws ec2 run-instances --image-id s.ami-xxxxxxxxxxx --profile snowabllEdge --endpoint http://xx.xx.xx.xx:8008

8.    记下命令输出中的实例 ID。

9.    根据 Amazon Elastic Block Store (Amazon EBS) 卷的大小,实例启动可能需要一个小时以上的时间。要查看实例启动状态,您可以运行 describe-instances AWS CLI 命令:

$ aws ec2 describe-instances --instance-id s.i-xxxxxxxxx --endpoint http://xx.xx.xx.xx:8008 --profile snowballEdge

10.    在状态变为名称: 正在运行后,您可以继续。运行 associate-address AWS CLI 命令,并确保输入以下内容:

对于 --instance-id,输入在第 8 步中记下的 ID。

对于 --public-ip,输入在第 4 步中记下的 IP 地址。如果您使用 DHCP IP 地址分配创建了一个虚拟网络接口,则可以运行 describe-virtual-network-interfaces Snowball 客户端命令,以获取 DHCP 分配的 IP 地址。

$ aws ec2 associate-address --instance-id s.i-xxxxxxx --public-ip xx.xx.xx.xx --profile snowballEdge --endpoint http://xx.xx.xx.xx:8008

11.    运行 describe-instances AWS CLI 命令,检查 IP 地址是否与您的实例关联成功:

$ aws ec2 describe-instances --instance-id s.i-xxxxxxxxx --endpoint http://xx.xx.xx.xx:8008 --profile snowballEdge

12.    现在,您可以使用 SSH 连接到 Snowball Edge 设备上的实例


相关信息

使用 Amazon EC2 计算实例

Snowball 客户端的命令

AWS 官方
AWS 官方已更新 2 年前