Skip to main content

okustera_storage_volume_attachment (Resource)

Manages the attachment of a persistent block storage volume (Ceph RBD / OpenStack Cinder) to an active virtual machine instance (OpenStack Nova).

Example Usage​

Attach Ceph Block Storage to Compute VM​

resource "okustera_storage_volume" "database_data" {
name = "pgdata-volume"
size_gb = 100
volume_type = "ssd-fast"
}

resource "okustera_compute_instance" "database_server" {
name = "db-node-01"
flavor_id = data.okustera_compute_flavor.m1_large.id
image_id = data.okustera_image.ubuntu.id
}

resource "okustera_storage_volume_attachment" "db_attach" {
volume_id = okustera_storage_volume.database_data.id
instance_id = okustera_compute_instance.database_server.id
device = "/dev/vdb"
}

Schema​

Required​

  • volume_id (String, Forces new resource) UUID of the Cinder storage volume to attach.
  • instance_id (String, Forces new resource) UUID of the Nova compute instance to attach the volume to.

Optional​

  • device (String, Forces new resource) Guest OS device mount target (e.g. /dev/vdb). If omitted, Nova automatically assigns the next available device slot.

Read-Only​

  • id (String) Combined attachment identifier formatted as <volume_id>/<instance_id>.
  • attachment_id (String) OpenStack Cinder internal volume attachment UUID.

Import​

Volume attachments can be imported using the combined identifier <volume_id>/<instance_id>:

terraform import okustera_storage_volume_attachment.example "vol-12345/inst-67890"