File tree Expand file tree Collapse file tree 1 file changed +8
-21
lines changed
environments/skeleton/{{cookiecutter.environment}}/terraform/compute Expand file tree Collapse file tree 1 file changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ resource "openstack_blockstorage_volume_v3" "compute" {
20
20
size = var. volumes [each . value . volume ]. size
21
21
}
22
22
23
+ resource "openstack_compute_volume_attach_v2" "compute" {
24
+
25
+ for_each = local. all_compute_volumes
26
+
27
+ instance_id = openstack_compute_instance_v2. compute [" ${ each . value . node } " ]. id
28
+ volume_id = openstack_blockstorage_volume_v3. compute [" ${ each . key } " ]. id
29
+ }
30
+
23
31
resource "openstack_networking_port_v2" "compute" {
24
32
25
33
for_each = toset (var. nodes )
@@ -48,27 +56,6 @@ resource "openstack_compute_instance_v2" "compute" {
48
56
image_id = var. image_id
49
57
flavor_name = var. flavor
50
58
key_pair = var. key_pair
51
-
52
- # root device:
53
- block_device {
54
- uuid = var. image_id
55
- source_type = " image"
56
- destination_type = var. volume_backed_instances ? " volume" : " local"
57
- volume_size = var. volume_backed_instances ? var. root_volume_size : null
58
- boot_index = 0
59
- delete_on_termination = true
60
- }
61
-
62
- # additional volumes:
63
- dynamic "block_device" {
64
- for_each = var. volumes
65
- content {
66
- destination_type = " volume"
67
- source_type = " volume"
68
- boot_index = - 1
69
- uuid = openstack_blockstorage_volume_v3. compute [" ${ each . key } -${ block_device . key } " ]. id
70
- }
71
- }
72
59
73
60
network {
74
61
port = openstack_networking_port_v2. compute [each . key ]. id
You can’t perform that action at this time.
0 commit comments