From bc2a25197c62be8bd77d7de96ecbb764012624f1 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 13:53:02 +0000 Subject: [PATCH 01/11] Switch to using a specific version of CentOS Stream This is to workaround the following breakage: ``` TASK [MichaelRigart.interfaces : RedHat | ensure network service is started and enabled] *** Tuesday 21 March 2023 09:43:32 +0000 (0:00:00.347) 0:02:20.016 ********* fatal: [controller0]: FAILED! => changed=false msg: |- Unable to start service network: Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. ``` --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index bf881e5cc..abde70b6f 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -13,7 +13,7 @@ variable "aio_vm_name" { variable "aio_vm_image" { type = string - default = "CentOS-stream8" + default = "CentOS-stream8.2023-03-20" } variable "aio_vm_interface" { From 5c586302d399192c26a9bdf3f906cfa0880bb887 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 14:14:39 +0000 Subject: [PATCH 02/11] Switch to UUID Retrieved this version from: https://github.com/stackhpc/stackhpc-kayobe-config/actions/runs/4449862721/jobs/7814765240#step:8:56 --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index abde70b6f..24eb41875 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -13,7 +13,7 @@ variable "aio_vm_name" { variable "aio_vm_image" { type = string - default = "CentOS-stream8.2023-03-20" + default = "bb8c0a34-533f-42fb-a49b-3461e677f3f6" } variable "aio_vm_interface" { From 9bfbf81a155d1fc6cc62e56711e08fb37d6ffa63 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 14:20:18 +0000 Subject: [PATCH 03/11] Switch to UUID from known good xena job From: https://github.com/stackhpc/stackhpc-kayobe-config/actions/runs/4450001402/jobs/7815038031#step:8:56 --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index 24eb41875..ccb79fa18 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -13,7 +13,7 @@ variable "aio_vm_name" { variable "aio_vm_image" { type = string - default = "bb8c0a34-533f-42fb-a49b-3461e677f3f6" + default = "7efda0b1-e296-447f-896e-c066d0af5c53" } variable "aio_vm_interface" { From bcf9d861d63d923e43bbea2275b00c8fdbeb4e17 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 14:38:58 +0000 Subject: [PATCH 04/11] Try updating interface naming scheme --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index ccb79fa18..22e058d82 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -18,7 +18,7 @@ variable "aio_vm_image" { variable "aio_vm_interface" { type = string - default = "eth0" + default = "ens3" } variable "aio_vm_flavor" { From 341491971c574fbc2233c707eaca249be59c95c2 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 16:54:03 +0000 Subject: [PATCH 05/11] Update image in correct location --- .github/workflows/stackhpc-all-in-one.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stackhpc-all-in-one.yml b/.github/workflows/stackhpc-all-in-one.yml index f819bf7e0..10442e38e 100644 --- a/.github/workflows/stackhpc-all-in-one.yml +++ b/.github/workflows/stackhpc-all-in-one.yml @@ -22,7 +22,7 @@ on: vm_image: description: Image for the all-in-one VM type: string - default: CentOS-stream8 + default: 7efda0b1-e296-447f-896e-c066d0af5c53 vm_interface: description: Default network interface name type: string From 7bf5ab28fddbc97f7bd2fc3d00f5b044657384f3 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 16:54:48 +0000 Subject: [PATCH 06/11] Revert previous changes --- terraform/aio/vm.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index 22e058d82..bf881e5cc 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -13,12 +13,12 @@ variable "aio_vm_name" { variable "aio_vm_image" { type = string - default = "7efda0b1-e296-447f-896e-c066d0af5c53" + default = "CentOS-stream8" } variable "aio_vm_interface" { type = string - default = "ens3" + default = "eth0" } variable "aio_vm_flavor" { From a6f74462942eec0a842d3d9a916c3f476ed32a7a Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 21 Mar 2023 16:58:09 +0000 Subject: [PATCH 07/11] Use last known good image From: https://github.com/stackhpc/stackhpc-kayobe-config/actions/runs/4450001402/jobs/7815037603#step:8:56 --- .github/workflows/stackhpc-all-in-one.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stackhpc-all-in-one.yml b/.github/workflows/stackhpc-all-in-one.yml index 10442e38e..d76a28e8c 100644 --- a/.github/workflows/stackhpc-all-in-one.yml +++ b/.github/workflows/stackhpc-all-in-one.yml @@ -22,7 +22,7 @@ on: vm_image: description: Image for the all-in-one VM type: string - default: 7efda0b1-e296-447f-896e-c066d0af5c53 + default: bb8c0a34-533f-42fb-a49b-3461e677f3f6 vm_interface: description: Default network interface name type: string From d5a5095065eb1705bde82bef81425a0570a6c9cd Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Wed, 22 Mar 2023 09:25:19 +0000 Subject: [PATCH 08/11] Autodetect uuids --- terraform/aio/vm.tf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index bf881e5cc..e7a93ed17 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -33,9 +33,14 @@ variable "aio_vm_subnet" { type = string } +locals { + image_is_uuid = length(regexall('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', aio_vm_image)) > 0 +} + data "openstack_images_image_v2" "image" { name = var.aio_vm_image most_recent = true + count = local.image_is_uuid ? 0 : 1 } data "openstack_networking_subnet_v2" "network" { @@ -52,7 +57,7 @@ resource "openstack_compute_instance_v2" "kayobe-aio" { } block_device { - uuid = data.openstack_images_image_v2.image.id + uuid = local.image_is_uuid ? var.aio_vm_image: data.openstack_images_image_v2.image.id source_type = "image" volume_size = 100 boot_index = 0 From 6a9df0511d01eff25a784002727b532772829fb1 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Wed, 22 Mar 2023 09:29:52 +0000 Subject: [PATCH 09/11] Fixup for previous commit --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index e7a93ed17..8a8bef750 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -34,7 +34,7 @@ variable "aio_vm_subnet" { } locals { - image_is_uuid = length(regexall('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', aio_vm_image)) > 0 + image_is_uuid = length(regexall('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', var.aio_vm_image)) > 0 } data "openstack_images_image_v2" "image" { From 8f8078a05f2a66d0dc827418f0082849da6937dd Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Wed, 22 Mar 2023 09:41:09 +0000 Subject: [PATCH 10/11] Use single quotes for strings --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index 8a8bef750..0c8db9060 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -34,7 +34,7 @@ variable "aio_vm_subnet" { } locals { - image_is_uuid = length(regexall('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', var.aio_vm_image)) > 0 + image_is_uuid = length(regexall("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", var.aio_vm_image)) > 0 } data "openstack_images_image_v2" "image" { From 4bdb882680d3ad032cd3963b61b0ccd916eaf9c7 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Wed, 22 Mar 2023 10:03:22 +0000 Subject: [PATCH 11/11] Resource using count must access via index --- terraform/aio/vm.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index 0c8db9060..6a65cff44 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -57,7 +57,7 @@ resource "openstack_compute_instance_v2" "kayobe-aio" { } block_device { - uuid = local.image_is_uuid ? var.aio_vm_image: data.openstack_images_image_v2.image.id + uuid = local.image_is_uuid ? var.aio_vm_image: data.openstack_images_image_v2.image[0].id source_type = "image" volume_size = 100 boot_index = 0