メニュー
Amazon Elastic Compute Cloud
Linux インスタンス用ユーザーガイド

インスタンスの作成

インスタンスを起動する前に、セットアップが終了していることを確認してください。詳細については、「Amazon EC2 でのセットアップ」を参照してください。

AWS アカウントでは、アカウントの作成時期と使用リージョンに応じて EC2-Classic プラットフォームと EC2-VPC プラットフォームの両方がサポートされている可能性があります。アカウントでサポートされるプラットフォームを調べるには、「サポートされているプラットフォーム」を参照してください。アカウントで EC2-Classic がサポートされる場合、どちらのプラットフォームでもインスタンスを起動できます。アカウントで EC2-VPC のみサポートされる場合、VPC でのみインスタンスを起動できます。

重要

AWS 無料利用枠に含まれないインスタンスを起動すると、アイドル状態であっても、インスタンスの実行中は料金が発生します。

AMI からのインスタンスの起動

インスタンスを起動するときに、Amazon Machine Image (AMI) と呼ばれる設定を選択する必要があります。AMI には、新しいインスタンスの作成に必要な情報が含まれています。たとえば、ある AMI にはウェブサーバーとして動作するために必要なソフトウェア (Linux、Apache、ウェブサイトなど) が格納されます。

ヒント

インスタンスの起動を高速化するには、大きなリクエストをより小さなバッチに分割します。たとえば、1 つの起動リクエストに 500 インスタンスが含まれている場合は、それを 5 つの起動リクエスト (各 100 インスタンス) に分割します。

