为 NitroTPM 启用 Linux AMI - Amazon Elastic Compute Cloud

为 NitroTPM 启用 Linux AMI

要为实例启用 NitroTPM,必须使用启用了 NitroTPM 的 AMI 启动该实例。您必须在注册 Linux AMI 时为其配置 NitroTPM 支持。因为此后无法配置 NitroTPM 支持。

有关为获得 NitroTPM 支持而预配置的 Windows AMI 的列表,请参阅 NitroTPM 的要求

必须使用 RegisterImage API 创建配置了 NitroTPM 的 AMI,因为无法使用 Amazon EC2 控制台或 VM Import/Export 完成此操作。

为 NitroTPM 启用 Linux AMI
  1. 使用所需的 Linux AMI 启动临时实例。记下其根卷的 ID,该 ID 可在控制台中实例的存储选项卡上找到。

  2. 实例进入 running 状态后,创建实例根卷的快照。您可以使用控制台或以下 create-snapshot 命令。

    aws ec2 create-snapshot \ --volume-id vol-1234567890EXAMPLE \ --description "Snapshot of the root volume"
  3. 将创建的快照注册为 AMI。您必须使用 register-image 命令。对于 --tpm-support,请指定 v2.0。对于 --boot-mode,请指定 uefi。在块设备映射中,指定您为根卷创建的快照。

    aws ec2 register-image \ --name my-image \ --boot-mode uefi \ --architecture x86_64 \ --root-device-name /dev/xvda \ --block-device-mappings DeviceName=/dev/xvda,Ebs={SnapshotId=snapshot_id} \ --tpm-support v2.0

    下面是示例输出。

    { "ImageId": "ami-0123456789example" }
  4. 终止您在步骤 1 中启动的临时实例。