Skip to main content

dtcloud_vms (Data Source)

Lists the virtual machines in the active region and project.

The list endpoint returns a lighter record than the details endpoint: no image, no SSH key, no timestamps and no per-interface detail. Use dtcloud_vm for the full picture of one machine.

Example Usage​

# Every running machine.
data "dtcloud_vms" "running" {
status = "ACTIVE"
}

# Everything attached to one security group -- the usual way to find what a rule
# change is about to affect.
data "dtcloud_vms" "behind_web_sg" {
security_group_name = "web-tier"
}

Schema​

Optional​

  • security_group_name (String) Only return VMs attached to this security group.
  • status (String) Only return VMs in this status, e.g. ACTIVE or SHUTOFF.
  • task (String) Only return VMs with this in-flight task.

Read-Only​

  • id (String) The ID of this resource.
  • vms (List of Object) The matching virtual machines. (see below for nested schema)

Nested Schema for vms​

Read-Only:

  • id (String)
  • ip_addresses (List of String)
  • name (String)
  • ram (String)
  • status (String)
  • storage (Number)
  • task_state (String)
  • vcpus (Number)
  • volume_size (Number)

Behaviour worth knowing​

  • The filters are passed to the API as query parameters, so a filtered list is a single call.
  • The data source's own id is a hash of the machine ids it returned, so a list that has not changed does not show up as a change.