3.2. CLI を使用した AWS へのインスタンスのデプロイ


AWS Web コンソールまたは CLI から、新しい RHEL AI AMI を使用して AWS インスタンスを起動できます。インスタンスを起動するには、どちらのデプロイメント方法でも使用できます。次の手順では、CLI を使用してカスタム AMI で AWS インスタンスを起動する方法を示します。

デプロイメントオプションとして CLI を使用する場合、「前提条件」に示すように、いくつかの設定を作成する必要があります。

前提条件

  • RHEL AI AMI を作成している。詳細は、「RHEL AI イメージの AWS AMI への変換」を参照してください。
  • AWS コマンドラインツール がインストールされており、aws_access_key_id および aws_secret_access_key で適切に設定されている。
  • Virtual Private Cloud (VPC) が設定されている。
  • インスタンスのサブネットが作成されている。
  • SSH キーペアを作成している。
  • AWS にセキュリティーグループを作成している。

手順

  1. さまざまなパラメーターについては、変数の ID を収集する必要があります。

    1. イメージ ID にアクセスするには、次のコマンドを実行します。

      $ aws ec2 describe-images --owners self
    2. セキュリティーグループ ID にアクセスするには、次のコマンドを実行します。

      $ aws ec2 describe-security-groups
    3. サブネット ID にアクセスするには、次のコマンドを実行します。

      $ aws ec2 describe-subnets
  2. インスタンスを作成するときに環境変数を設定します。

    $ instance_name=rhel-ai-instance
    $ ami=<ami-id>
    $ instance_type=<instance-type-size>
    $ key_name=<key-pair-name>
    $ security_group=<sg-id>
    $ disk_size=<size-of-disk>
  3. 次のコマンドを実行し、変数を使用してインスタンスを作成します。

    $ aws ec2 run-instances \
        --image-id $ami \
        --instance-type $instance_type \
        --key-name $key_name \
        --security-group-ids $security_group \
        --subnet-id $subnet \
        --block-device-mappings DeviceName=/dev/sda1,Ebs='{VolumeSize='$disk_size'}' \
        --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value='$instance_name'}]'

ユーザーアカウント

RHEL AI AMI のデフォルトのユーザーアカウントは cloud-user です。パスワードなしで sudo 経由ですべての権限が与えられています。

検証

  • Red Hat Enterprise Linux AI ツールが正しくインストールされていることを確認するには、ilab コマンドを実行する必要があります。

    $ ilab

    出力例

    $ ilab
    Usage: ilab [OPTIONS] COMMAND [ARGS]...
    
      CLI for interacting with InstructLab.
    
      If this is your first time running ilab, it's best to start with `ilab
      config init` to create the environment.
    
    Options:
      --config PATH  Path to a configuration file.  [default:
                     /home/cloud--user/.config/instructlab/config.yaml]
      -v, --verbose  Enable debug logging (repeat for even more verbosity)
      --version      Show the version and exit.
      --help         Show this message and exit.
    
    Commands:
      config    Command Group for Interacting with the Config of InstructLab.
      data      Command Group for Interacting with the Data generated by...
      model     Command Group for Interacting with the Models in InstructLab.
      system    Command group for all system-related command calls.
      taxonomy  Command Group for Interacting with the Taxonomy of InstructLab.
    
    Aliases:
      chat      model chat
      convert   model convert
      diff      taxonomy diff
      download  model download
      evaluate  model evaluate
      generate  data generate
      init      config init
      list      model list
      serve     model serve
      sysinfo   system info
      test      model test
      train     model train

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る