Skip to content
Snippets Groups Projects
Commit 4b53c40b authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

re-using code to attach volumes

parent 48a6cc18
No related branches found
No related tags found
1 merge request!47Integration Testing: Sequential Merge and Validation of Four Feature Branches (PR #43,#44, #45,#46)
......@@ -9,7 +9,6 @@ required_version = ">= 0.14.0"
}
}
variable "ohpc_instance_name" {}
variable "image_ohpc" {}
variable "flavor" {}
......@@ -76,16 +75,13 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
instance_id = openstack_compute_instance_v2.ohpc.id
}
# Attach specific volumes
resource "openstack_compute_volume_attach_v2" "attach_prod_volume" {
# Attach volumes
resource "openstack_compute_volume_attach_v2" "volume_attach" {
count = length(var.vol_ids)
instance_id = openstack_compute_instance_v2.ohpc.id
volume_id = var.data_volume
volume_id = var.vol_ids[count.index]
}
resource "openstack_compute_volume_attach_v2" "attach_prod_queue_volume" {
instance_id = openstack_compute_instance_v2.ohpc.id
volume_id = var.prod_volume_id
}
output "xdmod_instance_id" {
value = openstack_compute_instance_v2.ohpc.id
}
......@@ -96,7 +92,8 @@ output "ssh_host" {
output "device" {
value = [
openstack_compute_volume_attach_v2.attach_prod_volume.device,
openstack_compute_volume_attach_v2.attach_prod_queue_volume.device
openstack_compute_volume_attach_v2.volume_attach[0].device,
openstack_compute_volume_attach_v2.volume_attach[1].device,
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment