1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

さくらのクラウドの Terraform Provider を使うと、Terraform から高火力 VRT(GPU VM)を作成できます。
本記事では、石狩第1ゾーンで V100 / H100 プランのサーバを作成するシンプルな HCL の例を紹介します。

作成できるプラン

石狩第1ゾーンでは、NVIDIA V100 と H100 の高火力 VRT プランを作成できます。

Terraformから作成する際は、sakuracloud_server リソースの、core memory gpu gpu_modelにサーバプランで指定された値を設定し作成します。

サーバプランに対応する core, memory, gpu, gpu_model の値は、usacloud コマンドで確認できます。

$ usacloud iaas server-plan list --zone is1a --names=VRT
+------+-----------+--------------------------------+-----+---------------+------------+-----+----------------------+------------+------------+--------------+
| Zone |    ID     |              Name              | CPU |   CPUModel    | Memory(GB) | GPU |       GPUModel       | Commitment | Generation | Availability |
+------+-----------+--------------------------------+-----+---------------+------------+-----+----------------------+------------+------------+--------------+
| is1a | 201056004 | 高火力 VRT/4Core-56GB-V100x1   | 4   | uncategorized | 56         | 1   | nvidia_v100_32gbvram | standard   | 200        | available    |
| is1a | 210096019 | 高火力 VRT/24Core-240GB-H100x1 | 24  | uncategorized | 240        | 1   | nvidia_h100_80gbvram | standard   | 200        | available    |
+------+-----------+--------------------------------+-----+---------------+------------+-----+----------------------+------------+------------+--------------+

それぞれのサーバプランに対応した HCL の最小構成例を示します。
Terraformの環境構築はすでに完了している前提とします。

高火力 VRT/24Core-240GB-H100x1

data "sakuracloud_archive" "ubuntu" {
  os_type = "ubuntu2404"
  zone    = "is1a"
}

resource "sakuracloud_disk" "h100" {
  name              = "NVIDIA H100"
  source_archive_id = data.sakuracloud_archive.ubuntu.id
  zone              = "is1a"
}

resource "sakuracloud_server" "h100" {
  name      = "NVIDIA H100"
  disks     = [sakuracloud_disk.h100.id]
  core      = 24
  memory    = 240
  gpu       = 1
  gpu_model = "nvidia_h100_80gbvram"

  network_interface {
    upstream = "shared"
  }

  disk_edit_parameter {
    hostname        = "h100"
    disable_pw_auth = true
    ssh_keys = [
      "ssh-ed25519 AAAA...yourkey"
    ]
  }

  zone = "is1a"
}

高火力 VRT/4Core-56GB-V100x1

data "sakuracloud_archive" "ubuntu" {
  os_type = "ubuntu2404"
  zone    = "is1a"
}

resource "sakuracloud_disk" "v100" {
  name              = "NVIDIA V100"
  source_archive_id = data.sakuracloud_archive.ubuntu.id
  zone              = "is1a"
}

resource "sakuracloud_server" "v100" {
  name      = "NVIDIA V100"
  disks     = [sakuracloud_disk.v100.id]
  core      = 4
  memory    = 56
  gpu       = 1
  gpu_model = "nvidia_v100_32gbvram"

  network_interface {
    upstream = "shared"
  }

  disk_edit_parameter {
    hostname        = "v100"
    disable_pw_auth = true
    ssh_keys = [
      "ssh-ed25519 AAAA...yourkey"
    ]
  }
  zone = "is1a"
}

ポイント

高火力 VRT は石狩第1ゾーン(is1a)専用のプランです。
そのため、zone = "is1a" を指定しないとエラーになります。

関連リンク

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?