All of lore.kernel.org
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chandan Babu R <chandanbabu@kernel.org>,
	Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 16/31] terraform/OCI: Add a shape selector for Flex shapes
Date: Mon, 31 Mar 2025 20:59:45 -0400	[thread overview]
Message-ID: <20250401010000.764234-17-cel@kernel.org> (raw)
In-Reply-To: <20250401010000.764234-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

It's easier for users to select from a menu of choices rather than
to enter a free-form string.

The selector is moved to a separate file to make it straightforward
to update (either by a human or a script).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/kconfigs/Kconfig.compute     | 20 +----
 terraform/oci/kconfigs/shapes/Kconfig.flex | 85 ++++++++++++++++++++++
 2 files changed, 86 insertions(+), 19 deletions(-)
 create mode 100644 terraform/oci/kconfigs/shapes/Kconfig.flex

diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
index c9e125dcf37a..dc6427d18f42 100644
--- a/terraform/oci/kconfigs/Kconfig.compute
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -1,22 +1,4 @@
-config TERRAFORM_OCI_SHAPE
-	string "OCI shape name"
-	output yaml
-	help
-	  The name of the shape
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-config TERRAFORM_OCI_INSTANCE_FLEX_OCPUS
-	int "Number of flexiable instance OCPUs"
-	default 2
-	help
-	  The number of OCPUs to use per flexible instance.
-
-config TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS
-	int "How much RAM to use per flexible instance in GB"
-	default 4
-	help
-	  How much GiB of RAM to use per flexible instance.
+source "terraform/oci/kconfigs/shapes/Kconfig.flex"
 
 config TERRAFORM_OCI_OS_IMAGE_OCID
 	string "OCI OS image OCID"