To launch an instance

  1. https://console.aws.amazon.com/ec2/) にある Amazon EC2 コンソールを開きます。

  2. In the navigation bar at the top of the screen, the current region is displayed. Select the region for the instance. This choice is important because some Amazon EC2 resources can be shared between regions, while others can't. Select the region that meets your needs. For more information, see リソースの場所.

    
            				Launch instance start
  3. From the Amazon EC2 console dashboard, choose Launch Instance.

  4. On the Choose an Amazon Machine Image (AMI) page, choose an AMI as follows:

    1. Select the type of AMI to use in the left pane:

      Quick Start

      A selection of popular AMIs to help you get started quickly. To ensure that you select an AMI that is eligible for the free tier, choose Free tier only in the left pane. (Notice that these AMIs are marked Free tier eligible.)

      My AMIs

      The private AMIs that you own, or private AMIs that have been shared with you.

      AWS Marketplace

      An online store where you can buy software that runs on AWS, including AMIs. For more information about launching an instance from the AWS Marketplace, see AWS Marketplace インスタンスの起動.

      Community AMIs

      The AMIs that AWS community member have made available for others to use. To filter the list of AMIs by operating system, choose the appropriate check box under Operating system. You can also filter by architecture and root device type.

    2. Check the Root device type listed for each AMI. Notice which AMIs are the type that you need, either ebs (backed by Amazon EBS) or instance-store (backed by instance store). For more information, see ルートデバイスのストレージ.

    3. Check the Virtualization type listed for each AMI. Notice which AMIs are the type that you need, either hvm or paravirtual. For example, some instance types require HVM. For more information, see Linux AMI 仮想化タイプ.

    4. Choose an AMI that meets your needs, and then choose Select.

  5. On the Choose an Instance Type page, select the hardware configuration and size of the instance to launch. Larger instance types have more CPU and memory. For more information, see インスタンスタイプ.

    To remain eligible for the free tier, choose the t2.micro instance type. For more information, see T2 インスタンス.

    By default, the wizard displays current generation instance types, and selects the first available instance type based on the AMI that you selected. To view previous generation instance types, choose All generations from the filter list.

    注記

    If you are new to AWS and would like to set up an instance quickly for testing purposes, you can choose Review and Launch at this point to accept default configuration settings, and launch your instance. Otherwise, to configure your instance further, choose Next: Configure Instance Details.

  6. On the Configure Instance Details page, change the following settings as necessary (expand Advanced Details to see all the settings), and then choose Next: Add Storage:

    • Number of instances: Enter the number of instances to launch.

      注記

      To help ensure that you maintain the correct number of instances to handle your application, you can choose Launch into Auto Scaling Group to create a launch configuration and an Auto Scaling group. Auto Scaling scales the number of instances in the group according to your specifications. For more information, see the Auto Scaling ユーザーガイド.

    • Purchasing option: Select Request Spot instances to launch a Spot instance. For more information, see スポットインスタンス.

    • Your account may support the EC2-Classic and EC2-VPC platforms, or EC2-VPC only. To find out which platform your account supports, see サポートされているプラットフォーム. If your account supports EC2-VPC only, you can launch your instance into your default VPC or a nondefault VPC. Otherwise, you can launch your instance into EC2-Classic or a nondefault VPC.

      注記

      Some instance types must be launched into a VPC. If you don't have a VPC, you can let the wizard create one for you.

      To launch into EC2-Classic:

      • Network: Select Launch into EC2-Classic.

      • Availability Zone: Select the Availability Zone to use. To let AWS choose an Availability Zone for you, select No preference.

      To launch into a VPC:

      • Network: Select the VPC, or to create a new VPC, choose Create new VPC to go the Amazon VPC console. When you have finished, return to the wizard and choose Refresh to load your VPC in the list.

      • Subnet: Select the subnet into which to launch your instance. If your account is EC2-VPC only, select No preference to let AWS choose a default subnet in any Availability Zone. To create a new subnet, choose Create new subnet to go to the Amazon VPC console. When you are done, return to the wizard and choose Refresh to load your subnet in the list.

      • Auto-assign Public IP: Specify whether your instance receives a public IPv4 address. By default, instances in a default subnet receive a public IPv4 address and instances in a nondefault subnet do not. You can select Enable or Disable to override the subnet's default setting. For more information, see パブリック IPv4 アドレスと外部 DNS ホスト名.

      • Auto-assign IPv6 IP: Specify whether your instance receives an IPv6 address from the range of the subnet. Select Enable or Disable to override the subnet's default setting. This option is only available if you've associated an IPv6 CIDR block with your VPC and subnet. For more information, see Your VPC and Subnets in the Amazon VPC ユーザーガイド.

    • IAM role: Select an AWS Identity and Access Management (IAM) role to associate with the instance. For more information, see Amazon EC2 の IAM ロール.

    • Shutdown behavior: Select whether the instance should stop or terminate when shut down. For more information, see インスタンスによって起動されたシャットダウン動作の変更.

    • Enable termination protection: Select this check box to prevent accidental termination. For more information, see インスタンスの終了保護の有効化.

    • Monitoring: Select this check box to enable detailed monitoring of your instance using Amazon CloudWatch. Additional charges apply. For more information, see CloudWatch を使用したインスタンスのモニタリング.

    • EBS-Optimized instance: An Amazon EBS-optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O. If the instance type supports this feature, select this check box to enable it. Additional charges apply. For more information, see Amazon EBS 最適化インスタンス.

    • Tenancy: If you are launching your instance into a VPC, you can choose to run your instance on isolated, dedicated hardware (Dedicated) or on a Dedicated host (Dedicated host). Additional charges may apply. For more information, see ハードウェア専有インスタンス and Dedicated Hosts.

    • Network interfaces: If you selected a specific subnet, you can specify up to two network interfaces for your instance:

      • For Network Interface, select New network interface to let AWS create a new interface, or select an existing, available network interface.

      • For Primary IP, enter a private IPv4 address from the range of your subnet, or leave Auto-assign to let AWS choose a private IPv4 address for you.

      • For Secondary IP addresses, choose Add IP to assign more than one private IPv4 address to the selected network interface.

      • (IPv6-only) For IPv6 IPs, choose Add IP, and enter an IPv6 address from the range of the subnet, or leave Auto-assign to let AWS choose one for you.

      • Choose Add Device to add a secondary network interface. A secondary network interface can reside in a different subnet of the VPC, provided it's in the same Availability Zone as your instance.

      For more information, see Elastic Network Interface. If you specify more than one network interface, your instance cannot receive a public IPv4 address. Additionally, you cannot override the subnet's public IPv4 setting using Auto-assign Public IP if you specify an existing network interface for eth0. For more information, see インスタンス起動時のパブリック IPv4 アドレスの割り当て.

    • Kernel ID: (Only valid for paravirtual (PV) AMIs) Select Use default unless you want to use a specific kernel.

    • RAM disk ID: (Only valid for paravirtual (PV) AMIs) Select Use default unless you want to use a specific RAM disk. If you have selected a kernel, you may need to select a specific RAM disk with the drivers to support it.

    • Placement group: A placement group is a logical grouping for your cluster instances. Select an existing placement group, or create a new one. This option is only available if you've selected an instance type that supports placement groups. For more information, see プレイスメントグループ.

    • User data: You can specify user data to configure an instance during launch, or to run a configuration script. To attach a file, select the As file option and browse for the file to attach.

  7. On the Add Storage page, you can specify volumes to attach to the instance besides the volumes specified by the AMI (such as the root device volume). You can change the following options, then choose Next: Add Tags when you have finished:

    • Type: Select instance store or Amazon EBS volumes to associate with your instance. The type of volume available in the list depends on the instance type you've chosen. For more information, see Amazon EC2 インスタンスストア and Amazon EBS ボリューム.

    • Device: Select from the list of available device names for the volume.

    • Snapshot: Enter the name or ID of the snapshot from which to restore a volume. You can also search for public snapshots by typing text into the Snapshot field. Snapshot descriptions are case-sensitive.

    • Size: For Amazon EBS-backed volumes, you can specify a storage size. Note that even if you have selected an AMI and instance that are eligible for the free tier, you need to keep under 30 GiB of total storage to stay within the free tier.

      注記

      Linux AMI では、2 TiB (2048 GiB) 以上のブートボリュームには GPT パーティションテーブルと GRUB 2 が必要です。現在の多くの Linux AMI は MBR パーティションスキームを使用しており、最大 2047 GiB のブートボリュームのみをサポートしています。インスタンスが 2 TiB 以上のブートボリュームで起動しない場合、使用中の AMI は、2047 GiB のブートボリュームサイズに制限されている可能性があります。ブートボリューム以外のボリュームには、Linux インスタンスでこの制限はありません。

      注記

      If you increase the size of your root volume at this point (or any other volume created from a snapshot), you need to extend the file system on that volume in order to use the extra space. For more information about extending your file system after your instance has launched, see Linux の EBS ボリュームのサイズ、IOPS、またはタイプの変更.

    • Volume Type: For Amazon EBS volumes, select either a 汎用 SSD, プロビジョンド IOPS SSD, or マグネティック volume. For more information, see Amazon EBS ボリュームの種類.

      注記

      If you select a マグネティック boot volume, you'll be prompted when you complete the wizard to make 汎用 SSD volumes the default boot volume for this instance and future console launches. (This preference persists in the browser session, and does not affect AMIs with プロビジョンド IOPS SSD boot volumes.) We recommended that you make 汎用 SSD volumes the default because they provide a much faster boot experience and they are the optimal volume type for most workloads. For more information, see Amazon EBS ボリュームの種類.

      注記

      2012 年以前に作成された一部の AWS アカウントでは、us-west-1 または ap-northeast-1 で プロビジョンド IOPS SSD (io1) ボリュームをサポートしていないアベイラビリティーゾーンにアクセスできる可能性があります。これらのリージョンの 1 つに io1 ボリュームを作成できない場合 (またはブロックデバイスマッピングに io1 ボリュームのあるインスタンスを起動できない場合) は、リージョンの別のアベイラビリティーゾーンを試します。アベイラビリティーゾーンが io1 ボリュームをサポートするかどうかは、4 GiB の io1 ボリュームをそのゾーンに作成することで確認できます。

    • IOPS: If you have selected a プロビジョンド IOPS SSD volume type, then you can enter the number of I/O operations per second (IOPS) that the volume can support.

    • Delete on Termination: For Amazon EBS volumes, select this check box to delete the volume when the instance is terminated. For more information, see インスタンスの終了で Amazon EBS ボリュームを保持する.

    • Encrypted: Select this check box to encrypt new Amazon EBS volumes. Amazon EBS volumes that are restored from encrypted snapshots are automatically encrypted. Encrypted volumes may only be attached to supported instance types.

  8. On the Add Tags page, specify tags by providing key and value combinations. You can tag the instance, the volumes, or both. Choose Add another tag to add more than one tag to your resources. Choose Next: Configure Security Group when you are done.

  9. On the Configure Security Group page, use a security group to define firewall rules for your instance. These rules specify which incoming network traffic is delivered to your instance. All other traffic is ignored. (For more information about security groups, see Linux インスタンスの Amazon EC2 セキュリティグループ.) Select or create a security group as follows, and then choose Review and Launch.

    To select an existing security group:

    1. Choose Select an existing security group. Your security groups are displayed. (If you are launching into EC2-Classic, these are security groups for EC2-Classic. If you are launching into a VPC, these are security group for that VPC.)

    2. Select a security group from the list.

    3. (Optional) You can't edit the rules of an existing security group, but you can copy them to a new group by choosing Copy to new. Then you can add rules as described in the next procedure.

    To create a new security group:

    1. Choose Create a new security group. The wizard automatically defines the launch-wizard-x security group.

    2. (Optional) You can edit the name and description of the security group.

    3. The wizard automatically defines an inbound rule to allow to you connect to your instance over SSH (port 22) for Linux or RDP (port 3389) for Windows.

      警告

      This rule enables all IP addresses (0.0.0.0/0) to access your instance over the specified port. This is acceptable for this short exercise, but it's unsafe for production environments. You should authorize only a specific IP address or range of addresses to access your instance.

    4. You can add rules to suit your needs. For example, if your instance is a web server, open ports 80 (HTTP) and 443 (HTTPS) to allow Internet traffic.

      To add a rule, choose Add Rule, select the protocol to open to network traffic, and then specify the source. Choose My IP from the Source list to let the wizard add your computer's public IP address. However, if you are connecting through an ISP or from behind your firewall without a static IP address, you need to find out the range of IP addresses used by client computers.

  10. On the Review Instance Launch page, check the details of your instance, and make any necessary changes by choosing the appropriate Edit link.

    When you are ready, choose Launch.

  11. In the Select an existing key pair or create a new key pair dialog box, you can choose an existing key pair, or create a new one. For example, choose Choose an existing key pair, then select the key pair you created when getting set up.

    To launch your instance, select the acknowledgment check box, then choose Launch Instances.

    重要

    If you choose the Proceed without key pair option, you won't be able to connect to the instance unless you choose an AMI that is configured to allow users another way to log in.

  12. (Optional) You can create a status check alarm for the instance (additional fees may apply). (If you're not sure, you can always add one later.) On the confirmation screen, choose Create status check alarms and follow the directions. For more information, see ステータスチェックアラームの作成と編集.

  13. If the instance state immediately goes to terminated instead of running, you can get information about why the instance didn't launch. For more information, see インスタンスがすぐに終了する場合の対処方法.

このページの内容: