Skip to content
Snippets Groups Projects

Attach an existing volume to ohpc master

Closed Eesaan Atluri requested to merge atlurie/terraform-openstack:feat-attach-vol into master
3 files
+ 10
2
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 7
1
@@ -26,7 +26,7 @@ variable "floating_ip_ohpc" {type = string}
@@ -26,7 +26,7 @@ variable "floating_ip_ohpc" {type = string}
variable "ohpc_user" {}
variable "ohpc_user" {}
variable "ssh_private_key" {}
variable "ssh_private_key" {}
variable "vol_id" {}
# creates details for the OHPC instance
# creates details for the OHPC instance
resource "openstack_compute_instance_v2" "ohpc" {
resource "openstack_compute_instance_v2" "ohpc" {
@@ -61,6 +61,12 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
@@ -61,6 +61,12 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
instance_id = openstack_compute_instance_v2.ohpc.id
instance_id = openstack_compute_instance_v2.ohpc.id
}
}
 
# Attach a volume
 
resource "openstack_compute_volume_attach_v2" "volume_attach" {
 
instance_id = openstack_compute_instance_v2.ohpc.id
 
volume_id = var.vol_id
 
}
 
output "id" {
output "id" {
value = openstack_compute_instance_v2.ohpc.id
value = openstack_compute_instance_v2.ohpc.id
}
}
Loading