# What is Compute?

Compute runs virtual machines in your region, with the networks, firewalls, disks, addresses and images around them.

An instance is a virtual machine launched from an OS image (or one of your own machine images)
onto an instance type you pick. It joins a private network, gets a public IPv6 address and, unless
you turn it off, a public IPv4 address, and boots with your cloud-init user data. Around it sit
security groups, block volumes, volume snapshots, machine images, snapshot policies, elastic IPs and
NAT gateways. You find it under **Compute** in the Deutsche Cloud Console.

## When to use it

- You want a server you log in to and run anything on, with root access.
- You need a fixed public address that moves between machines (an elastic IP), a disk that outlives
  a machine (a volume), or a copy of a machine to launch more of (a machine image).
- A script keeps a pool of machines (preview boxes, CI runners) and finds them by tag; see
  [Drive instances from a script](drive-instances-from-a-script.md).

For groups of machines kept at a size, see [Auto Scaling](/docs/autoscaling). To log in from the
browser, or add a key to a running machine, see Connect to an instance.

## Concepts

| Term                  | Meaning                                                                                                                      |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Instance**          | One virtual machine. Its id looks like `i-3f9a2c07`.                                                                         |
| **Instance type**     | The hardware shape: vCPUs, memory, disk, shared or dedicated CPU, architecture. Named like `performance-2` or `dedicated-4`. |
| **Image**             | The operating system the machine boots from. Each image is for one architecture (`x86_64` or `arm64`).                       |
| **Region**            | `de1`, Germany. `fi1` (Helsinki, Finland) only when your organization allows EU locations outside Germany.                   |
| **Availability zone** | One data-centre location of a region: `de1a` is Falkenstein, `de1b` is Nuremberg.                                            |
| **Network**           | A private network with an IPv4 range (a VPC). Every instance joins one; without a choice, the region's default network.      |
| **Subnet**            | A part of a network's range in one zone. An instance launched into it gets an address in that range and runs in that zone.   |
| **Security group**    | A named set of firewall rules in front of every instance it is attached to.                                                  |
| **Key pair**          | An SSH public key, installed on the machine at first boot when chosen at launch.                                             |
| **Volume**            | Block storage in one zone, attached to one instance at a time, encrypted by default.                                         |
| **Volume snapshot**   | A copy of a volume's blocks, restorable into a new volume in the same zone.                                                  |
| **Machine image**     | A snapshot of an instance's root disk, owned by your organization (`ewi-…`), to launch copies from.                          |
| **Elastic IP**        | A public IPv4 address you hold independently of any machine and move between instances.                                      |
| **User data**         | Your cloud-init script, run once at first boot. The platform adds its own parts in front of it; yours runs unchanged.        |

More in [Instance types and zones](instance-types-and-zones.md),
[Instance lifecycle](instance-lifecycle.md) and [Networks and addresses](networks-and-addresses.md).

## Pricing

- **Instances**: every started hour an instance runs, at its type's price, at most its monthly
  price per calendar month. The price includes the root disk and the public IPv4 address. A
  stopped instance costs nothing per hour; its volumes, snapshots and elastic IPs still count.
- **Volumes**: the full size of every volume, attached or not, measured daily.
- **Elastic IPs, NAT gateways, volume snapshots and machine images, outbound traffic above what an
  instance type includes**: metered (an elastic IP every hour it is allocated, a NAT gateway every
  started hour of its machine, snapshots and images by the data stored, measured daily). Whether
  each is charged or only shown as a would-be cost is set per installation; the cost explorer shows
  either.
- Networks, subnets, security groups, key pairs and snapshot policies cost nothing themselves.

The launch wizard and the forms that create a volume, an elastic IP or a NAT gateway show what it
costs before you create it.

## Interfaces

- The Deutsche Cloud Console: **Compute**.
- The CLI: `dcloud ec2 …`; see the _CLI Command Reference_.
- The HTTP API under `/ec2/api`; see the _API Reference_.
- Terraform: `dcloud_instance`, `dcloud_vpc`, `dcloud_subnet`, `dcloud_security_group`,
  `dcloud_security_group_rule`, `dcloud_volume`, `dcloud_volume_attachment`, `dcloud_volume_snapshot`,
  `dcloud_eip`, `dcloud_eip_association`, `dcloud_nat_gateway`, `dcloud_machine_image`,
  `dcloud_snapshot_policy`, and the key pair `dcloud_key_pair`.

## Next steps

- [Getting started](getting-started.md)
- [Launch an instance](launch-an-instance.md)
