Skip to main content

dtcloud_volume (Data Source)

Looks up one volume by id.

Use it to reference a volume Terraform did not create, such as an existing disk to attach to a new machine. Declaring it as a resource instead would hand Terraform ownership of it, and a later terraform destroy would delete the volume and its snapshots.

Example Usage​

data "dtcloud_volume" "data" {
id = var.volume_id
}

Schema​

Required​

  • id (String) ID of the volume to look up.

Read-Only​

  • attached_to (String) Name of the VM this volume is attached to.
  • attached_to_id (String) ID of the VM this volume is attached to.
  • attached_to_status (String) Status of the VM this volume is attached to.
  • bootable (Boolean) Whether the volume can be booted from.
  • created (String) When the volume was created.
  • image_metadata (List of Object) Details of the image this volume was created from. Empty for a blank volume. (see below for nested schema)
  • is_detachable (Boolean) Whether the platform will allow this volume to be detached.
  • last_modified (String) When the volume last changed.
  • name (String) Name of the volume.
  • size (Number) Size in GB.
  • status (String) Status reported by the platform.
  • storage_policy (String) Storage policy backing the volume.
  • volume_type (String) HDD, or CD-ROM when the volume holds an ISO.

Nested Schema for image_metadata​

Read-Only:

  • checksum (String)
  • container_format (String)
  • disk_format (String)
  • image_id (String)
  • image_name (String)
  • min_disk (String)
  • min_ram (String)
  • os_distro (String)
  • os_type (String)
  • size (String)

Behaviour worth knowing​

warning

There is no description. The API accepts one when writing but never reports it back, so there is nothing for this data source to read.

  • A volume that does not exist is an error, not an empty result.