# Deploy the Simple VM template with OpenTofu

Source: https://docs.quake.ai/resources/deployments/deploy-simple-vm-template
Markdown: https://docs.quake.ai/resources/deployments/deploy-simple-vm-template.md
> Stand up a volume-backed Ubuntu instance on a private network with one floating IP using the simple-vm OpenTofu template.

---

# Deploy the Simple VM template with OpenTofu

Stand up a volume-backed Ubuntu instance on a private network with one floating IP using the [validated OpenTofu template](/docs/platform/validation#how-infrastructure-templates-are-checked) `simple-vm`. The stack wires Compute (Nova), Network (Neutron), and Block Storage (Cinder) for a boot-from-volume instance behind a router, security group, and public IP.

<PricingCompanion
  components={[
    { kind: "template", slug: "simple-vm", required: true },
  ]}
/>

<Figure size="md" caption="Simple VM topology: private network, router, security group, volume-backed instance, and one floating IP">

```d2
direction: right

cloud: Quake AI {
  router: Router
  private: Private network {
    vm: Ubuntu instance\nboot volume
  }
  fip: Floating IP\n(1)
  sg: Security group\nSSH + HTTP
}

cloud.router -> cloud.private
cloud.fip -> cloud.vm
cloud.sg -> cloud.vm
```

</Figure>

## Prerequisites

You need:

- A Quake AI account with [application credentials](/docs/tools/generate-app-credentials) and an SSH key pair already uploaded to the project
- OpenTofu 1.6.0 or later ([installation guide](https://opentofu.org/docs/intro/install/))
- OpenStack credentials sourced into the shell (`source openrc.sh`). See [the OpenStack CLI guide](/docs/tools/openstack-cli).
- A copy of the `simple-vm` template from [the template reference page](/resources/iac-templates/simple-vm)

## Step 1: Configure variables

Copy `terraform.tfvars.example` to `terraform.tfvars` and set `key_name` to an existing key pair in your project:

```hcl
key_name = "YOUR_KEY_NAME"
```

Replace `YOUR_KEY_NAME` with the name shown in the Console under **Compute** > **Key Pairs**, or returned by `openstack keypair list`.

Defaults for flavor, image, network names, and CIDR are documented on the [template reference page](/resources/iac-templates/simple-vm). Override them in `terraform.tfvars` when your project uses different names.

## Step 2: Apply the template

From the template directory, run:

```bash
tofu init
tofu plan
tofu apply
```

Type `yes` when prompted. Provisioning takes a few minutes while Neutron wires the router and Nova builds the boot volume.

When the run finishes, note `floating_ip`, `instance_id`, and `private_ip` from the outputs.

## Step 3: Verify SSH access

Connect as `ubuntu` through the floating IP with the private key that matches `key_name`:

```bash
ssh -i YOUR_PRIVATE_KEY_PATH ubuntu@$(tofu output -raw floating_ip)
```

Accept the host key prompt on first connect. A remote shell confirms the security group, router, and floating IP association work together.

Optional: send an HTTP request to port 80. The security group allows it even though this deployment does not install a web server:

```bash
curl -I --connect-timeout 5 http://$(tofu output -raw floating_ip)
```

A connection timeout or refusal is expected without a listener; the check only confirms the floating IP routes to the instance.

## Next steps

- [Simple VM with Floating IP template](/resources/iac-templates/simple-vm)
- [S3 Storage with ACLs template](/resources/iac-templates/s3-storage-acl)
- [Media streaming](/resources/solutions/media-streaming) and [AI inference and RAG](/resources/solutions/ai-inference-rag) solution patterns that compose this template

## Clean up

Run `tofu destroy` from the project directory when finished. Type `yes` to confirm. Verify in the Console that the instance, boot volume, router, private network, security group, and floating IP are gone.
