---
title: "openstack_compute_instance_v2.md"
description: ""
sidebar_position: 3
---

# openstack\_compute\_instance\_v2

:::info

This instruction is a copy of the official documentation for the OpenStack Terraform provider in the [Terraform Registry](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs).

:::

Use this data source to retrieve details of a running server.

## Example usage \{#example-usage}

```hcl
data "openstack_compute_instance_v2" "instance" {
  # Randomly generated UUID, for demonstration purposes
  id = "2ba26dc6-a12d-4889-8f25-794ea5bf4453"
}
```

## Argument reference \{#argument-reference}

* `id` — (Required) The instance UUID.

## Attributes reference \{#attributes-reference}

In addition to the attributes above, the following are exported:

* `name` — The server name.

* `image_id` — The image ID used to create the server.

* `image_name` — The image name used to create the server.

* `flavor_id` — The flavor ID used to create the server.

* `flavor_name` — The flavor name used to create the server.

* `user_data` — The user data added during server creation.

* `security_groups` — An array of security group names associated with this server.

* `availability_zone` — The availability zone of this server.

* `network` — An array of objects, described below.

* `access_ip_v4` — The first IPv4 address assigned to this server.

* `access_ip_v6` — The first IPv6 address assigned to this server.

* `key_pair` — The name of the key pair assigned to this server.

* `tags` — A set of string tags assigned to this server.

* `metadata` — A set of key/value pairs available to the server.

* `created` — The instance creation time.

* `updated` — The last update time of the instance.

The `network` block is defined as follows:

* `uuid` — The network UUID.

* `name` — The network name.

* `fixed_ip_v4` — The IPv4 address assigned to this network port.

* `fixed_ip_v6` — The IPv6 address assigned to this network port.

* `port` — The network port UUID.

* `mac` — The MAC address assigned to this network interface.