diff --git a/terraform/oci/kconfigs/shapes/Kconfig.flex b/terraform/oci/kconfigs/shapes/Kconfig.flex
new file mode 100644
index 000000000000..80ebccc59d6a
--- /dev/null
+++ b/terraform/oci/kconfigs/shapes/Kconfig.flex
@@ -0,0 +1,85 @@
+choice
+	prompt "OCI shape"
+	default TERRAFORM_OCI_SHAPE_VM_STANDARD3_FLEX
+	help
+	  Select the basic hardware capabilities that are in each
+	  instance. For more detail, see:
+
+	  https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#flexible
+
+config TERRAFORM_OCI_SHAPE_VM_STANDARD3_FLEX
+	bool "VM.Standard3.Flex"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Selecting this option provisions each guest with between 1
+	  and 32 OCPUs (physical cores) and up to 512MB of memory.
+
+config TERRAFORM_OCI_SHAPE_VM_STANDARD_E4_FLEX
+	bool "VM.Standard.E4.Flex"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Selecting this option provisions each guest with between 1
+	  and 114 OCPUs (physical AMD cores) and up to 1760MB of memory.
+
+config TERRAFORM_OCI_SHAPE_VM_STANDARD_E5_FLEX
+	bool "VM.Standard.E5.Flex"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Selecting this option provisions each guest with between 1
+	  and 94 OCPUs (physical AMD cores) and up to 1048MB of memory.
+
+config TERRAFORM_OCI_SHAPE_VM_STANDARD_A1_FLEX
+	bool "VM.Standard.A1.Flex"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Selecting this option provisions each guest with between 1
+	  and 80 OCPUs (physical ARM cores) and up to 512MB of memory.
+
+config TERRAFORM_OCI_SHAPE_VM_STANDARD_A2_FLEX
+	bool "VM.Standard.A2.Flex"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Selecting this option provisions each guest with between 1
+	  and 78 OCPUs (physical ARM cores) and up to 946MB of memory.
+
+config TERRAFORM_OCI_SHAPE_VM_DENSEIO_E4_FLEX
+	bool "VM.DenseIO.E4.Flex"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Selecting this option provisions each instance with either
+	  8 OCPUs and 128 GB memory, 16 OCPUs and 256 GB memory, or
+	  32 OCPUs and 512 GB memory. CPUs are based on the AMD
+	  x86_64 platform.
+
+config TERRAFORM_OCI_SHAPE_VM_OPTIMIZED3_FLEX
+	bool "VM.Optimized3.Flex"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Selecting this option provisions each instance with up to
+	  18 OCPUS. The memory provisioned for each instance is
+	  typically matches a multiple of the number of OCPUS.
+
+endchoice
+
+config TERRAFORM_OCI_SHAPE
+	string
+	output yaml
+	default "VM.Standard3.Flex" if TERRAFORM_OCI_SHAPE_VM_STANDARD3_FLEX
+	default "VM.Standard.E4.Flex" if TERRAFORM_OCI_SHAPE_VM_STANDARD_E4_FLEX
+	default "VM.Standard.E5.Flex" if TERRAFORM_OCI_SHAPE_VM_STANDARD_E5_FLEX
+	default "VM.Standard.A1.Flex" if TERRAFORM_OCI_SHAPE_VM_STANDARD_A1_FLEX
+	default "VM.Standard.A2.Flex" if TERRAFORM_OCI_SHAPE_VM_STANDARD_A2_FLEX
+	default "VM.DenseIO.E4.Flex" if TERRAFORM_OCI_SHAPE_VM_DENSEIO_E4_FLEX
+	default "VM.Optimized3.Flex" if TERRAFORM_OCI_SHAPE_VM_OPTIMIZED3_FLEX
+
+config TERRAFORM_OCI_INSTANCE_FLEX_OCPUS
+	int "Number of flexible instance OCPUs"
+	default 2
+	help
+	  The number of OCPUs to use per flexible instance.
+
+config TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS
+	int "How much RAM to use per flexible instance in GB"
+	default 4
+	help
+	  How much GiB of RAM to use per flexible instance.
-- 
2.48.1


  parent reply	other threads:[~2025-04-01  1:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
2025-04-01  0:59 ` [RFC PATCH 01/31] terraform/OCI: Remove terraform_oci_instance_display_name cel
2025-04-01  0:59 ` [RFC PATCH 02/31] terraform/OCI: One default value to rule them cel
2025-04-01  0:59 ` [RFC PATCH 03/31] terraform/OCI: Add an "Identity & Access" submenu cel
2025-04-01  0:59 ` [RFC PATCH 04/31] terraform/OCI: Add a "Resource location" submenu cel
2025-04-01  0:59 ` [RFC PATCH 05/31] terraform/OCI: Add a "Compute" Kconfig submenu cel
2025-04-01  0:59 ` [RFC PATCH 06/31] terraform/OCI: Add a "Storage" " cel
2025-04-01  0:59 ` [RFC PATCH 07/31] terraform/OCI: Add a "Networking" " cel
2025-04-01  0:59 ` [RFC PATCH 08/31] terraform/OCI: Use "output yaml" for the tenancy OCID cel
2025-04-01  0:59 ` [RFC PATCH 09/31] terraform/OCI: Use "output yaml" for the user OCID cel
2025-04-01  0:59 ` [RFC PATCH 10/31] terraform/OCI: Use "output yaml" for the signing key cel
2025-04-01  0:59 ` [RFC PATCH 11/31] terraform/OCI: Use "output yaml" for the fingerprint cel
2025-04-01  0:59 ` [RFC PATCH 12/31] terraform/OCI: Add a Region selector cel
2025-04-01  0:59 ` [RFC PATCH 13/31] terraform/OCI: Add an availability domain selector cel
2025-04-01  0:59 ` [RFC PATCH 14/31] terraform/OCI: Select your compartment by name instead of by OCID cel
2025-04-01  0:59 ` [RFC PATCH 15/31] terraform/OCI: Use "output yaml" for the instance shape setting cel
2025-04-01  0:59 ` cel [this message]
2025-04-01  0:59 ` [RFC PATCH 17/31] terraform/OCI: Use "output yaml" for the OCPUs setting cel
2025-04-01  0:59 ` [RFC PATCH 18/31] terraform/OCI: Use "output yaml" for the memory_in_gbs setting cel
2025-04-01  0:59 ` [RFC PATCH 19/31] terraform/OCI: Add a shape family selector cel
2025-04-01  0:59 ` [RFC PATCH 20/31] terraform/OCI: Add a bare metal shape selector cel
2025-04-01  0:59 ` [RFC PATCH 21/31] terraform/OCI: Use "output yaml" for the source image setting cel
2025-04-01  0:59 ` [RFC PATCH 22/31] terraform/OCI: Simplify image selection cel
2025-04-01  0:59 ` [RFC PATCH 23/31] terraform/OCI: Remove TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA cel
2025-04-01  0:59 ` [RFC PATCH 24/31] terraform/OCI: Use "output yaml" for the assign_public_ip" setting cel
2025-04-01  0:59 ` [RFC PATCH 25/31] terraform/OCI: Use "output yaml" for the subnet_ocid setting cel
2025-04-01  0:59 ` [RFC PATCH 26/31] terraform/OCI: Add a default VCN cel
2025-04-01  0:59 ` [RFC PATCH 27/31] terraform/OCI: Add a Kconfig switch to create a VCN on the fly cel
2025-04-01  0:59 ` [RFC PATCH 28/31] terraform/OCI: Run "terraform fmt" on provider.tf cel
2025-04-01  0:59 ` [RFC PATCH 29/31] terraform/OCI: Run "terraform fmt" on main.tf cel
2025-04-01  0:59 ` [RFC PATCH 30/31] terraform/OCI: Nit: alphabetize vars.tf cel
2025-04-01  1:00 ` [RFC PATCH 31/31] terraform/OCI: Update the OCI section of docs/kdevops-terraform.md cel
2025-04-02 19:21 ` [RFC PATCH 00/31] Simplify OCI configuration menu Luis Chamberlain
2025-04-02 19:24   ` Luis Chamberlain
2025-04-02 19:38   ` Chuck Lever
2025-04-02 20:08     ` Luis Chamberlain
2025-04-08 12:42       ` Chandan Babu R
2025-04-08 13:20         ` Chuck Lever
2025-04-09  4:04           ` Chandan Babu R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250401010000.764234-17-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chandanbabu@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.