From c9e696d98de5b777e3be8a13bed4b83663a820e1 Mon Sep 17 00:00:00 2001 From: Ellis Pires Date: Wed, 29 Jan 2025 13:06:17 +0000 Subject: [PATCH] Add support for OCI Flex shape management nodes It is not currently possible to define a management node with the type Flex because the shape_config declaration is missing from compute.tf. This patch adds this shape_config declaration block along with support for the parameters that it allows. The extra parameters are specified as default null in variables.tf which should accommodate both Standard and Flex shapes. Signed-off-by: Ellis Pires --- oracle/compute.tf | 9 +++++++++ oracle/terraform.tfvars.example | 7 ++++++- oracle/variables.tf | 25 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/oracle/compute.tf b/oracle/compute.tf index e41f709..41e30c0 100644 --- a/oracle/compute.tf +++ b/oracle/compute.tf @@ -27,6 +27,15 @@ resource "oci_core_instance" "ClusterManagement" { display_name = local.mgmt_hostname shape = var.ManagementShape + # Optional parameters for Flex type management nodes + shape_config { + baseline_ocpu_utilization = var.ManagementOcpuBaselineUtilization + memory_in_gbs = var.ManagementMemory + nvmes = var.ManagementNvmes + ocpus = var.ManagementOcpus + vcpus = var.ManagementVcpus + } + # Make sure that the management node depands on the filesystem so that when # destroying, the filesystem is still running in order to perform cleanup of # any compute nodes. diff --git a/oracle/terraform.tfvars.example b/oracle/terraform.tfvars.example index 5aef704..d0adc6d 100644 --- a/oracle/terraform.tfvars.example +++ b/oracle/terraform.tfvars.example @@ -16,6 +16,11 @@ ssh-rsa UmFuZG9tIGtleSBjb250ZW50cy4gUHV0IHlvdXIgb3duIGtleSBpbiBoZXJlIG9idmlvdXNs ssh-rsa QW5vdGhlciByYW5kb20ga2V5IGNvbnRlbnRzLiBQdXQgeW91ciBvd24ga2V5IGluIGhlcmUgb2J2aW91c2x5Lg== user@anothercomputer EOF -ManagementShape = "VM.Standard2.1" +ManagementShape = "VM.Standard3.Flex" +ManagementOcpus = "4" +ManagementVcpus = "8" +ManagementMemory = "32" +# ManagementOcpuBaselineUtilization = "BASELINE_1_1" +# ManagementNvmes = 1 ManagementAD = "1" FilesystemAD = "1" diff --git a/oracle/variables.tf b/oracle/variables.tf index 59dbfc6..19eabb0 100644 --- a/oracle/variables.tf +++ b/oracle/variables.tf @@ -34,6 +34,31 @@ variable "ManagementShape" { default = "VM.Standard2.1" } +variable "ManagementOcpus" { + description = "The number of OCPUs for the management node" + default = null +} + +variable "ManagementVcpus" { + description = "The number of VCPUs for the management node" + default = null +} + +variable "ManagementMemory" { + description = "The amount of memory for the management node" + default = null +} + +variable "ManagementOcpuBaselineUtilization" { + description = "The baseline OCPU utilization for the management node" + default = null +} + +variable "ManagementNvmes" { + description = "The number of NVMe drives for the management node" + default = null +} + variable "ExportPathFS" { default = "/shared" }