public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [RFC PATCH 00/31] Simplify OCI configuration menu
@ 2025-04-01  0:59 cel
  2025-04-01  0:59 ` [RFC PATCH 01/31] terraform/OCI: Remove terraform_oci_instance_display_name cel
                   ` (31 more replies)
  0 siblings, 32 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Over the past month or two I've had to set up kdevops with all
four major public cloud providers in order to test the new
volume_group role on each of them. There are a lot of similarities
amongst the providers, and one of them is that set-up is probably
much more complicated than necessary for all of them.

I've come up with some simplifications that can apply to all of
the providers, but I'd like to start with OCI because it looks to me
like it's the one that has the most users currently. Let's figure
out what OCI configuration needs to look like (ie, what changes its
users will tolerate!) and make the other providers work the same
way.

This series features a number of changes:

- The configuration is split into several submenus, just like
  the cloud console, to help humans navigate the complexity

- A number of internal simplifications will help us keep up
  with changes and new features in the provider. In particular,
  splitting things into smaller files will make it simpler to
  add scripts to poll provider feature changes and adjust the
  kdevops menus accordingly

- Free-form strings and "copy this OCID from the console" are
  replaced with "choose from this menu of known-working options".
  This includes selection of region, availability domain, shape,
  and source image

- I've added an option to provision a VCN instead of assuming
  a pre-existing one, similar to how the other providers work

Some of this stuff will make immediate sense, and some might be
controversial. All comments are welcome.

https://github.com/chucklever/kdevops   branch => terraform-oci

Chuck Lever (31):
  terraform/OCI: Remove terraform_oci_instance_display_name
  terraform/OCI: One default value to rule them
  terraform/OCI: Add an "Identity & Access" submenu
  terraform/OCI: Add a "Resource location" submenu
  terraform/OCI: Add a "Compute" Kconfig submenu
  terraform/OCI: Add a "Storage" Kconfig submenu
  terraform/OCI: Add a "Networking" Kconfig submenu
  terraform/OCI: Use "output yaml" for the tenancy OCID
  terraform/OCI: Use "output yaml" for the user OCID
  terraform/OCI: Use "output yaml" for the signing key
  terraform/OCI: Use "output yaml" for the fingerprint
  terraform/OCI: Add a Region selector
  terraform/OCI: Add an availability domain selector
  terraform/OCI: Select your compartment by name instead of by OCID
  terraform/OCI: Use "output yaml" for the instance shape setting
  terraform/OCI: Add a shape selector for Flex shapes
  terraform/OCI: Use "output yaml" for the OCPUs setting
  terraform/OCI: Use "output yaml" for the memory_in_gbs setting
  terraform/OCI: Add a shape family selector
  terraform/OCI: Add a bare metal shape selector
  terraform/OCI: Use "output yaml" for the source image setting
  terraform/OCI: Simplify image selection
  terraform/OCI: Remove TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
  terraform/OCI: Use "output yaml" for the assign_public_ip" setting
  terraform/OCI: Use "output yaml" for the subnet_ocid setting
  terraform/OCI: Add a default VCN
  terraform/OCI: Add a Kconfig switch to create a VCN on the fly
  terraform/OCI: Run "terraform fmt" on provider.tf
  terraform/OCI: Run "terraform fmt" on main.tf
  terraform/OCI: Nit: alphabetize vars.tf
  terraform/OCI: Update the OCI section of docs/kdevops-terraform.md

 docs/kdevops-terraform.md                     | 117 +++----
 playbooks/roles/gen_tfvars/defaults/main.yml  |  20 +-
 .../templates/oci/terraform.tfvars.j2         |  20 +-
 scripts/terraform.Makefile                    |  31 --
 terraform/oci/Kconfig                         | 289 +-----------------
 terraform/oci/kconfigs/Kconfig.compute        |  72 +++++
 terraform/oci/kconfigs/Kconfig.identity       |  35 +++
 terraform/oci/kconfigs/Kconfig.location       |  52 ++++
 terraform/oci/kconfigs/Kconfig.network        |  39 +++
 terraform/oci/kconfigs/Kconfig.storage        | 137 +++++++++
 .../oci/kconfigs/images/Kconfig.OracleLinux   | 237 ++++++++++++++
 terraform/oci/kconfigs/images/Kconfig.Ubuntu  | 162 ++++++++++
 terraform/oci/kconfigs/images/Kconfig.custom  |  20 ++
 .../kconfigs/regions/Kconfig.ap-hyderabad-1   |  28 ++
 .../oci/kconfigs/regions/Kconfig.ap-mumbai-1  |  27 ++
 .../kconfigs/regions/Kconfig.ca-montreal-1    |  28 ++
 .../oci/kconfigs/regions/Kconfig.ca-toronto-1 |  28 ++
 .../oci/kconfigs/regions/Kconfig.us-ashburn-1 |  36 +++
 .../oci/kconfigs/regions/Kconfig.us-chicago-1 |  36 +++
 .../oci/kconfigs/regions/Kconfig.us-phoenix-1 |  36 +++
 .../oci/kconfigs/regions/Kconfig.us-sanjose-1 |  28 ++
 terraform/oci/kconfigs/shapes/Kconfig.bm      |  83 +++++
 terraform/oci/kconfigs/shapes/Kconfig.flex    | 104 +++++++
 terraform/oci/main.tf                         | 195 +++++++++---
 terraform/oci/provider.tf                     |  10 +-
 terraform/oci/vars.tf                         | 158 +++++-----
 26 files changed, 1472 insertions(+), 556 deletions(-)
 create mode 100644 terraform/oci/kconfigs/Kconfig.compute
 create mode 100644 terraform/oci/kconfigs/Kconfig.identity
 create mode 100644 terraform/oci/kconfigs/Kconfig.location
 create mode 100644 terraform/oci/kconfigs/Kconfig.network
 create mode 100644 terraform/oci/kconfigs/Kconfig.storage
 create mode 100644 terraform/oci/kconfigs/images/Kconfig.OracleLinux
 create mode 100644 terraform/oci/kconfigs/images/Kconfig.Ubuntu
 create mode 100644 terraform/oci/kconfigs/images/Kconfig.custom
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ap-hyderabad-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ap-mumbai-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ca-montreal-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ca-toronto-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-ashburn-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-chicago-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1
 create mode 100644 terraform/oci/kconfigs/shapes/Kconfig.bm
 create mode 100644 terraform/oci/kconfigs/shapes/Kconfig.flex

-- 
2.48.1


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [RFC PATCH 01/31] terraform/OCI: Remove terraform_oci_instance_display_name
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 02/31] terraform/OCI: One default value to rule them cel
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

This variable is neither set via Kconfig nor referenced in
terraform/oci/main.tf.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/gen_tfvars/defaults/main.yml                 | 1 -
 playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 | 1 -
 terraform/oci/vars.tf                                        | 5 -----
 3 files changed, 7 deletions(-)

diff --git a/playbooks/roles/gen_tfvars/defaults/main.yml b/playbooks/roles/gen_tfvars/defaults/main.yml
index fa317939d82d..e892d85572a8 100644
--- a/playbooks/roles/gen_tfvars/defaults/main.yml
+++ b/playbooks/roles/gen_tfvars/defaults/main.yml
@@ -60,7 +60,6 @@ terraform_oci_instance_flex_ocpus: "invalid"
 terraform_oci_instance_flex_memory_in_gbs: "invalid"
 terraform_oci_os_image_ocid: "invalid"
 terraform_oci_assign_public_ip: "invalid"
-terraform_oci_instance_display_name: "invalid"
 terraform_oci_subnet_ocid: "invalid"
 terraform_oci_data_volume_display_name: "invalid"
 terraform_oci_data_volume_device_file_name: "invalid"
diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index 2d45fd77d510..f7b9ffb48c64 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -10,7 +10,6 @@ oci_instance_flex_ocpus = {{ terraform_oci_instance_flex_ocpus }}
 oci_instance_flex_memory_in_gbs = {{ terraform_oci_instance_flex_memory_in_gbs }}
 oci_os_image_ocid = "{{ terraform_oci_os_image_ocid }}"
 oci_assign_public_ip = "{{ terraform_oci_assign_public_ip | lower }}"
-oci_instance_display_name = "{{ terraform_oci_instance_display_name }}"
 oci_subnet_ocid = "{{ terraform_oci_subnet_ocid }}"
 oci_volumes_enable_extra = "{{ terraform_oci_volumes_enable_extra | lower }}"
 {% if terraform_oci_volumes_enable_extra %}
diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index 077a9a4afdaa..f43e1ee281fc 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -55,11 +55,6 @@ variable "oci_os_image_ocid" {
   default = ""
 }
 
-variable "oci_instance_display_name" {
-  description = "Name of the instance"
-  default = ""
-}
-
 variable "oci_assign_public_ip" {
   description = "Assign public IP to the instance"
   default = false
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 02/31] terraform/OCI: One default value to rule them
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 03/31] terraform/OCI: Add an "Identity & Access" submenu cel
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

There are 3 sets of default values for each terraform setting.

1. The default value set in terraform/oci/Kconfig
2. The default value in playbooks/roles/gen_tfvars/defaults/main.yml
3. The default value specified in terraform/oci/vars.tf

Often these defaults are different values. It's confusing for
developers, but worse is that it can result in hard-to-diagnose
terraform provider error messages (eg, "Where did that 'invalid'
come from?").

IMO a better plan is to let Kconfig provide the only default value,
and remove the other two. We then have a single authoritative
default value for each setting.

If a required variable is missing a value during "terraform plan",
that will always be a local bug, not something exposed to the
provider to report via an obscure error message.

There are two exceptions:

- For  Kconfig booleans, often the variable is defined with a "y"
  value in the "true" case, but not defined at all in the "false"
  case. So for booleans, the gen_tfvars template needs a default
  value in gen_tfvars/defaults/main.yml of "false".

- Where a terraform resource expects an argument to be not present
  in some configurations, then vars.tf needs to explicitly define a
  default value of "null". Only in those cases it is OK for no
  value to be provided by Kconfig.

This is a refactoring change; no behavior change is intended.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/gen_tfvars/defaults/main.yml | 18 +--------
 terraform/oci/vars.tf                        | 42 ++++++++++----------
 2 files changed, 21 insertions(+), 39 deletions(-)

diff --git a/playbooks/roles/gen_tfvars/defaults/main.yml b/playbooks/roles/gen_tfvars/defaults/main.yml
index e892d85572a8..f64102b2fbf5 100644
--- a/playbooks/roles/gen_tfvars/defaults/main.yml
+++ b/playbooks/roles/gen_tfvars/defaults/main.yml
@@ -48,23 +48,7 @@ terraform_gce_scatch_disk_type: "invalid"
 terraform_gce_image_name: "invalid"
 terraform_gce_credentials: "invalid"
 
-terraform_oci_region: "invalid"
-terraform_oci_tenancy_ocid: "invalid"
-terraform_oci_user_ocid: "invalid"
-terraform_oci_user_private_key_path: "invalid"
-terraform_oci_user_fingerprint: "invalid"
-terraform_oci_availablity_domain_ocid: "invalid"
-terraform_oci_compartment_ocid: "invalid"
-terraform_oci_shape: "invalid"
-terraform_oci_instance_flex_ocpus: "invalid"
-terraform_oci_instance_flex_memory_in_gbs: "invalid"
-terraform_oci_os_image_ocid: "invalid"
-terraform_oci_assign_public_ip: "invalid"
-terraform_oci_subnet_ocid: "invalid"
-terraform_oci_data_volume_display_name: "invalid"
-terraform_oci_data_volume_device_file_name: "invalid"
-terraform_oci_sparse_volume_display_name: "invalid"
-terraform_oci_sparse_volume_device_file_name: "invalid"
+terraform_oci_assign_public_ip: "false"
 
 terraform_openstack_cloud_name: "invalid"
 terraform_openstack_instance_prefix: "invalid"
diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index f43e1ee281fc..4c6383d9b231 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -1,103 +1,101 @@
 variable "oci_region" {
   description = "An OCI region"
-  default = ""
+  type        = string
 }
 
 variable "oci_tenancy_ocid" {
   description = "OCID of your tenancy"
-  default = ""
+  type        = string
 }
 
 variable "oci_user_ocid" {
   description = "OCID of the user calling the API"
-  default = ""
+  type        = string
 }
 
 variable "oci_user_private_key_path" {
   description = "The path of the private key stored on your computer"
-  default = ""
+  type        = string
 }
 
 variable "oci_user_fingerprint" {
   description = "Fingerprint for the key pair being used"
-  default = ""
+  type        = string
 }
 
 variable "oci_availablity_domain" {
   description = "Name of availability domain"
-  default = ""
+  type        = string
 }
 
 variable "oci_compartment_ocid" {
   description = "OCID of compartment"
-  default = ""
+  type        = string
 }
 
 variable "oci_shape" {
   description = "Shape name"
-  default = ""
+  type        = string
 }
 
 variable "oci_instance_flex_ocpus" {
+  default     = null
   description = "The total number of OCPUs available to the instance."
-  type = number
-  default = null
+  type        = number
 }
 
 variable "oci_instance_flex_memory_in_gbs" {
+  default     = null
   description = "The total amount of memory available to the instance, in gigabytes."
-  type = number
-  default = null
+  type        = number
 }
 
 variable "oci_os_image_ocid" {
   description = "OCID of OS image"
-  default = ""
+  type        = string
 }
 
 variable "oci_assign_public_ip" {
   description = "Assign public IP to the instance"
-  default = false
+  type        = bool
 }
 
 variable "oci_subnet_ocid" {
   description = "Subnet OCID"
-  default = ""
+  type        = string
 }
 
 variable "oci_volumes_enable_extra" {
   description = "Create additional block volumes per instance"
-  default     = false
+  type        = bool
 }
 
 variable "oci_volumes_per_instance" {
   description = "The count of additional block volumes per instance"
   type        = number
-  default     = 0
 }
 
 variable "oci_volumes_size" {
   description = "The size of additional block volumes, in gibibytes"
   type        = number
-  default     = 0
 }
 
 variable "oci_data_volume_display_name" {
   description = "Display name to use for the data volume"
-  default = "data"
+  type        = string
 }
 
 variable oci_data_volume_device_file_name {
   description = "Data volume's device file name"
-  default = "/dev/oracleoci/oraclevdb"
+  type        = string
 }
 
 variable "oci_sparse_volume_display_name" {
   description = "Display name to use for the sparse volume"
-  default = "sparse"
+  type        = string
 }
 
 variable oci_sparse_volume_device_file_name {
   description = "Sparse volume's device file name"
-  default = "/dev/oracleoci/oraclevdc"
+  type        = string
 }
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 03/31] terraform/OCI: Add an "Identity & Access" submenu
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 04/31] terraform/OCI: Add a "Resource location" submenu cel
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

To follow the same topic organization as the web cloud console, move
the identity and access selectors into a submenu.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/Kconfig                   | 32 ++++---------------------
 terraform/oci/kconfigs/Kconfig.identity | 27 +++++++++++++++++++++
 2 files changed, 31 insertions(+), 28 deletions(-)
 create mode 100644 terraform/oci/kconfigs/Kconfig.identity

diff --git a/terraform/oci/Kconfig b/terraform/oci/Kconfig
index 00f03163ed83..446a49e76b57 100644
--- a/terraform/oci/Kconfig
+++ b/terraform/oci/Kconfig
@@ -1,5 +1,9 @@
 if TERRAFORM_OCI
 
+menu "Identity & Access"
+source "terraform/oci/kconfigs/Kconfig.identity"
+endmenu
+
 config TERRAFORM_OCI_REGION
 	string "OCI Region"
 	help
@@ -7,34 +11,6 @@ config TERRAFORM_OCI_REGION
 	  Read this:
 	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
 
-config TERRAFORM_OCI_TENANCY_OCID
-	string "OCI tenant OCID"
-	help
-	  The OCI ID of the tenancy to use.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-config TERRAFORM_OCI_USER_OCID
-	string "OCI user OCID"
-	help
-	  The OCI ID of the user to use.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-config TERRAFORM_OCI_USER_PRIVATE_KEY_PATH
-	string "OCI user private key path"
-	help
-	  Path to the file containing the private key of the user.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-config TERRAFORM_OCI_USER_FINGERPRINT
-	string "OCI user fingerprint"
-	help
-	  Fingerprint for the key pair being used.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
 config TERRAFORM_OCI_AVAILABLITY_DOMAIN
 	string "OCI availablity domain"
 	help
diff --git a/terraform/oci/kconfigs/Kconfig.identity b/terraform/oci/kconfigs/Kconfig.identity
new file mode 100644
index 000000000000..928c700d9bd4
--- /dev/null
+++ b/terraform/oci/kconfigs/Kconfig.identity
@@ -0,0 +1,27 @@
+config TERRAFORM_OCI_TENANCY_OCID
+	string "OCI tenant OCID"
+	help
+	  The OCI ID of the tenancy to use.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+
+config TERRAFORM_OCI_USER_OCID
+	string "OCI user OCID"
+	help
+	  The OCI ID of the user to use.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+
+config TERRAFORM_OCI_USER_PRIVATE_KEY_PATH
+	string "OCI user private key path"
+	help
+	  Path to the file containing the private key of the user.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+
+config TERRAFORM_OCI_USER_FINGERPRINT
+	string "OCI user fingerprint"
+	help
+	  Fingerprint for the key pair being used.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 04/31] terraform/OCI: Add a "Resource location" submenu
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (2 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 03/31] terraform/OCI: Add an "Identity & Access" submenu cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 05/31] terraform/OCI: Add a "Compute" Kconfig submenu cel
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Introduce the strategy of moving these submenus to their own
separate Kconfig files to eventually enable their generation by
querying the provider with a script (similar to "make
refs-default"). This would allow the Kconfig menu content to be
adjusted based on the intersection of what is currently available
on the provider platform and what is accessible to the tenant.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/Kconfig                   | 24 +++---------------------
 terraform/oci/kconfigs/Kconfig.location | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 21 deletions(-)
 create mode 100644 terraform/oci/kconfigs/Kconfig.location

diff --git a/terraform/oci/Kconfig b/terraform/oci/Kconfig
index 446a49e76b57..31bd2ca617f6 100644
--- a/terraform/oci/Kconfig
+++ b/terraform/oci/Kconfig
@@ -1,30 +1,12 @@
 if TERRAFORM_OCI
 
+menu "Resource location"
+source "terraform/oci/kconfigs/Kconfig.location"
+endmenu
 menu "Identity & Access"
 source "terraform/oci/kconfigs/Kconfig.identity"
 endmenu
 
-config TERRAFORM_OCI_REGION
-	string "OCI Region"
-	help
-	  This option will set the OCI resource location.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-config TERRAFORM_OCI_AVAILABLITY_DOMAIN
-	string "OCI availablity domain"
-	help
-	  The name of the availability domain.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-config TERRAFORM_OCI_COMPARTMENT_OCID
-	string "OCI compartment OCID"
-	help
-	  The OCI ID of user's compartment.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
 config TERRAFORM_OCI_SHAPE
 	string "OCI shape name"
 	help
diff --git a/terraform/oci/kconfigs/Kconfig.location b/terraform/oci/kconfigs/Kconfig.location
new file mode 100644
index 000000000000..9e06aa9332f8
--- /dev/null
+++ b/terraform/oci/kconfigs/Kconfig.location
@@ -0,0 +1,20 @@
+config TERRAFORM_OCI_REGION
+	string "OCI Region"
+	help
+	  This option will set the OCI resource location.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+
+config TERRAFORM_OCI_AVAILABLITY_DOMAIN
+	string "OCI availablity domain"
+	help
+	  The name of the availability domain.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+
+config TERRAFORM_OCI_COMPARTMENT_OCID
+	string "OCI compartment OCID"
+	help
+	  The OCI ID of user's compartment.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 05/31] terraform/OCI: Add a "Compute" Kconfig submenu
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (3 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 04/31] terraform/OCI: Add a "Resource location" submenu cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 06/31] terraform/OCI: Add a "Storage" " cel
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

The image and shape are typically selected in the same panel
on the OCI cloud console.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/Kconfig                  | 29 +++-----------------------
 terraform/oci/kconfigs/Kconfig.compute | 25 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 26 deletions(-)
 create mode 100644 terraform/oci/kconfigs/Kconfig.compute

diff --git a/terraform/oci/Kconfig b/terraform/oci/Kconfig
index 31bd2ca617f6..897501a5aebb 100644
--- a/terraform/oci/Kconfig
+++ b/terraform/oci/Kconfig
@@ -3,36 +3,13 @@ if TERRAFORM_OCI
 menu "Resource location"
 source "terraform/oci/kconfigs/Kconfig.location"
 endmenu
+menu "Compute"
+source "terraform/oci/kconfigs/Kconfig.compute"
+endmenu
 menu "Identity & Access"
 source "terraform/oci/kconfigs/Kconfig.identity"
 endmenu
 
-config TERRAFORM_OCI_SHAPE
-	string "OCI shape name"
-	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.
-
-config TERRAFORM_OCI_OS_IMAGE_OCID
-	string "OCI OS image OCID"
-	help
-	  The OCI ID of the OS image to use.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
 config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
 	bool "Assign public IP address to the cloud instance"
 	default y
diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
new file mode 100644
index 000000000000..b794ef2d5190
--- /dev/null
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -0,0 +1,25 @@
+config TERRAFORM_OCI_SHAPE
+	string "OCI shape name"
+	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.
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string "OCI OS image OCID"
+	help
+	  The OCI ID of the OS image to use.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 06/31] terraform/OCI: Add a "Storage" Kconfig submenu
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (4 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 05/31] terraform/OCI: Add a "Compute" Kconfig submenu cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 07/31] terraform/OCI: Add a "Networking" " cel
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/Kconfig                         | 188 +-----------------
 .../oci/{Kconfig => kconfigs/Kconfig.storage} |  29 ---
 2 files changed, 3 insertions(+), 214 deletions(-)
 copy terraform/oci/{Kconfig => kconfigs/Kconfig.storage} (86%)

diff --git a/terraform/oci/Kconfig b/terraform/oci/Kconfig
index 897501a5aebb..c0b820f2cc43 100644
--- a/terraform/oci/Kconfig
+++ b/terraform/oci/Kconfig
@@ -6,6 +6,9 @@ endmenu
 menu "Compute"
 source "terraform/oci/kconfigs/Kconfig.compute"
 endmenu
+menu "Storage"
+source "terraform/oci/kconfigs/Kconfig.storage"
+endmenu
 menu "Identity & Access"
 source "terraform/oci/kconfigs/Kconfig.identity"
 endmenu
@@ -25,189 +28,4 @@ config TERRAFORM_OCI_SUBNET_OCID
 	  Read this:
 	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
 
-config TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-	bool "Enable additional block devices"
-	default n
-	help
-	  Enable this to provision up to 10 extra block devices
-	  on each target node.
-
-if TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-choice
-	prompt "Count of extra block volumes"
-	default TERRAFORM_OCI_VOLUMES_PER_INSTANCE_4
-	help
-	  The count of extra block devices attached to each target
-	  node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_2
-	bool "2"
-	help
-	  Provision 2 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_3
-	bool "3"
-	help
-	  Provision 3 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_4
-	bool "4"
-	help
-	  Provision 4 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_5
-	bool "5"
-	help
-	  Provision 5 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_6
-	bool "6"
-	help
-	  Provision 6 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_7
-	bool "7"
-	help
-	  Provision 7 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_8
-	bool "8"
-	help
-	  Provision 8 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_9
-	bool "9"
-	help
-	  Provision 9 extra volumes per target node.
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_10
-	bool "10"
-	help
-	  Provision 10 extra volumes per target node.
-
-endchoice
-
-config TERRAFORM_OCI_VOLUMES_PER_INSTANCE
-	int
-	output yaml
-	default 2 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_2
-	default 3 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_3
-	default 4 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_4
-	default 5 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_5
-	default 6 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_6
-	default 7 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_7
-	default 8 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_8
-	default 9 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_9
-	default 10 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_10
-
-choice
-	prompt "Volume size for each additional volume"
-	default TERRAFORM_OCI_VOLUMES_SIZE_50G
-	help
-	  OCI implements volume sizes between 50G and 32T. In some
-	  cases, 50G volumes are in the free tier.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_50G
-	bool "50G"
-	help
-	  Extra block volumes are 50 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_64G
-	bool "64G"
-	help
-	  Extra block volumes are 64 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_128G
-	bool "128G"
-	help
-	  Extra block volumes are 128 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_256G
-	bool "256G"
-	help
-	  Extra block volumes are 256 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_512G
-	bool "512G"
-	help
-	  Extra block volumes are 512 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_1024G
-	bool "1024G"
-	help
-	  Extra block volumes are 1024 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_2048G
-	bool "2048G"
-	help
-	  Extra block volumes are 2048 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_4096G
-	bool "4096G"
-	help
-	  Extra block volumes are 4096 GiB in size.
-
-config TERRAFORM_OCI_VOLUMES_SIZE_8192G
-	bool "8192G"
-	help
-	  Extra block volumes are 8192 GiB in size.
-
-endchoice
-
-config TERRAFORM_OCI_VOLUMES_SIZE
-	int
-	output yaml
-	default 50 if TERRAFORM_OCI_VOLUMES_SIZE_50G
-	default 64 if TERRAFORM_OCI_VOLUMES_SIZE_64G
-	default 128 if TERRAFORM_OCI_VOLUMES_SIZE_128G
-	default 256 if TERRAFORM_OCI_VOLUMES_SIZE_256G
-	default 512 if TERRAFORM_OCI_VOLUMES_SIZE_512G
-	default 1024 if TERRAFORM_OCI_VOLUMES_SIZE_1024G
-	default 2048 if TERRAFORM_OCI_VOLUMES_SIZE_2048G
-	default 4096 if TERRAFORM_OCI_VOLUMES_SIZE_4096G
-	default 8192 if TERRAFORM_OCI_VOLUMES_SIZE_8192G
-
-endif # TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-if !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-config TERRAFORM_OCI_DATA_VOLUME_DISPLAY_NAME
-	string "Display name to use for the data volume"
-	default "data"
-	help
-	  Human readable data volume instance name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-endif # !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-config TERRAFORM_OCI_DATA_VOLUME_DEVICE_FILE_NAME
-	string "Data volume's device file name"
-	default "/dev/oracleoci/oraclevdb"
-	help
-	  Data volume's device file name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-if !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-config TERRAFORM_OCI_SPARSE_VOLUME_DISPLAY_NAME
-	string "Display name to use for the sparse volume"
-	default "sparse"
-	help
-	  Human readable sparse volume instance name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-endif # !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-config TERRAFORM_OCI_SPARSE_VOLUME_DEVICE_FILE_NAME
-	string "Sparse volume's device file name"
-	default "/dev/oracleoci/oraclevdc"
-	help
-	  Sparse volume's device file name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
 endif # TERRAFORM_OCI
diff --git a/terraform/oci/Kconfig b/terraform/oci/kconfigs/Kconfig.storage
similarity index 86%
copy from terraform/oci/Kconfig
copy to terraform/oci/kconfigs/Kconfig.storage
index 897501a5aebb..8b2885a07d63 100644
--- a/terraform/oci/Kconfig
+++ b/terraform/oci/kconfigs/Kconfig.storage
@@ -1,30 +1,3 @@
-if TERRAFORM_OCI
-
-menu "Resource location"
-source "terraform/oci/kconfigs/Kconfig.location"
-endmenu
-menu "Compute"
-source "terraform/oci/kconfigs/Kconfig.compute"
-endmenu
-menu "Identity & Access"
-source "terraform/oci/kconfigs/Kconfig.identity"
-endmenu
-
-config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
-	bool "Assign public IP address to the cloud instance"
-	default y
-	help
-          Select this field if public IP address has to be assigned to
-          the cloud instance. Otherwise a public IP address is
-          assigned.
-
-config TERRAFORM_OCI_SUBNET_OCID
-	string "OCI Subnet OCID"
-	help
-	  The OCI ID of the subnet.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
 config TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
 	bool "Enable additional block devices"
 	default n
@@ -209,5 +182,3 @@ config TERRAFORM_OCI_SPARSE_VOLUME_DEVICE_FILE_NAME
 	  Sparse volume's device file name
 	  Read this:
 	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-endif # TERRAFORM_OCI
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 07/31] terraform/OCI: Add a "Networking" Kconfig submenu
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (5 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 06/31] terraform/OCI: Add a "Storage" " cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 08/31] terraform/OCI: Use "output yaml" for the tenancy OCID cel
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/Kconfig                  | 18 +++---------------
 terraform/oci/kconfigs/Kconfig.network | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)
 create mode 100644 terraform/oci/kconfigs/Kconfig.network

diff --git a/terraform/oci/Kconfig b/terraform/oci/Kconfig
index c0b820f2cc43..566442868a8b 100644
--- a/terraform/oci/Kconfig
+++ b/terraform/oci/Kconfig
@@ -9,23 +9,11 @@ endmenu
 menu "Storage"
 source "terraform/oci/kconfigs/Kconfig.storage"
 endmenu
+menu "Network"
+source "terraform/oci/kconfigs/Kconfig.network"
+endmenu
 menu "Identity & Access"
 source "terraform/oci/kconfigs/Kconfig.identity"
 endmenu
 
-config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
-	bool "Assign public IP address to the cloud instance"
-	default y
-	help
-          Select this field if public IP address has to be assigned to
-          the cloud instance. Otherwise a public IP address is
-          assigned.
-
-config TERRAFORM_OCI_SUBNET_OCID
-	string "OCI Subnet OCID"
-	help
-	  The OCI ID of the subnet.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
 endif # TERRAFORM_OCI
diff --git a/terraform/oci/kconfigs/Kconfig.network b/terraform/oci/kconfigs/Kconfig.network
new file mode 100644
index 000000000000..ab1914c6f6a6
--- /dev/null
+++ b/terraform/oci/kconfigs/Kconfig.network
@@ -0,0 +1,14 @@
+config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
+	bool "Assign public IP address to the cloud instance"
+	default y
+	help
+	  Select this field if public IP address has to be assigned to
+	  the cloud instance. Otherwise a public IP address is
+	  assigned.
+
+config TERRAFORM_OCI_SUBNET_OCID
+	string "OCI Subnet OCID"
+	help
+	  The OCI ID of the subnet.
+	  Read this:
+	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 08/31] terraform/OCI: Use "output yaml" for the tenancy OCID
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (6 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 07/31] terraform/OCI: Add a "Networking" " cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 09/31] terraform/OCI: Use "output yaml" for the user OCID cel
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor: Remove the line in terraform.Makefile that sets
"terraform_oci_tenancy_ocid", and just pass it directly from
Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile              |  1 -
 terraform/oci/kconfigs/Kconfig.identity | 10 ++++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 3235c1af84b9..1589585cd2bd 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -96,7 +96,6 @@ endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
 TERRAFORM_EXTRA_VARS += terraform_oci_region=$(subst ",,$(CONFIG_TERRAFORM_OCI_REGION))
-TERRAFORM_EXTRA_VARS += terraform_oci_tenancy_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_TENANCY_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_user_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_user_private_key_path=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_PRIVATE_KEY_PATH))
 TERRAFORM_EXTRA_VARS += terraform_oci_user_fingerprint=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_FINGERPRINT))
diff --git a/terraform/oci/kconfigs/Kconfig.identity b/terraform/oci/kconfigs/Kconfig.identity
index 928c700d9bd4..3061c12f6de0 100644
--- a/terraform/oci/kconfigs/Kconfig.identity
+++ b/terraform/oci/kconfigs/Kconfig.identity
@@ -1,9 +1,11 @@
 config TERRAFORM_OCI_TENANCY_OCID
-	string "OCI tenant OCID"
+	string "OCI tenancy OCID"
+	output yaml
 	help
-	  The OCI ID of the tenancy to use.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  The OCID of the tenancy in which to create kdevops
+	  resources. See:
+
+	  https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five
 
 config TERRAFORM_OCI_USER_OCID
 	string "OCI user OCID"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 09/31] terraform/OCI: Use "output yaml" for the user OCID
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (7 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 08/31] terraform/OCI: Use "output yaml" for the tenancy OCID cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 10/31] terraform/OCI: Use "output yaml" for the signing key cel
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor: Remove the line in terraform.Makefile that sets
"terraform_oci_user_ocid", and just pass it directly from
Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile              | 1 -
 terraform/oci/kconfigs/Kconfig.identity | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 1589585cd2bd..aced091fa08c 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -96,7 +96,6 @@ endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
 TERRAFORM_EXTRA_VARS += terraform_oci_region=$(subst ",,$(CONFIG_TERRAFORM_OCI_REGION))
-TERRAFORM_EXTRA_VARS += terraform_oci_user_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_user_private_key_path=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_PRIVATE_KEY_PATH))
 TERRAFORM_EXTRA_VARS += terraform_oci_user_fingerprint=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_FINGERPRINT))
 TERRAFORM_EXTRA_VARS += terraform_oci_availablity_domain=$(subst ",,$(CONFIG_TERRAFORM_OCI_AVAILABLITY_DOMAIN))
diff --git a/terraform/oci/kconfigs/Kconfig.identity b/terraform/oci/kconfigs/Kconfig.identity
index 3061c12f6de0..392ac584a567 100644
--- a/terraform/oci/kconfigs/Kconfig.identity
+++ b/terraform/oci/kconfigs/Kconfig.identity
@@ -9,10 +9,12 @@ config TERRAFORM_OCI_TENANCY_OCID
 
 config TERRAFORM_OCI_USER_OCID
 	string "OCI user OCID"
+	output yaml
 	help
-	  The OCI ID of the user to use.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  The OCID of the cloud user that kdevops should authenticate as.
+	  See:
+
+	  https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five
 
 config TERRAFORM_OCI_USER_PRIVATE_KEY_PATH
 	string "OCI user private key path"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 10/31] terraform/OCI: Use "output yaml" for the signing key
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (8 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 09/31] terraform/OCI: Use "output yaml" for the user OCID cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 11/31] terraform/OCI: Use "output yaml" for the fingerprint cel
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_user_private_key_path" and just pass it directly
from Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile              |  1 -
 terraform/oci/kconfigs/Kconfig.identity | 11 +++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index aced091fa08c..b631b4c09a0e 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -96,7 +96,6 @@ endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
 TERRAFORM_EXTRA_VARS += terraform_oci_region=$(subst ",,$(CONFIG_TERRAFORM_OCI_REGION))
-TERRAFORM_EXTRA_VARS += terraform_oci_user_private_key_path=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_PRIVATE_KEY_PATH))
 TERRAFORM_EXTRA_VARS += terraform_oci_user_fingerprint=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_FINGERPRINT))
 TERRAFORM_EXTRA_VARS += terraform_oci_availablity_domain=$(subst ",,$(CONFIG_TERRAFORM_OCI_AVAILABLITY_DOMAIN))
 TERRAFORM_EXTRA_VARS += terraform_oci_compartment_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_COMPARTMENT_OCID))
diff --git a/terraform/oci/kconfigs/Kconfig.identity b/terraform/oci/kconfigs/Kconfig.identity
index 392ac584a567..87f5457995f5 100644
--- a/terraform/oci/kconfigs/Kconfig.identity
+++ b/terraform/oci/kconfigs/Kconfig.identity
@@ -17,11 +17,14 @@ config TERRAFORM_OCI_USER_OCID
 	  https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five
 
 config TERRAFORM_OCI_USER_PRIVATE_KEY_PATH
-	string "OCI user private key path"
+	string "Pathname to private key file"
+	output yaml
 	help
-	  Path to the file containing the private key of the user.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  Pathname to the local file containing the signing key of
+	  the user. You can upload an pre-existing key, or generate
+	  one on the OCI cloud console and download it. See:
+
+	  https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two
 
 config TERRAFORM_OCI_USER_FINGERPRINT
 	string "OCI user fingerprint"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 11/31] terraform/OCI: Use "output yaml" for the fingerprint
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (9 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 10/31] terraform/OCI: Use "output yaml" for the signing key cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 12/31] terraform/OCI: Add a Region selector cel
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_user_fingerprint" and just pass it directly
from Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile              | 1 -
 terraform/oci/kconfigs/Kconfig.identity | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index b631b4c09a0e..75ba9b97b518 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -96,7 +96,6 @@ endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
 TERRAFORM_EXTRA_VARS += terraform_oci_region=$(subst ",,$(CONFIG_TERRAFORM_OCI_REGION))
-TERRAFORM_EXTRA_VARS += terraform_oci_user_fingerprint=$(subst ",,$(CONFIG_TERRAFORM_OCI_USER_FINGERPRINT))
 TERRAFORM_EXTRA_VARS += terraform_oci_availablity_domain=$(subst ",,$(CONFIG_TERRAFORM_OCI_AVAILABLITY_DOMAIN))
 TERRAFORM_EXTRA_VARS += terraform_oci_compartment_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_COMPARTMENT_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_shape=$(subst ",,$(CONFIG_TERRAFORM_OCI_SHAPE))
diff --git a/terraform/oci/kconfigs/Kconfig.identity b/terraform/oci/kconfigs/Kconfig.identity
index 87f5457995f5..310cf19b7ca1 100644
--- a/terraform/oci/kconfigs/Kconfig.identity
+++ b/terraform/oci/kconfigs/Kconfig.identity
@@ -27,8 +27,9 @@ config TERRAFORM_OCI_USER_PRIVATE_KEY_PATH
 	  https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two
 
 config TERRAFORM_OCI_USER_FINGERPRINT
-	string "OCI user fingerprint"
+	string "Signing key fingerprint"
+	output yaml
 	help
-	  Fingerprint for the key pair being used.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  Fingerprint for the signing key pair. See:
+
+	  https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#four
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 12/31] terraform/OCI: Add a Region selector
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (10 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 11/31] terraform/OCI: Use "output yaml" for the fingerprint cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 13/31] terraform/OCI: Add an availability domain selector cel
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Replace the free-form string region setting with a selector that
chooses among already-validated settings. Some popular regions in
the "commercial" realm are added. It should be easy to add more.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile              |  1 -
 terraform/oci/kconfigs/Kconfig.location | 53 ++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 75ba9b97b518..ea5309d5da2e 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_region=$(subst ",,$(CONFIG_TERRAFORM_OCI_REGION))
 TERRAFORM_EXTRA_VARS += terraform_oci_availablity_domain=$(subst ",,$(CONFIG_TERRAFORM_OCI_AVAILABLITY_DOMAIN))
 TERRAFORM_EXTRA_VARS += terraform_oci_compartment_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_COMPARTMENT_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_shape=$(subst ",,$(CONFIG_TERRAFORM_OCI_SHAPE))
diff --git a/terraform/oci/kconfigs/Kconfig.location b/terraform/oci/kconfigs/Kconfig.location
index 9e06aa9332f8..9ef81cedd235 100644
--- a/terraform/oci/kconfigs/Kconfig.location
+++ b/terraform/oci/kconfigs/Kconfig.location
@@ -1,9 +1,52 @@
-config TERRAFORM_OCI_REGION
-	string "OCI Region"
+choice
+	prompt "OCI Region"
+	default TERRAFORM_OCI_REGION_ORD
 	help
-	  This option will set the OCI resource location.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  A region is a collection of geographically co-located data
+	  centers that share data and hardware resources. Using this
+	  menu, select the region in which you wish to deploy your
+	  kdevops resources. Your tenancy must be subscribed to the
+	  selected region. For more information:
+
+	  https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
+
+config TERRAFORM_OCI_REGION_HYD
+	bool "India South (Hyderabad)"
+
+config TERRAFORM_OCI_REGION_BOM
+	bool "India West (Mumbai)"
+
+config TERRAFORM_OCI_REGION_YUL
+	bool "Canada Southeast (Montreal)"
+
+config TERRAFORM_OCI_REGION_YYZ
+	bool "Canada Southeast (Toronto)"
+
+config TERRAFORM_OCI_REGION_IAD
+	bool "US East (Ashburn)"
+
+config TERRAFORM_OCI_REGION_ORD
+	bool "US Midwest (Chicago)"
+
+config TERRAFORM_OCI_REGION_PHX
+	bool "US West (Phoenix)"
+
+config TERRAFORM_OCI_REGION_SJC
+	bool "US West (San Jose)"
+
+endchoice
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "ap-hyderabad-1" if TERRAFORM_OCI_REGION_HYD
+	default "ap-mumbai-1" if TERRAFORM_OCI_REGION_BOM
+	default "ca-montreal-1" if TERRAFORM_OCI_REGION_YUL
+	default "ca-toronto-1" if TERRAFORM_OCI_REGION_YYZ
+	default "us-ashburn-1" if TERRAFORM_OCI_REGION_IAD
+	default "us-chicago-1" if TERRAFORM_OCI_REGION_ORD
+	default "us-phoenix-1" if TERRAFORM_OCI_REGION_PHX
+	default "us-sanjose-1" if TERRAFORM_OCI_REGION_SJC
 
 config TERRAFORM_OCI_AVAILABLITY_DOMAIN
 	string "OCI availablity domain"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 13/31] terraform/OCI: Add an availability domain selector
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (11 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 12/31] terraform/OCI: Add a Region selector cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 14/31] terraform/OCI: Select your compartment by name instead of by OCID cel
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

In order to balance load, OCI adds a prefix to availability
domain names. This prefix is fixed but unique for each user.

The user has to look up the prefixed name (at least once) before
specifying an availability domain name for terraform, which is
not user-friendly.

Fortunately, terraform provides a data source to look up the
user's unique prefix and form the correct full domain name for
terraform. So the Kconfig selector only needs to pick an integer
from 1 to 3, and that hides a needless detail from our user.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 .../templates/oci/terraform.tfvars.j2         |  2 +-
 scripts/terraform.Makefile                    |  1 -
 terraform/oci/kconfigs/Kconfig.location       | 26 +++++---------
 .../kconfigs/regions/Kconfig.ap-hyderabad-1   | 28 +++++++++++++++
 .../oci/kconfigs/regions/Kconfig.ap-mumbai-1  | 27 ++++++++++++++
 .../kconfigs/regions/Kconfig.ca-montreal-1    | 28 +++++++++++++++
 .../oci/kconfigs/regions/Kconfig.ca-toronto-1 | 28 +++++++++++++++
 .../oci/kconfigs/regions/Kconfig.us-ashburn-1 | 36 +++++++++++++++++++
 .../oci/kconfigs/regions/Kconfig.us-chicago-1 | 36 +++++++++++++++++++
 .../oci/kconfigs/regions/Kconfig.us-phoenix-1 | 36 +++++++++++++++++++
 .../oci/kconfigs/regions/Kconfig.us-sanjose-1 | 28 +++++++++++++++
 terraform/oci/main.tf                         | 15 ++++----
 terraform/oci/vars.tf                         | 10 +++---
 13 files changed, 270 insertions(+), 31 deletions(-)
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ap-hyderabad-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ap-mumbai-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ca-montreal-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.ca-toronto-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-ashburn-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-chicago-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1
 create mode 100644 terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1

diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index f7b9ffb48c64..864d5d5a89f0 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -3,7 +3,7 @@ oci_tenancy_ocid = "{{ terraform_oci_tenancy_ocid }}"
 oci_user_ocid = "{{ terraform_oci_user_ocid }}"
 oci_user_private_key_path = "{{ terraform_oci_user_private_key_path }}"
 oci_user_fingerprint = "{{ terraform_oci_user_fingerprint }}"
-oci_availablity_domain = "{{ terraform_oci_availablity_domain }}"
+oci_ad_number = {{ terraform_oci_ad_number }}
 oci_compartment_ocid = "{{ terraform_oci_compartment_ocid }}"
 oci_shape = "{{ terraform_oci_shape }}"
 oci_instance_flex_ocpus = {{ terraform_oci_instance_flex_ocpus }}
diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index ea5309d5da2e..0aca0b508086 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_availablity_domain=$(subst ",,$(CONFIG_TERRAFORM_OCI_AVAILABLITY_DOMAIN))
 TERRAFORM_EXTRA_VARS += terraform_oci_compartment_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_COMPARTMENT_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_shape=$(subst ",,$(CONFIG_TERRAFORM_OCI_SHAPE))
 TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_ocpus=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_OCPUS))
diff --git a/terraform/oci/kconfigs/Kconfig.location b/terraform/oci/kconfigs/Kconfig.location
index 9ef81cedd235..7bf5ae49ba03 100644
--- a/terraform/oci/kconfigs/Kconfig.location
+++ b/terraform/oci/kconfigs/Kconfig.location
@@ -36,24 +36,14 @@ config TERRAFORM_OCI_REGION_SJC
 
 endchoice
 
-config TERRAFORM_OCI_REGION
-	string
-	output yaml
-	default "ap-hyderabad-1" if TERRAFORM_OCI_REGION_HYD
-	default "ap-mumbai-1" if TERRAFORM_OCI_REGION_BOM
-	default "ca-montreal-1" if TERRAFORM_OCI_REGION_YUL
-	default "ca-toronto-1" if TERRAFORM_OCI_REGION_YYZ
-	default "us-ashburn-1" if TERRAFORM_OCI_REGION_IAD
-	default "us-chicago-1" if TERRAFORM_OCI_REGION_ORD
-	default "us-phoenix-1" if TERRAFORM_OCI_REGION_PHX
-	default "us-sanjose-1" if TERRAFORM_OCI_REGION_SJC
-
-config TERRAFORM_OCI_AVAILABLITY_DOMAIN
-	string "OCI availablity domain"
-	help
-	  The name of the availability domain.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+source "terraform/oci/kconfigs/regions/Kconfig.ap-hyderabad-1"
+source "terraform/oci/kconfigs/regions/Kconfig.ap-mumbai-1"
+source "terraform/oci/kconfigs/regions/Kconfig.ca-montreal-1"
+source "terraform/oci/kconfigs/regions/Kconfig.ca-toronto-1"
+source "terraform/oci/kconfigs/regions/Kconfig.us-ashburn-1"
+source "terraform/oci/kconfigs/regions/Kconfig.us-chicago-1"
+source "terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1"
+source "terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1"
 
 config TERRAFORM_OCI_COMPARTMENT_OCID
 	string "OCI compartment OCID"
diff --git a/terraform/oci/kconfigs/regions/Kconfig.ap-hyderabad-1 b/terraform/oci/kconfigs/regions/Kconfig.ap-hyderabad-1
new file mode 100644
index 000000000000..f4ac37ef38da
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.ap-hyderabad-1
@@ -0,0 +1,28 @@
+if TERRAFORM_OCI_REGION_HYD
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "ap-hyderabad-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_HYD_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_HYD_AD1
+	bool "1"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_HYD_1_AD1
+
+endif # TERRAFORM_OCI_REGION_HYD_1
diff --git a/terraform/oci/kconfigs/regions/Kconfig.ap-mumbai-1 b/terraform/oci/kconfigs/regions/Kconfig.ap-mumbai-1
new file mode 100644
index 000000000000..f05b595c3993
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.ap-mumbai-1
@@ -0,0 +1,27 @@
+if TERRAFORM_OCI_REGION_BOM
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "ap-mumbai-1"
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_BOM_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_BOM_AD1
+	bool "1"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_BOM_AD1
+
+endif # TERRAFORM_OCI_REGION_BOM
diff --git a/terraform/oci/kconfigs/regions/Kconfig.ca-montreal-1 b/terraform/oci/kconfigs/regions/Kconfig.ca-montreal-1
new file mode 100644
index 000000000000..ce71f531e488
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.ca-montreal-1
@@ -0,0 +1,28 @@
+if TERRAFORM_OCI_REGION_YUL
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "ca-montreal-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_YUL_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_YUL_AD1
+	bool "1"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_YUL_AD1
+
+endif # TERRAFORM_OCI_REGION_YUL
diff --git a/terraform/oci/kconfigs/regions/Kconfig.ca-toronto-1 b/terraform/oci/kconfigs/regions/Kconfig.ca-toronto-1
new file mode 100644
index 000000000000..16053e94e983
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.ca-toronto-1
@@ -0,0 +1,28 @@
+if TERRAFORM_OCI_REGION_YYZ
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "ca-toronto-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_YYZ_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_YYZ_AD1
+	bool "1"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_YYZ_AD1
+
+endif # TERRAFORM_OCI_REGION_YYZ
diff --git a/terraform/oci/kconfigs/regions/Kconfig.us-ashburn-1 b/terraform/oci/kconfigs/regions/Kconfig.us-ashburn-1
new file mode 100644
index 000000000000..9aa4d2714452
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.us-ashburn-1
@@ -0,0 +1,36 @@
+if TERRAFORM_OCI_REGION_IAD
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "us-ashburn-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_IAD_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_IAD_AD1
+	bool "1"
+
+config TERRAFORM_OCI_REGION_IAD_AD2
+	bool "2"
+
+config TERRAFORM_OCI_REGION_IAD_AD3
+	bool "3"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_IAD_AD1
+	default 2 if TERRAFORM_OCI_REGION_IAD_AD2
+	default 3 if TERRAFORM_OCI_REGION_IAD_AD3
+
+endif # TERRAFORM_OCI_REGION_IAD
diff --git a/terraform/oci/kconfigs/regions/Kconfig.us-chicago-1 b/terraform/oci/kconfigs/regions/Kconfig.us-chicago-1
new file mode 100644
index 000000000000..19c3b50c2772
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.us-chicago-1
@@ -0,0 +1,36 @@
+if TERRAFORM_OCI_REGION_ORD
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "us-chicago-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_ORD_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_ORD_AD1
+	bool "1"
+
+config TERRAFORM_OCI_REGION_ORD_AD2
+	bool "2"
+
+config TERRAFORM_OCI_REGION_ORD_AD3
+	bool "3"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_ORD_AD1
+	default 2 if TERRAFORM_OCI_REGION_ORD_AD2
+	default 3 if TERRAFORM_OCI_REGION_ORD_AD3
+
+endif # TERRAFORM_OCI_REGION_ORD
diff --git a/terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1 b/terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1
new file mode 100644
index 000000000000..eb8021191ba3
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1
@@ -0,0 +1,36 @@
+if TERRAFORM_OCI_REGION_PHX
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "us-phoenix-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_PHX_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_PHX_AD1
+	bool "1"
+
+config TERRAFORM_OCI_REGION_PHX_AD2
+	bool "2"
+
+config TERRAFORM_OCI_REGION_PHX_AD3
+	bool "3"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_PHX_AD1
+	default 2 if TERRAFORM_OCI_REGION_PHX_AD2
+	default 3 if TERRAFORM_OCI_REGION_PHX_AD3
+
+endif # TERRAFORM_OCI_REGION_PHX
diff --git a/terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1 b/terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1
new file mode 100644
index 000000000000..69b4035f2b9b
--- /dev/null
+++ b/terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1
@@ -0,0 +1,28 @@
+if TERRAFORM_OCI_REGION_SJC
+
+config TERRAFORM_OCI_REGION
+	string
+	output yaml
+	default "us-sanjose-1"
+
+choice
+	prompt "Availability Domain"
+	default TERRAFORM_OCI_REGION_SJC_AD1
+	help
+	  The number of the Availability Domain. This number
+	  corresponds to the integer at the end of the Availability
+	  Domain name.
+
+	  The OCI Fault Domain is chosen automatically.
+
+config TERRAFORM_OCI_REGION_SJC_AD1
+	bool "1"
+
+endchoice
+
+config TERRAFORM_OCI_AD_NUMBER
+	int
+	output yaml
+	default 1 if TERRAFORM_OCI_REGION_SJC_AD1
+
+endif # TERRAFORM_OCI_REGION_SJC
diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index c96e050b36e2..5520fdbed517 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -1,7 +1,12 @@
+data "oci_identity_availability_domain" "kdevops_av_domain" {
+  ad_number      = var.oci_ad_number
+  compartment_id = var.oci_tenancy_ocid
+}
+
 resource "oci_core_instance" "kdevops_instance" {
   count = local.kdevops_num_boxes
 
-  availability_domain = var.oci_availablity_domain
+  availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
   compartment_id = var.oci_compartment_ocid
   shape = var.oci_shape
   shape_config {
@@ -30,9 +35,8 @@ resource "oci_core_instance" "kdevops_instance" {
 resource "oci_core_volume" "kdevops_data_disk" {
   count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
 
+  availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
   compartment_id = var.oci_compartment_ocid
-
-  availability_domain = var.oci_availablity_domain
   display_name = var.oci_data_volume_display_name
   size_in_gbs = 50
 }
@@ -40,9 +44,8 @@ resource "oci_core_volume" "kdevops_data_disk" {
 resource "oci_core_volume" "kdevops_sparse_disk" {
   count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
 
+  availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
   compartment_id = var.oci_compartment_ocid
-
-  availability_domain = var.oci_availablity_domain
   display_name = var.oci_sparse_volume_display_name
   size_in_gbs = 120
 }
@@ -71,7 +74,7 @@ module "volumes" {
   count  = var.oci_volumes_enable_extra == "true" ? local.kdevops_num_boxes : 0
   source = "./volumes"
 
-  vol_availability_domain = var.oci_availablity_domain
+  vol_availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
   vol_compartment_ocid    = var.oci_compartment_ocid
   vol_instance_id         = element(oci_core_instance.kdevops_instance.*.id, count.index)
   vol_instance_name       = element(var.kdevops_nodes, count.index)
diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index 4c6383d9b231..05c3f3769e94 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -1,3 +1,8 @@
+variable "oci_ad_number" {
+  description = "Suffix number of availability domain"
+  type        = number
+}
+
 variable "oci_region" {
   description = "An OCI region"
   type        = string
@@ -23,11 +28,6 @@ variable "oci_user_fingerprint" {
   type        = string
 }
 
-variable "oci_availablity_domain" {
-  description = "Name of availability domain"
-  type        = string
-}
-
 variable "oci_compartment_ocid" {
   description = "OCID of compartment"
   type        = string
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 14/31] terraform/OCI: Select your compartment by name instead of by OCID
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (12 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 13/31] terraform/OCI: Add an availability domain selector cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 15/31] terraform/OCI: Use "output yaml" for the instance shape setting cel
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Terraform provides a data source that can map a human-readable
compartment name to an OCID. This avoids the need to copy and paste
the compartment OCID blob from the OCI cloud console. Just use the
human-readable compartment name.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 .../templates/oci/terraform.tfvars.j2          |  2 +-
 scripts/terraform.Makefile                     |  1 -
 terraform/oci/kconfigs/Kconfig.location        |  9 ++++-----
 terraform/oci/main.tf                          | 18 +++++++++++++-----
 terraform/oci/vars.tf                          | 10 +++++-----
 5 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index 864d5d5a89f0..be0c154802ff 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -4,7 +4,7 @@ oci_user_ocid = "{{ terraform_oci_user_ocid }}"
 oci_user_private_key_path = "{{ terraform_oci_user_private_key_path }}"
 oci_user_fingerprint = "{{ terraform_oci_user_fingerprint }}"
 oci_ad_number = {{ terraform_oci_ad_number }}
-oci_compartment_ocid = "{{ terraform_oci_compartment_ocid }}"
+oci_compartment_name = "{{ terraform_oci_compartment_name }}"
 oci_shape = "{{ terraform_oci_shape }}"
 oci_instance_flex_ocpus = {{ terraform_oci_instance_flex_ocpus }}
 oci_instance_flex_memory_in_gbs = {{ terraform_oci_instance_flex_memory_in_gbs }}
diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 0aca0b508086..02db2569ee08 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_compartment_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_COMPARTMENT_OCID))
 TERRAFORM_EXTRA_VARS += terraform_oci_shape=$(subst ",,$(CONFIG_TERRAFORM_OCI_SHAPE))
 TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_ocpus=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_OCPUS))
 TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_memory_in_gbs=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS))
diff --git a/terraform/oci/kconfigs/Kconfig.location b/terraform/oci/kconfigs/Kconfig.location
index 7bf5ae49ba03..eff58202f8c7 100644
--- a/terraform/oci/kconfigs/Kconfig.location
+++ b/terraform/oci/kconfigs/Kconfig.location
@@ -45,9 +45,8 @@ source "terraform/oci/kconfigs/regions/Kconfig.us-chicago-1"
 source "terraform/oci/kconfigs/regions/Kconfig.us-phoenix-1"
 source "terraform/oci/kconfigs/regions/Kconfig.us-sanjose-1"
 
-config TERRAFORM_OCI_COMPARTMENT_OCID
-	string "OCI compartment OCID"
+config TERRAFORM_OCI_COMPARTMENT_NAME
+	string "OCI compartment name"
+	output yaml
 	help
-	  The OCI ID of user's compartment.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  The compartment name where your instances are to be created.
diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index 5520fdbed517..6991644d83b8 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -1,3 +1,11 @@
+data "oci_identity_compartments" "kdevops_compartment" {
+  access_level              = "ANY"
+  compartment_id            = var.oci_tenancy_ocid
+  compartment_id_in_subtree = true
+  name                      = var.oci_compartment_name
+  state                     = "ACTIVE"
+}
+
 data "oci_identity_availability_domain" "kdevops_av_domain" {
   ad_number      = var.oci_ad_number
   compartment_id = var.oci_tenancy_ocid
@@ -7,8 +15,8 @@ resource "oci_core_instance" "kdevops_instance" {
   count = local.kdevops_num_boxes
 
   availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
-  compartment_id = var.oci_compartment_ocid
-  shape = var.oci_shape
+  compartment_id      = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  shape               = var.oci_shape
   shape_config {
     memory_in_gbs = var.oci_instance_flex_memory_in_gbs
     ocpus = var.oci_instance_flex_ocpus
@@ -36,7 +44,7 @@ resource "oci_core_volume" "kdevops_data_disk" {
   count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
 
   availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
-  compartment_id = var.oci_compartment_ocid
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   display_name = var.oci_data_volume_display_name
   size_in_gbs = 50
 }
@@ -45,7 +53,7 @@ resource "oci_core_volume" "kdevops_sparse_disk" {
   count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
 
   availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
-  compartment_id = var.oci_compartment_ocid
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   display_name = var.oci_sparse_volume_display_name
   size_in_gbs = 120
 }
@@ -75,7 +83,7 @@ module "volumes" {
   source = "./volumes"
 
   vol_availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
-  vol_compartment_ocid    = var.oci_compartment_ocid
+  vol_compartment_ocid    = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   vol_instance_id         = element(oci_core_instance.kdevops_instance.*.id, count.index)
   vol_instance_name       = element(var.kdevops_nodes, count.index)
   vol_volume_count        = var.oci_volumes_per_instance
diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index 05c3f3769e94..f760fbb776fa 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -3,6 +3,11 @@ variable "oci_ad_number" {
   type        = number
 }
 
+variable "oci_compartment_name" {
+  description = "Name of compartment in which to create resources"
+  type        = string
+}
+
 variable "oci_region" {
   description = "An OCI region"
   type        = string
@@ -28,11 +33,6 @@ variable "oci_user_fingerprint" {
   type        = string
 }
 
-variable "oci_compartment_ocid" {
-  description = "OCID of compartment"
-  type        = string
-}
-
 variable "oci_shape" {
   description = "Shape name"
   type        = string
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 15/31] terraform/OCI: Use "output yaml" for the instance shape setting
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (13 preceding siblings ...)
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 16/31] terraform/OCI: Add a shape selector for Flex shapes cel
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_shape" and just pass it directly from Kconfig via an
"output yaml" directive.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile             | 1 -
 terraform/oci/kconfigs/Kconfig.compute | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 02db2569ee08..a1f510a33536 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_shape=$(subst ",,$(CONFIG_TERRAFORM_OCI_SHAPE))
 TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_ocpus=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_OCPUS))
 TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_memory_in_gbs=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS))
 TERRAFORM_EXTRA_VARS += terraform_oci_os_image_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_OS_IMAGE_OCID))
diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
index b794ef2d5190..c9e125dcf37a 100644
--- a/terraform/oci/kconfigs/Kconfig.compute
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -1,5 +1,6 @@
 config TERRAFORM_OCI_SHAPE
 	string "OCI shape name"
+	output yaml
 	help
 	  The name of the shape
 	  Read this:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 16/31] terraform/OCI: Add a shape selector for Flex shapes
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (14 preceding siblings ...)
  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
  2025-04-01  0:59 ` [RFC PATCH 17/31] terraform/OCI: Use "output yaml" for the OCPUs setting cel
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 17/31] terraform/OCI: Use "output yaml" for the OCPUs setting
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (15 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 16/31] terraform/OCI: Add a shape selector for Flex shapes cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 18/31] terraform/OCI: Use "output yaml" for the memory_in_gbs setting cel
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_instance_flex_ocpus" and just pass it directly from
Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile                 |  1 -
 terraform/oci/kconfigs/shapes/Kconfig.flex | 16 ++++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index a1f510a33536..8e4973930125 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_ocpus=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_OCPUS))
 TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_memory_in_gbs=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS))
 TERRAFORM_EXTRA_VARS += terraform_oci_os_image_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_OS_IMAGE_OCID))
 ifeq (y, $(CONFIG_TERRAFORM_OCI_ASSIGN_PUBLIC_IP))
diff --git a/terraform/oci/kconfigs/shapes/Kconfig.flex b/terraform/oci/kconfigs/shapes/Kconfig.flex
index 80ebccc59d6a..d37a498aacd9 100644
--- a/terraform/oci/kconfigs/shapes/Kconfig.flex
+++ b/terraform/oci/kconfigs/shapes/Kconfig.flex
@@ -73,10 +73,22 @@ config TERRAFORM_OCI_SHAPE
 	default "VM.Optimized3.Flex" if TERRAFORM_OCI_SHAPE_VM_OPTIMIZED3_FLEX
 
 config TERRAFORM_OCI_INSTANCE_FLEX_OCPUS
-	int "Number of flexible instance OCPUs"
+	int "Instance CPU count"
+	output yaml
 	default 2
 	help
-	  The number of OCPUs to use per flexible instance.
+	  The Oracle CPU (OCPU) represents physical CPU cores and is
+	  the unit of measurement for CPUs on x86 CPUs (AMD and
+	  Intel) and Arm CPUs (OCI Ampere Compute). A virtual CPU
+	  (vCPU), the industry-standard for measuring compute
+	  resources, represents one execution thread of a physical
+	  CPU core.
+
+	  Most CPU architectures, including x86, runs two threads
+	  per physical core, so one OCPU is the equal of two vCPUs
+	  for x86-based compute. For OCI Compute, the minimum unit
+	  of provisioning starts from one OCPU on both X86 (Intel
+	  and AMD) and OCI Ampere Compute processors.
 
 config TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS
 	int "How much RAM to use per flexible instance in GB"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 18/31] terraform/OCI: Use "output yaml" for the memory_in_gbs setting
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (16 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 17/31] terraform/OCI: Use "output yaml" for the OCPUs setting cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 19/31] terraform/OCI: Add a shape family selector cel
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_instance_flex_memory_in_gbs" and just pass it
directly from Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile                 | 1 -
 terraform/oci/kconfigs/shapes/Kconfig.flex | 7 +++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 8e4973930125..2750b63b01c0 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_instance_flex_memory_in_gbs=$(subst ",,$(CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS))
 TERRAFORM_EXTRA_VARS += terraform_oci_os_image_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_OS_IMAGE_OCID))
 ifeq (y, $(CONFIG_TERRAFORM_OCI_ASSIGN_PUBLIC_IP))
 TERRAFORM_EXTRA_VARS += terraform_oci_assign_public_ip=true
diff --git a/terraform/oci/kconfigs/shapes/Kconfig.flex b/terraform/oci/kconfigs/shapes/Kconfig.flex
index d37a498aacd9..5ecccf400c6b 100644
--- a/terraform/oci/kconfigs/shapes/Kconfig.flex
+++ b/terraform/oci/kconfigs/shapes/Kconfig.flex
@@ -91,7 +91,10 @@ config TERRAFORM_OCI_INSTANCE_FLEX_OCPUS
 	  and AMD) and OCI Ampere Compute processors.
 
 config TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS
-	int "How much RAM to use per flexible instance in GB"
+	int "Instance memory size"
+	output yaml
 	default 4
 	help
-	  How much GiB of RAM to use per flexible instance.
+	  Memory per instance, in GiBs. The minimum value for this
+	  setting is a multiple of the number of OCPUS in each
+	  instance.
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 19/31] terraform/OCI: Add a shape family selector
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (17 preceding siblings ...)
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 20/31] terraform/OCI: Add a bare metal shape selector cel
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

I'd like to add bare metal shapes too, but they seem to be in a
separate family in the OCI documentation.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/kconfigs/Kconfig.compute     | 23 ++++++++++++++++++++++
 terraform/oci/kconfigs/shapes/Kconfig.flex |  4 ++++
 2 files changed, 27 insertions(+)

diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
index dc6427d18f42..281ef6d29c95 100644
--- a/terraform/oci/kconfigs/Kconfig.compute
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -1,3 +1,26 @@
+choice
+	prompt "OCI shape family"
+	default TERRAFORM_OCI_SHAPE_FAMILY_FLEX
+	help
+	  This option selects the class of virtual hardware (CPUs and
+	  memory) to provision for each target node. Most CPU
+	  architectures, including x86, run two threads per physical
+	  core, so one OCPU is the equal of two vCPUs for x86-based
+	  compute.
+
+	  Which shapes are available is limited by your subscription
+	  and what hardware has been deployed in your selected region.
+
+config TERRAFORM_OCI_SHAPE_FAMILY_FLEX
+	bool "Flex shapes"
+	help
+	  A flexible shape is a virtual machine that lets you
+	  customize the number of OCPUs and the amount of memory
+	  per instance. The network bandwidth and number of VNICs
+	  scale proportionately with the number of OCPUs.
+
+endchoice
+
 source "terraform/oci/kconfigs/shapes/Kconfig.flex"
 
 config TERRAFORM_OCI_OS_IMAGE_OCID
diff --git a/terraform/oci/kconfigs/shapes/Kconfig.flex b/terraform/oci/kconfigs/shapes/Kconfig.flex
index 5ecccf400c6b..67d50604bfcb 100644
--- a/terraform/oci/kconfigs/shapes/Kconfig.flex
+++ b/terraform/oci/kconfigs/shapes/Kconfig.flex
@@ -1,3 +1,5 @@
+if TERRAFORM_OCI_SHAPE_FAMILY_FLEX
+
 choice
 	prompt "OCI shape"
 	default TERRAFORM_OCI_SHAPE_VM_STANDARD3_FLEX
@@ -98,3 +100,5 @@ config TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS
 	  Memory per instance, in GiBs. The minimum value for this
 	  setting is a multiple of the number of OCPUS in each
 	  instance.
+
+endif # TERRAFORM_OCI_SHAPE_FAMILY_FLEX
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 20/31] terraform/OCI: Add a bare metal shape selector
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (18 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 19/31] terraform/OCI: Add a shape family selector cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 21/31] terraform/OCI: Use "output yaml" for the source image setting cel
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Match the same capability that is available for kdevops on AWS.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 .../templates/oci/terraform.tfvars.j2         |  4 +
 terraform/oci/kconfigs/Kconfig.compute        |  9 ++
 terraform/oci/kconfigs/shapes/Kconfig.bm      | 83 +++++++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 terraform/oci/kconfigs/shapes/Kconfig.bm

diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index be0c154802ff..a747a4188e7b 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -6,8 +6,12 @@ oci_user_fingerprint = "{{ terraform_oci_user_fingerprint }}"
 oci_ad_number = {{ terraform_oci_ad_number }}
 oci_compartment_name = "{{ terraform_oci_compartment_name }}"
 oci_shape = "{{ terraform_oci_shape }}"
+{% if terraform_oci_instance_flex_ocpus is defined %}
 oci_instance_flex_ocpus = {{ terraform_oci_instance_flex_ocpus }}
+{% endif %}
+{% if terraform_oci_instance_flex_memory_in_gbs is defined %}
 oci_instance_flex_memory_in_gbs = {{ terraform_oci_instance_flex_memory_in_gbs }}
+{% endif %}
 oci_os_image_ocid = "{{ terraform_oci_os_image_ocid }}"
 oci_assign_public_ip = "{{ terraform_oci_assign_public_ip | lower }}"
 oci_subnet_ocid = "{{ terraform_oci_subnet_ocid }}"
diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
index 281ef6d29c95..0e3aac104175 100644
--- a/terraform/oci/kconfigs/Kconfig.compute
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -19,9 +19,18 @@ config TERRAFORM_OCI_SHAPE_FAMILY_FLEX
 	  per instance. The network bandwidth and number of VNICs
 	  scale proportionately with the number of OCPUs.
 
+config TERRAFORM_OCI_SHAPE_FAMILY_BARE_METAL
+	bool "Bare metal"
+	help
+	  A bare metal shape is a whole physical machine without
+	  virtualization. This gives deterministic performance
+	  characteristics but is less configurable than a flex
+	  shape.
+
 endchoice
 
 source "terraform/oci/kconfigs/shapes/Kconfig.flex"
+source "terraform/oci/kconfigs/shapes/Kconfig.bm"
 
 config TERRAFORM_OCI_OS_IMAGE_OCID
 	string "OCI OS image OCID"
diff --git a/terraform/oci/kconfigs/shapes/Kconfig.bm b/terraform/oci/kconfigs/shapes/Kconfig.bm
new file mode 100644
index 000000000000..40ef4502bb0a
--- /dev/null
+++ b/terraform/oci/kconfigs/shapes/Kconfig.bm
@@ -0,0 +1,83 @@
+if TERRAFORM_OCI_SHAPE_FAMILY_BARE_METAL
+
+choice
+	prompt "OCI shape"
+	default TERRAFORM_OCI_SHAPE_BM_STANDARD3
+	help
+	  Select the basic hardware capabilities that are in each
+	  instance. For more details, see:
+
+	  https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#baremetalshapes
+
+config TERRAFORM_OCI_SHAPE_BM_STANDARD3
+	bool "BM.Standard3"
+	depends on TARGET_ARCH_X86_64
+	help
+	  X9-based standard compute. Processor: Intel Xeon Platinum
+	  8358. Base frequency 2.6 GHz, max turbo frequency 3.4 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_STANDARD_E4
+	bool "BM.Standard.E4"
+	depends on TARGET_ARCH_X86_64
+	help
+	  E4-based standard compute. Processor: AMD EPYC 7J13. Base
+	  frequency 2.55 GHz, max boost frequency 3.5 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_STANDARD_E5
+	bool "BM.Standard.E5"
+	depends on TARGET_ARCH_X86_64
+	help
+	  E5-based standard compute. Processor: AMD EPYC 9J14. Base
+	  frequency 2.4 GHz, max boost frequency 3.7 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_STANDARD_A1
+	bool "BM.Standard.A1"
+	depends on TARGET_ARCH_ARM64
+	help
+	  OCI Ampere A1 Compute Arm-based standard compute. Each
+	  OCPU corresponds to a single hardware execution thread.
+	  Processor: Ampere Altra Q80-30. Max frequency 3.0 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_DENSEIO_E4
+	bool "BM.DenseIO.E4"
+	depends on TARGET_ARCH_X86_64
+	help
+	  E4-based dense I/O compute. Processor: AMD EPYC 7J13.
+	  Base frequency 2.55 GHz, max boost frequency 3.5 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_DENSEIO_E5
+	bool "BM.DenseIO.E5"
+	depends on TARGET_ARCH_X86_64
+	help
+	  E5-based dense I/O compute. Processor: AMD EPYC 9J14.
+	  Base frequency 2.4 GHz, max boost frequency 3.7 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_OPTIMIZED3
+	bool "BM.Optimized3"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Processor: Intel Xeon 6354. Base frequency 3.0 GHz, max
+	  turbo frequency 3.6 GHz.
+
+config TERRAFORM_OCI_SHAPE_BM_HPC_E5
+	bool "BM.HPC.E5"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Processor: AMD EPYC 9J14. Base frequency 2.4 GHz, max
+	  boost frequency 3.7 GHz.
+
+endchoice
+
+config TERRAFORM_OCI_SHAPE
+	string
+	output yaml
+	default "BM.Standard3" if TERRAFORM_OCI_SHAPE_BM_STANDARD3
+	default "BM.Standard.E4" if TERRAFORM_OCI_SHAPE_BM_STANDARD_E4
+	default "BM.Standard.E5" if TERRAFORM_OCI_SHAPE_BM_STANDARD_E5
+	default "BM.Standard.A1" if TERRAFORM_OCI_SHAPE_BM_STANDARD_A1
+	default "BM.DenseIO.E4" if TERRAFORM_OCI_SHAPE_BM_DENSEIO_E4
+	default "BM.DenseIO.E5" if TERRAFORM_OCI_SHAPE_BM_DENSEIO_E5
+	default "BM.Optimized3" if TERRAFORM_OCI_SHAPE_BM_OPTIMIZED3
+	default "BM.HPC.E5" if TERRAFORM_OCI_SHAPE_BM_HPC_E5
+
+endif # TERRAFORM_OCI_SHAPE_FAMILY_BARE_METAL
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 21/31] terraform/OCI: Use "output yaml" for the source image setting
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (19 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 20/31] terraform/OCI: Add a bare metal shape selector cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 22/31] terraform/OCI: Simplify image selection cel
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_os_image_ocid" and just pass it directly from
Kconfig via an "output yaml" directive.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile             | 1 -
 terraform/oci/kconfigs/Kconfig.compute | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 2750b63b01c0..e77f4dd0b474 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,7 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_os_image_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_OS_IMAGE_OCID))
 ifeq (y, $(CONFIG_TERRAFORM_OCI_ASSIGN_PUBLIC_IP))
 TERRAFORM_EXTRA_VARS += terraform_oci_assign_public_ip=true
 else
diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
index 0e3aac104175..e210e9d44dc0 100644
--- a/terraform/oci/kconfigs/Kconfig.compute
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -33,7 +33,8 @@ source "terraform/oci/kconfigs/shapes/Kconfig.flex"
 source "terraform/oci/kconfigs/shapes/Kconfig.bm"
 
 config TERRAFORM_OCI_OS_IMAGE_OCID
-	string "OCI OS image OCID"
+	string "OS image OCID"
+	output yaml
 	help
 	  The OCI ID of the OS image to use.
 	  Read this:
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 22/31] terraform/OCI: Simplify image selection
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (20 preceding siblings ...)
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 23/31] terraform/OCI: Remove TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA cel
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Currently OCI requires users to hunt down the OCID of the
particular OS image they wish to deploy by walking through a list of
images and regions on Oracle's web site, then copying and pasting
the OCID from a region list. This is not terribly user friendly.
I'd like to provide a simple menu to make it easier to select an
image without spending an hour doing research.

The terraform oracle/oci provider has an "oci_core_images" data
source that invokes the ListImages API to search for the OCID of an
OS image based on it's family and name. Neat!

Unfortunately, according to:

  https://github.com/oracle/terraform-provider-oci/issues/352

the ListImages API returns a list that is dynamically generated on
every call. As images are added and removed from OCI, that list will
change over time -- in fact it can change between two "terraform
apply" calls, which might cause a "terraform destroy" to fail. We
want kdevops to have reliable bringup and shutdown to enable
automation.

As described in:

https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/Content/dev/terraform/ref-images.htm#top

the best practice is to stuff fixed image OCIDs into a terraform map
variable. It's ugly and requires upkeep, but it guarantees the OCIDs
are stable from one "apply" to the next.

kdevops now deals with more than a handful of regions and operating
systems, so instead of a terraform map variable, I'm going with a
solution where Kconfig selects an image and sets its OCID in the
gen_tfvars template. That is functionally equivalent to a map
variable but IMO it will be easier for us to maintain (either by
hand or automatically via a script).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/kconfigs/Kconfig.compute        |  43 +++-
 .../oci/kconfigs/images/Kconfig.OracleLinux   | 237 ++++++++++++++++++
 terraform/oci/kconfigs/images/Kconfig.Ubuntu  | 162 ++++++++++++
 terraform/oci/kconfigs/images/Kconfig.custom  |  20 ++
 4 files changed, 456 insertions(+), 6 deletions(-)
 create mode 100644 terraform/oci/kconfigs/images/Kconfig.OracleLinux
 create mode 100644 terraform/oci/kconfigs/images/Kconfig.Ubuntu
 create mode 100644 terraform/oci/kconfigs/images/Kconfig.custom

diff --git a/terraform/oci/kconfigs/Kconfig.compute b/terraform/oci/kconfigs/Kconfig.compute
index e210e9d44dc0..ceab066cc5e0 100644
--- a/terraform/oci/kconfigs/Kconfig.compute
+++ b/terraform/oci/kconfigs/Kconfig.compute
@@ -32,10 +32,41 @@ endchoice
 source "terraform/oci/kconfigs/shapes/Kconfig.flex"
 source "terraform/oci/kconfigs/shapes/Kconfig.bm"
 
-config TERRAFORM_OCI_OS_IMAGE_OCID
-	string "OS image OCID"
-	output yaml
+choice
+	prompt "Distribution"
+	default TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX
 	help
-	  The OCI ID of the OS image to use.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  Select the Linux distribution to install on each instance.
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX
+	bool "Oracle Linux"
+	help
+	  Select this if you want to use a release of Oracle Linux
+	  as the operating system in your instances.
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU
+	bool "Ubuntu"
+	help
+	  Select this if you want to use a release of Ubuntu Linux
+	  as the operating system in your instances.
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_CUSTOM
+	bool "Custom image OCID"
+	help
+	  Select this if you want to enter a specific OCID for
+	  an OS image. Use this if you wish to use a custom or
+	  marketplace image not included in the fixed choices in
+	  this menu.
+
+	  The image you specify must reside in the same region as
+	  your instances.
+
+	  More image choices are available:
+
+	  https://docs.oracle.com/en-us/iaas/images/
+
+endchoice
+
+source "terraform/oci/kconfigs/images/Kconfig.OracleLinux"
+source "terraform/oci/kconfigs/images/Kconfig.Ubuntu"
+source "terraform/oci/kconfigs/images/Kconfig.custom"
diff --git a/terraform/oci/kconfigs/images/Kconfig.OracleLinux b/terraform/oci/kconfigs/images/Kconfig.OracleLinux
new file mode 100644
index 000000000000..d0aa9114c209
--- /dev/null
+++ b/terraform/oci/kconfigs/images/Kconfig.OracleLinux
@@ -0,0 +1,237 @@
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX
+
+choice
+	prompt "OS release"
+	default TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_ARM64 if TARGET_ARCH_ARM64
+	default TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_X86 if TARGET_ARCH_X86_64
+	help
+	  Select the release of Oracle Linux to install on each
+	  instance.
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_X86
+	bool "Oracle Linux 7.9 (x86)"
+	depends on TARGET_ARCH_X86_64
+	help
+	  (extended support) Oracle-Linux-7.9-2025.01.31-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oraclelinux-7x/oracle-linux-7-9-2025-01-31-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_GPU
+	bool "Oracle Linux 7.9 Gen2 GPU"
+	depends on TARGET_ARCH_X86_64
+	help
+	  (extended support) Oracle-Linux-7.9-Gen2-GPU-2025.01.31-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oraclelinux-7x/oracle-linux-7-9-gen2-gpu-2025-01-31-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_ARM64
+	bool "Oracle Linux 7.9 (aarch64)"
+	help
+	  (extended support) Oracle-Linux-7.9-aarch64-2024.11.30-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oraclelinux-7x/oracle-linux-7-9-aarch64-2024-11-30-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_GPU
+	bool "Oracle Linux 8.10 Gen2 GPU"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Oracle-Linux-8.10-Gen2-GPU-2025.03.18-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oracle-linux-8x/oracle-linux-8-10-gen2-gpu-2025-03-18-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_ARM64
+	bool "Oracle Linux 8.10 (aarch64)"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Oracle-Linux-8.10-aarch64-2025.03.18-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oracle-linux-8x/oracle-linux-8-10-aarch64-2025-03-18-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_X86
+	bool "Oracle Linux 8.10 (x86)"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Oracle-Linux-8.10-2025.03.18-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oracle-linux-8x/oracle-linux-8-10-2025-03-18-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_GPU
+	bool "Oracle Linux 9.5 Gen2 GPU"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Oracle-Linux-9.5-Gen2-GPU-2025.03.18-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oracle-linux-9x/oracle-linux-9-5-gen2-gpu-2025-03-18-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_ARM64
+	bool "Oracle Linux 9.5 (aarch64)"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Oracle-Linux-9.5-aarch64-2025.03.18-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oracle-linux-9x/oracle-linux-9-5-aarch64-2025-03-18-0.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_X86
+	bool "Oracle Linux 9.5 (x86)"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Oracle-Linux-9.5-2025.03.18-0
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/oracle-linux-9x/oracle-linux-9-5-2025-03-18-0.htm
+
+endchoice
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_X86
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaaw4cggpn2wh4jhwpkcjdzvyicfaqblwcc6xq5k4i2jxkg2bx4gm6a" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.iad.aaaaaaaaew4bboppacmw7pvlog5wvtygfxhrvv2bfanicvjj2ljrmvtkfdtq" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaokvcf2uuidul5n7ukneihfkrtrowlyoo22ceowanplkinmbftmca" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaaz2glfsxaks4mvrnx5dpcevkm4yo32bls4zkfg7brsklldwgtq2oq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaa7cuflxmluvu7lumzlz2lcrvhh7seamwsrpyvjfey2ed25pxw5lha" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaakb25v43zvj44zljk73p2j5e2ew2ycht5obleuy7ntj24pttc65ga" if TERRAFORM_OCI_REGION_SJC
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaaxtpiye5nnlmdl4a4far26ywp4mw3xtuchg6texgrlrl435mgomaq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaatvm5xr23xsvjofwybmqfixrsfk4442sjpckjccechfhqso5kt4ia" if TERRAFORM_OCI_REGION_PHX
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_X86
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_GPU
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaan6dsfja3qduobzk72iw6ocofxesiufcgjckbxampnwuk2q76xiiq" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.iad.aaaaaaaavkrcpinzw6otfx4h5wdgfypy7pa43u5nxm3vyur3wmadfacg6yoq" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaakkooyvv6j3ovxkyath4sx66hzly7ayew4apczehvfkujmneaqmwq" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaal45sa5nortjwtxfnzcufq4ly5kq7dhshz3e37vumjk7arjknajwa" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaaxyoh65vwphlena44mm5gh56bidphgarl5c5qhbuuzvgbc4oytxtq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaa7q72ht4bblpje2twwt6n5rstnbmmg3zsmrro35wj2jrfhwwtnoiq" if TERRAFORM_OCI_REGION_SJC
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaaevcobrg3izf46fimhmz2xdsnagixvgokyysteuajsdyqdi4lnudq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaaop2dgnaymj3azm4cm2awycupwldxrqu6h4loo6zfcyez6hfffadq" if TERRAFORM_OCI_REGION_PHX
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_GPU
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_ARM64
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaa7y3qbdzra44m52ugjy5bdnsczazugkspybkejbcebdjqklzcifwa" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.iad.aaaaaaaamawldxaesq2w6ypyu6dpwgccgn2llakpymzn2xhs2it3ao3kpeda" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaagd2ujisye2n4qrqxehgkfgqefbthic7pph4sdabdwe5hpjn2yxia" if TERRAFORM_OCI_REGION_SJC
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaa267gephgrqd4dimf55szmw7gwqibqxkheyixbz3ptltspla6brnq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaboblnxwpnu7qujwuvbnawt7bvmmmnilhzah6qp44fppe2pggpviq" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.phx.aaaaaaaawn7p3y4k4nkqjvtjsvufmhz4g2ijthfp6vtcsly6qe37iliw3kcq" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaayxu334z7aijxckl66tne42zudtrqts2ju5iq7e2envn7tp7bvfjq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaauvy56pg3en7rnmttztnm5naqopw7f4nug4a3bgy6nhed3e7s46fa" if TERRAFORM_OCI_REGION_ORD
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_7_9_ARM64
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_GPU
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaag6nolpaijfzxqy6o4pufxqzmsb53wdhlmt47i6uy7qrlup22ghba" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaaypx4qk7wgvoxp7ijpfgh2iyolrjawby5fe3bahhpq5jx6qzm6hlq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaabcjwzgu4e3osnnot6f75b3pj5lyoyi6756u5ihqz6wdrx33t6wxa" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaa2xegkn2nihnzhbtc2s7qimattaraxhb7l3ubcusg53izojyatalq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaasg53rljyobwumy3z4rqx6qbfjo5txibadwztq3kqg5mx3ispi2fq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaann7bi7eee2u2yeyuyidz4woqcegnywalip7umbod6aknztgkqpja" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.iad.aaaaaaaaj3uhqliqpetwozwm5hbfuqw4ubrhkg7pnez2lwwrlbibqe4o72ga" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaa6dl65tbhiirls2t427juav6d2fnjqjyattzzkssnjys3owsmwqfa" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_GPU
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_ARM64
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaaoqg3nzwxnkw66rf3f53nomqku3hruwjpdjxwq3i7w7uurkxntshq" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaa4zhvgsmsftn6j4bxlidb6zq2tziy6v4ylp3tpjwd5nvte2qj3fzq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaarzkc66ki6qcbykys7hjhoy2avyfp5lj5mwtvbpu7ondaz2rs46ha" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaazoyranvzks4xlbfu5s3ylro5m246wja2j77d37a7y6oniq4scspq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaahhe6tyixhxyc5bv7dxejl4ools5h235ry5kfu6jgstnxqeavtugq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaa33kkau2zsjk4eias7pz6akuff4giijs4dbhzhzka5lbctk2d5da" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.iad.aaaaaaaa3zzp4jue2jp5wm2hesslxoq27qqrzxfwdxylcabkv3ginqacgqra" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaagnr4w7bpjky7twkpwn4oag55wqowqjlegqzmiqqha6aiylqu6tta" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_ARM64
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_X86
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaa3rpjxl576g3nsurlkzqcsrhruo3frpmfzqjmntqcfaukmhzoeqqq" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaazviipxxkrka3pvwq4twxm4q2bpqyp6fvv7txx7jlvbxmvtuzfwga" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaaupsoxaochddlvom7joxo3457sw5bfprehlftrifg64zvyetpscga" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaa6kzgiyrgaibzgkbcjybt7q7ripbp4qxybzci7z3cxq6jyoe6xnvq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaa4eqd3xzpt4wej2dhvbmn6qezgp6qs5rx2kvmu55dicdcgtko5o5q" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaarhsptzukiqy3zeo7e37yxvi2do3gs2xnymlhosz5dwf53dvgymjq" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.iad.aaaaaaaa6ihkh6yp6f2e2np4fkucu7rv7d3v6uogy7ya7osfmogkznjaveha" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaarj3piol7pdmcydvgryclnhdr2rce5ozvamumvb3l2fdodbq3wouq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_8_10_X86
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_GPU
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaafpwtoai7qo6unslyke7nweznm6bof2g6kiyjkrlxfqqi7jtyv6rq" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaavopk6s6ejcwol4mivfaipbxk6fpmvynhwxtp65prjet6cyyi3e4a" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaajombg57yxesfnlsuq4zjp7uee552u2qolrol3vv26queht227mfq" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaaiyemvdwdvm2gaqr7qvioby5vwkvvl54lvaludny6gxqgx4hcxqra" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaaf2dam6k3z45mkthh4ezalp5bidbk45rwdthvlu6uywg2f5wtb5ba" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaz5ewjpl7z3qgpjd5autfuxf3qzunzfsuokvqgv7auvjxdwevuyta" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.iad.aaaaaaaau4ebstxoehxcndmyypuup2u7dutsnem7iocf3wen3eq6loi3wbha" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaah2rydmd3v7fx24v3mfv4iobw4c6fonwoivkm3lcathnobijqwacq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_GPU
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_ARM64
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaavgibokwp4zsq76csi3huy722jmkjq2bnquhyc5loynon6vqyekmq" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaa4sfujzbvkgsbpeu2my2zvtszddoflbzpx7dmf7nq252q7tg4qsmq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaa3is5zklasaldyvhbspwe3wep2mu3knhdlbhgn6gksgm54h2k3mya" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaajgecqb2h332aesfnke56zs7vhopawsos3vdm2vdzxv4bsi6rapxa" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaand6afptekvywnvosbbtiqkhwpdxpf4lqj77e7f7hp4z4mutfjnjq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaayl2scgs4qnzrkfyufmbvbtbxfbzkaoqifo76f4atetpwn77hj2ja" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.iad.aaaaaaaawvs4xn6dfl6oo45o2ntziecjy2cbet2mlidvx3ji62oi3jai4u5a" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaandckidue7lzzhey4u2s3m27rwigsholban3l2bvxe6oemakrqsmq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_ARM64
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_X86
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaadgymvb6xuprmddif4jlfu5nzgxqun7rt6bevockugwa3mdhcde4q" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaaoaz7xssmgj6qudbwdjbfxtgmqnslte7p5lt5vcz66w7ic7zrw7xq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.phx.aaaaaaaad3yrq635f5swbg3g2iwtxvnxl2ytyrdkhurdizz4f6jf6miw4vma" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaao72nz2dewwn5ub6hpqgdedkhyxruebuifzrdj4upva645evvtmmq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaaoxzvhrzruoandezl5itouxnrg32hay3zm4p3hkydqj3dxxdbpikq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaj7q7ofu4kqa5j3gm546xkin4hlf2gakcsbmxjcb4ghaf5irxuwyq" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.iad.aaaaaaaatf3vyxzq3pv5jugwixnmnmh7aivqyhtlwalmgwquvp7c4npuy2ba" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaaopxntceb4zygnto7tbi7ezxptoxp3m72jz5ttpp5zfg4iklupr4q" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX_9_5_X86
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_ORACLE_LINUX
diff --git a/terraform/oci/kconfigs/images/Kconfig.Ubuntu b/terraform/oci/kconfigs/images/Kconfig.Ubuntu
new file mode 100644
index 000000000000..5a87cd4c33c4
--- /dev/null
+++ b/terraform/oci/kconfigs/images/Kconfig.Ubuntu
@@ -0,0 +1,162 @@
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU
+
+choice
+	prompt "OS release"
+	default TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_ARM64 if TARGET_ARCH_ARM64
+	default TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_X86 if TARGET_ARCH_X86_64
+	help
+	  Select the release of Ubuntu to install on each instance.
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_20_04_ARM64
+	bool "Ubuntu 20.04 (aarch64)"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Canonical-Ubuntu-20.04-aarch64-2025.01.31-1
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/ubuntu-2004/canonical-ubuntu-20-04-aarch64-2025-01-31-1.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_20_04_X86
+	bool "Ubuntu 20.04 (x86)"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Canonical-Ubuntu-20.04-2025.01.31-1
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/ubuntu-2004/canonical-ubuntu-20-04-2025-01-31-1.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_22_04_ARM64
+	bool "Ubuntu 22.04 (aarch64)"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Canonical-Ubuntu-22.04-aarch64-2025.01.31-1
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/ubuntu-2204/canonical-ubuntu-22-04-aarch64-2025-01-31-1.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_22_04_X86
+	bool "Ubuntu 22.04 (x86)"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Canonical-Ubuntu-22.04-2025.01.31-1
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/ubuntu-2204/canonical-ubuntu-22-04-2025-01-31-1.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_ARM64
+	bool "Ubuntu 24.04 (aarch64)"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Canonical-Ubuntu-24.04-aarch64-2025.01.31-1
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/ubuntu-2404/canonical-ubuntu-24-04-aarch64-2025-01-31-1.htm
+
+config TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_X86
+	bool "Ubuntu 24.04 (x86)"
+	depends on TARGET_ARCH_X86_64
+	help
+	  Canonical-Ubuntu-24.04-2025.01.31-1
+
+	  Image release notes:
+	  https://docs.oracle.com/en-us/iaas/images/ubuntu-2404/canonical-ubuntu-24-04-2025-01-31-1.htm
+
+endchoice
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_20_04_ARM64
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaawnlatjgnpqmaercoleknle5nml47l23iwnxi7ba4xup5ajyarv6q" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaawkgecsy7fbxqeus5zpw5n7ykyeugzizcehrildz7pzavfjrcsswa" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaesuvbpyo4lpim5xxx3lwj4lcppfkzp6tsape336epukyndi2pora" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaaoox5ewo5bq67sr2spakzdiw4rrxjlgbr25ucqwglb4aonastyhzq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.iad.aaaaaaaan5qjp6hcvi2ry24zp233wlotljj4llfghqbyn2yoon6wnc3se6pa" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaa7habuxhtxdty52x47eq27lq7gjweoun4urafpv2s6ysggbp6nrxa" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.phx.aaaaaaaaji2v46qtemmx7bpuoomw2uvrsatvgxrlnp3orvdptbl6ppbal67q" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaa2dt3oqmhwwd3z2o3wynfltfa3rms6pc2uhvr2kmjmmyvqr2li7pq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_20_04_ARM64
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_20_04_X86
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaa3uvxetf4g6beur4qn2ublcl6set7qtda2rcfcv5h7vul6aut2q7q" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaaj276t4bm4hyqyu44mjcuzndgn6lku4th3nfaglwpiyzsp6lozqlq" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaaagkdbfci5rxx5yikkifi7culqosi7r623osdzqv25rkanxd66dbq" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaafbbzzsemfbol5vvyevlmqxhcv6avfo5z6larkuty4safdn3epoha" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.iad.aaaaaaaaw65jff6tnjbr7x2c2lr3qlf46l2sthpuidxaurmar2oxjmqry3qa" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaagyn7e55mr27m7ttkp2exvdix4ugfl2jbl66xognsge44vuqat4ma" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.phx.aaaaaaaazjumsfmhi2tztgs7wuhesifaj2fw47xmyycltazjmr5xa6k7do7q" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaaka77df4vad27cm7oamg3zji6ir5zrvbwbkm7ks7rvucd3bwsbqnq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_20_04_X86
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_22_04_ARM64
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaaca7s2s5pgnooszcjysi7pknrimayqjds6knvjascphe2r767m6vq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaamvlfwzlzk6jkyuhoylf6k3n5r7tz6m2lvf5fqjdpsrdwqk2dtcqa" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaai6c6hx7wvx5l3oikjcv7am3n23etmbuu3byic3grzhx5ylthigca" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaa7fy2cysnjwlpoghk5ax65jmvyteg4bjmji6xmm4gti6xg4kmgfia" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.iad.aaaaaaaaq3uhgye3ryjqjcnnmtk5u4ipa5ffhxawa6nvgelzccz5x3pfel4a" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaar5u2rj2ahg2btnlmnxhzijozcuqb5lhjit327wesufuhjkytfwha" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.phx.aaaaaaaa7f6r242tdb2roknj3odb264g2tduvc2je2u4kbp3hqatiy4sngcq" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaax6vsn7c34viq7yfu3j3v554x6dulorapywrorheltorxoi5on4dq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_22_04_ARM64
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_22_04_X86
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaalldybw6d43ihqwcqeeedsncrl4s7qfczeqwq2eb5cohxj2gyp72q" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaaooprivsfvvblwxhl2oww3djmz4mnjxjqczxunvahu5dvt3dwlfka" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaadstv5y7ovuhvg354zu4mocto6eyy4frnnfartpl34hmaupg6upka" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaaf6wyj6ap2frgctd7xj7pkxwvj7gowxinvy6xbjzz3z4cv2d5ycfa" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.iad.aaaaaaaablkb5j2kdyqehb7qp2scdyuwslknidn4a53qzje2fxcbw3ji5gta" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaa3dfmmuqlupm4gruk5weh5mncxbmfzn36uoj2relmdwvud44zc3ea" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.phx.aaaaaaaaccxuq5zox772ncsaggg52xngwcipzfqoqwu7x73owhvd7ula7xpa" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaappswsfuaodghkbps5kjh3bhjxxpaig56wiirxhjlo5tktsuypkha" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_22_04_X86
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_ARM64
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaagkujhljfnogpc4zmmith4sbyh32ltdnxrjx7wksssyv3yv3xkasq" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaat27vwnwxtqovgbceettrrkmvlgwgyn3vj7rhyblih7omqhi4cioa" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaayojwvhljgwqgpdyqcqdjh4jgbcfd6hu2axdogi4c3si5stmdcjxa" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaaj4vzogabouc3ypajurmwx53juolg745la7mmi4qj3grijoaziwlq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.iad.aaaaaaaahga37ytba47p2msqzbh5erbqvniyybcvteuh646vgyw4tltustka" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaasghgl3azcm2kjya2p7urk4nnpfjlrxlfeosn5jc6hm5epn7gkrra" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.phx.aaaaaaaag7js2gmz5yrqtnnjirri52hyqvsymn7gp5a7gwg5jtd2jowpi7tq" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaatsp47wenhtuubuusyi2pgohpnal5fz6jyz4ur5n4juwhj2n2egpq" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_ARM64
+
+if TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_X86
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string
+	output yaml
+	default "ocid1.image.oc1.ap-hyderabad-1.aaaaaaaakzztav5leofa43dcc7uecenhjhazdxlaj7u3kgnfsu65fcw6c5wa" if TERRAFORM_OCI_REGION_HYD
+	default "ocid1.image.oc1.ap-mumbai-1.aaaaaaaayvok7wg6qwbf2nfeohcqroie2eyplrlxsuwjut7rdugg7jftk7pa" if TERRAFORM_OCI_REGION_BOM
+	default "ocid1.image.oc1.ca-montreal-1.aaaaaaaa33jzjdmexcf5zaiia2mhjou5xsgatzaqm4mwgqejp2f77bnjhwpa" if TERRAFORM_OCI_REGION_YUL
+	default "ocid1.image.oc1.ca-toronto-1.aaaaaaaadtwzeffczkghs325xbzeocp4i7ghpeims5insf6a65kxcpmk4bwq" if TERRAFORM_OCI_REGION_YYZ
+	default "ocid1.image.oc1.iad.aaaaaaaaaja5re7chpwbyrdk57xya7qoxdktskrn5lph7fsuai5zccaefawa" if TERRAFORM_OCI_REGION_IAD
+	default "ocid1.image.oc1.us-chicago-1.aaaaaaaaslqsnubarsgmpktkbewqedpf76vp6e5k7nafoxpx3aaryag2a6ba" if TERRAFORM_OCI_REGION_ORD
+	default "ocid1.image.oc1.phx.aaaaaaaapplpp6okoc73a23mdag6k6mwgscofpx2p7bcigeo3ztjktsd53pa" if TERRAFORM_OCI_REGION_PHX
+	default "ocid1.image.oc1.us-sanjose-1.aaaaaaaaebdhewufiuvsm6kh2eccurg5zdchwfr24heayt4h4bwenee3lwka" if TERRAFORM_OCI_REGION_SJC
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU_24_04_X86
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_UBUNTU
diff --git a/terraform/oci/kconfigs/images/Kconfig.custom b/terraform/oci/kconfigs/images/Kconfig.custom
new file mode 100644
index 000000000000..144b974fbe08
--- /dev/null
+++ b/terraform/oci/kconfigs/images/Kconfig.custom
@@ -0,0 +1,20 @@
+if TERRAFORM_OCI_OPERATING_SYSTEM_CUSTOM
+
+config TERRAFORM_OCI_OS_IMAGE_OCID
+	string "OS image OCID"
+	output yaml
+	help
+	  An image is a template of a virtual hard drive. It
+	  contains the operating system and other software for each
+	  instance. Select an image by specifying the OCID of the
+	  image to use. You can select:
+
+	  - An older release than the latest image release
+	  - An older operating system release
+	  - A custom-made image
+
+	  More detail is available:
+
+	  https://docs.oracle.com/en-us/iaas/Content/Compute/References/bringyourownimage.htm
+
+endif # TERRAFORM_OCI_OPERATING_SYSTEM_CUSTOM
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 23/31] terraform/OCI: Remove TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (21 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 22/31] terraform/OCI: Simplify image selection cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 24/31] terraform/OCI: Use "output yaml" for the assign_public_ip" setting cel
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Chandan and I have noticed that "enable extra disks, select 2 per
instance" is pretty much exactly the same as "don't enable extra
disks". Simplify the extra disks selector by removing the check
box and making "2 disks per instance" the default.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 .../templates/oci/terraform.tfvars.j2         |  6 --
 scripts/terraform.Makefile                    | 11 ---
 terraform/oci/kconfigs/Kconfig.storage        | 75 ++++---------------
 terraform/oci/main.tf                         | 40 +---------
 terraform/oci/vars.tf                         | 19 +----
 5 files changed, 17 insertions(+), 134 deletions(-)

diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index a747a4188e7b..fd3d9b853c05 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -15,16 +15,10 @@ oci_instance_flex_memory_in_gbs = {{ terraform_oci_instance_flex_memory_in_gbs }
 oci_os_image_ocid = "{{ terraform_oci_os_image_ocid }}"
 oci_assign_public_ip = "{{ terraform_oci_assign_public_ip | lower }}"
 oci_subnet_ocid = "{{ terraform_oci_subnet_ocid }}"
-oci_volumes_enable_extra = "{{ terraform_oci_volumes_enable_extra | lower }}"
-{% if terraform_oci_volumes_enable_extra %}
 oci_volumes_per_instance = {{ terraform_oci_volumes_per_instance }}
 oci_volumes_size = {{ terraform_oci_volumes_size }}
-{% else %}
-oci_data_volume_display_name = "{{ terraform_oci_data_volume_display_name }}"
 oci_data_volume_device_file_name = "{{ terraform_oci_data_volume_device_file_name }}"
-oci_sparse_volume_display_name = "{{ terraform_oci_sparse_volume_display_name }}"
 oci_sparse_volume_device_file_name = "{{ terraform_oci_sparse_volume_device_file_name }}"
-{% endif %}
 
 ssh_config_pubkey_file = "{{ kdevops_terraform_ssh_config_pubkey_file }}"
 ssh_config_user = "{{ kdevops_terraform_ssh_config_user }}"
diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index e77f4dd0b474..d9e28050a508 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -101,17 +101,6 @@ else
 TERRAFORM_EXTRA_VARS += terraform_oci_assign_public_ip=false
 endif
 TERRAFORM_EXTRA_VARS += terraform_oci_subnet_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_SUBNET_OCID))
-
-ifeq (y, $(CONFIG_TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA))
-TERRAFORM_EXTRA_VARS += terraform_oci_volumes_enable_extra=true
-else
-TERRAFORM_EXTRA_VARS += terraform_oci_volumes_enable_extra=false
-TERRAFORM_EXTRA_VARS += terraform_oci_data_volume_display_name=$(subst ",,$(CONFIG_TERRAFORM_OCI_DATA_VOLUME_DISPLAY_NAME))
-TERRAFORM_EXTRA_VARS += terraform_oci_sparse_volume_display_name=$(subst ",,$(CONFIG_TERRAFORM_OCI_SPARSE_VOLUME_DISPLAY_NAME))
-endif
-TERRAFORM_EXTRA_VARS += terraform_oci_data_volume_device_file_name=$(subst ",,$(CONFIG_TERRAFORM_OCI_DATA_VOLUME_DEVICE_FILE_NAME))
-TERRAFORM_EXTRA_VARS += terraform_oci_sparse_volume_device_file_name=$(subst ",,$(CONFIG_TERRAFORM_OCI_SPARSE_VOLUME_DEVICE_FILE_NAME))
-
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OPENSTACK))
diff --git a/terraform/oci/kconfigs/Kconfig.storage b/terraform/oci/kconfigs/Kconfig.storage
index 8b2885a07d63..ed872a26834e 100644
--- a/terraform/oci/kconfigs/Kconfig.storage
+++ b/terraform/oci/kconfigs/Kconfig.storage
@@ -1,69 +1,50 @@
-config TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-	bool "Enable additional block devices"
-	default n
-	help
-	  Enable this to provision up to 10 extra block devices
-	  on each target node.
-
-if TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
 choice
 	prompt "Count of extra block volumes"
-	default TERRAFORM_OCI_VOLUMES_PER_INSTANCE_4
+	default TERRAFORM_OCI_VOLUMES_PER_INSTANCE_2
 	help
-	  The count of extra block devices attached to each target
-	  node.
+	  The count of extra block devices attached to each
+	  instance.
+
+config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_0
+	bool "0"
+
+config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_1
+	bool "1"
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_2
 	bool "2"
-	help
-	  Provision 2 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_3
 	bool "3"
-	help
-	  Provision 3 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_4
 	bool "4"
-	help
-	  Provision 4 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_5
 	bool "5"
-	help
-	  Provision 5 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_6
 	bool "6"
-	help
-	  Provision 6 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_7
 	bool "7"
-	help
-	  Provision 7 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_8
 	bool "8"
-	help
-	  Provision 8 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_9
 	bool "9"
-	help
-	  Provision 9 extra volumes per target node.
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE_10
 	bool "10"
-	help
-	  Provision 10 extra volumes per target node.
 
 endchoice
 
 config TERRAFORM_OCI_VOLUMES_PER_INSTANCE
 	int
 	output yaml
+	default 0 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_0
+	default 1 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_1
 	default 2 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_2
 	default 3 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_3
 	default 4 if TERRAFORM_OCI_VOLUMES_PER_INSTANCE_4
@@ -76,7 +57,7 @@ config TERRAFORM_OCI_VOLUMES_PER_INSTANCE
 
 choice
 	prompt "Volume size for each additional volume"
-	default TERRAFORM_OCI_VOLUMES_SIZE_50G
+	default TERRAFORM_OCI_VOLUMES_SIZE_128G
 	help
 	  OCI implements volume sizes between 50G and 32T. In some
 	  cases, 50G volumes are in the free tier.
@@ -141,44 +122,16 @@ config TERRAFORM_OCI_VOLUMES_SIZE
 	default 4096 if TERRAFORM_OCI_VOLUMES_SIZE_4096G
 	default 8192 if TERRAFORM_OCI_VOLUMES_SIZE_8192G
 
-endif # TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-if !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-config TERRAFORM_OCI_DATA_VOLUME_DISPLAY_NAME
-	string "Display name to use for the data volume"
-	default "data"
-	help
-	  Human readable data volume instance name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-endif # !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
 config TERRAFORM_OCI_DATA_VOLUME_DEVICE_FILE_NAME
 	string "Data volume's device file name"
+	output yaml
 	default "/dev/oracleoci/oraclevdb"
 	help
 	  Data volume's device file name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-if !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
-
-config TERRAFORM_OCI_SPARSE_VOLUME_DISPLAY_NAME
-	string "Display name to use for the sparse volume"
-	default "sparse"
-	help
-	  Human readable sparse volume instance name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
-
-endif # !TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA
 
 config TERRAFORM_OCI_SPARSE_VOLUME_DEVICE_FILE_NAME
 	string "Sparse volume's device file name"
+	output yaml
 	default "/dev/oracleoci/oraclevdc"
 	help
 	  Sparse volume's device file name
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index 6991644d83b8..f6596a104c51 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -40,46 +40,8 @@ resource "oci_core_instance" "kdevops_instance" {
   preserve_boot_volume = false
 }
 
-resource "oci_core_volume" "kdevops_data_disk" {
-  count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
-
-  availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
-  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
-  display_name = var.oci_data_volume_display_name
-  size_in_gbs = 50
-}
-
-resource "oci_core_volume" "kdevops_sparse_disk" {
-  count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
-
-  availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
-  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
-  display_name = var.oci_sparse_volume_display_name
-  size_in_gbs = 120
-}
-
-resource "oci_core_volume_attachment" "kdevops_data_volume_attachment" {
-  count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
-
-  attachment_type = "paravirtualized"
-  instance_id = element(oci_core_instance.kdevops_instance.*.id, count.index)
-  volume_id = element(oci_core_volume.kdevops_data_disk.*.id, count.index)
-
-  device = var.oci_data_volume_device_file_name
-}
-
-resource "oci_core_volume_attachment" "kdevops_sparse_disk_attachment" {
-  count = var.oci_volumes_enable_extra == "true" ? 0 : local.kdevops_num_boxes
-
-  attachment_type = "paravirtualized"
-  instance_id = element(oci_core_instance.kdevops_instance.*.id, count.index)
-  volume_id = element(oci_core_volume.kdevops_sparse_disk.*.id, count.index)
-
-  device = var.oci_sparse_volume_device_file_name
-}
-
 module "volumes" {
-  count  = var.oci_volumes_enable_extra == "true" ? local.kdevops_num_boxes : 0
+  count  = local.kdevops_num_boxes
   source = "./volumes"
 
   vol_availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index f760fbb776fa..7c19720bebc2 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -65,11 +65,6 @@ variable "oci_subnet_ocid" {
   type        = string
 }
 
-variable "oci_volumes_enable_extra" {
-  description = "Create additional block volumes per instance"
-  type        = bool
-}
-
 variable "oci_volumes_per_instance" {
   description = "The count of additional block volumes per instance"
   type        = number
@@ -80,22 +75,12 @@ variable "oci_volumes_size" {
   type        = number
 }
 
-variable "oci_data_volume_display_name" {
-  description = "Display name to use for the data volume"
-  type        = string
-}
-
-variable oci_data_volume_device_file_name {
+variable "oci_data_volume_device_file_name" {
   description = "Data volume's device file name"
   type        = string
 }
 
-variable "oci_sparse_volume_display_name" {
-  description = "Display name to use for the sparse volume"
-  type        = string
-}
-
-variable oci_sparse_volume_device_file_name {
+variable "oci_sparse_volume_device_file_name" {
   description = "Sparse volume's device file name"
   type        = string
 }
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 24/31] terraform/OCI: Use "output yaml" for the assign_public_ip" setting
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (22 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 23/31] terraform/OCI: Remove TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 25/31] terraform/OCI: Use "output yaml" for the subnet_ocid setting cel
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_assign_public_ip" and just pass it directly from
Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/gen_tfvars/defaults/main.yml             | 2 +-
 .../roles/gen_tfvars/templates/oci/terraform.tfvars.j2   | 2 +-
 scripts/terraform.Makefile                               | 5 -----
 terraform/oci/kconfigs/Kconfig.network                   | 9 +++++----
 4 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/playbooks/roles/gen_tfvars/defaults/main.yml b/playbooks/roles/gen_tfvars/defaults/main.yml
index f64102b2fbf5..b6caadcb7e0c 100644
--- a/playbooks/roles/gen_tfvars/defaults/main.yml
+++ b/playbooks/roles/gen_tfvars/defaults/main.yml
@@ -48,7 +48,7 @@ terraform_gce_scatch_disk_type: "invalid"
 terraform_gce_image_name: "invalid"
 terraform_gce_credentials: "invalid"
 
-terraform_oci_assign_public_ip: "false"
+terraform_oci_assign_public_ip: false
 
 terraform_openstack_cloud_name: "invalid"
 terraform_openstack_instance_prefix: "invalid"
diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index fd3d9b853c05..192d72ff32a9 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -13,7 +13,7 @@ oci_instance_flex_ocpus = {{ terraform_oci_instance_flex_ocpus }}
 oci_instance_flex_memory_in_gbs = {{ terraform_oci_instance_flex_memory_in_gbs }}
 {% endif %}
 oci_os_image_ocid = "{{ terraform_oci_os_image_ocid }}"
-oci_assign_public_ip = "{{ terraform_oci_assign_public_ip | lower }}"
+oci_assign_public_ip = {{ terraform_oci_assign_public_ip | lower }}
 oci_subnet_ocid = "{{ terraform_oci_subnet_ocid }}"
 oci_volumes_per_instance = {{ terraform_oci_volumes_per_instance }}
 oci_volumes_size = {{ terraform_oci_volumes_size }}
diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index d9e28050a508..99aadfc51fff 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -95,11 +95,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_
 endif
 
 ifeq (y,$(CONFIG_TERRAFORM_OCI))
-ifeq (y, $(CONFIG_TERRAFORM_OCI_ASSIGN_PUBLIC_IP))
-TERRAFORM_EXTRA_VARS += terraform_oci_assign_public_ip=true
-else
-TERRAFORM_EXTRA_VARS += terraform_oci_assign_public_ip=false
-endif
 TERRAFORM_EXTRA_VARS += terraform_oci_subnet_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_SUBNET_OCID))
 endif
 
diff --git a/terraform/oci/kconfigs/Kconfig.network b/terraform/oci/kconfigs/Kconfig.network
index ab1914c6f6a6..9dc77a266eb4 100644
--- a/terraform/oci/kconfigs/Kconfig.network
+++ b/terraform/oci/kconfigs/Kconfig.network
@@ -1,10 +1,11 @@
 config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
-	bool "Assign public IP address to the cloud instance"
+	bool "Assign public IP address to each instance"
+	output yaml
 	default y
 	help
-	  Select this field if public IP address has to be assigned to
-	  the cloud instance. Otherwise a public IP address is
-	  assigned.
+	  Enable this setting if a public IP address should be
+	  assigned to each instance. Leave it unset to prevent your
+	  instances from being accessible on the public internet.
 
 config TERRAFORM_OCI_SUBNET_OCID
 	string "OCI Subnet OCID"
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 25/31] terraform/OCI: Use "output yaml" for the subnet_ocid setting
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (23 preceding siblings ...)
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 26/31] terraform/OCI: Add a default VCN cel
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Refactor:  Remove the line in terraform.Makefile that sets
"terraform_oci_subnet_ocid" and just pass it directly from
Kconfig via an "output yaml" directive.

As an additional clean up, update the help text.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 scripts/terraform.Makefile             |  4 ----
 terraform/oci/kconfigs/Kconfig.network | 11 ++++++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 99aadfc51fff..8b9bf984fc42 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -94,10 +94,6 @@ TERRAFORM_EXTRA_VARS += terraform_gce_image_name=$(subst ",,$(CONFIG_TERRAFORM_G
 TERRAFORM_EXTRA_VARS += terraform_gce_credentials=$(subst ",,$(CONFIG_TERRAFORM_GCE_JSON_CREDENTIALS_PATH))
 endif
 
-ifeq (y,$(CONFIG_TERRAFORM_OCI))
-TERRAFORM_EXTRA_VARS += terraform_oci_subnet_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_SUBNET_OCID))
-endif
-
 ifeq (y,$(CONFIG_TERRAFORM_OPENSTACK))
 TERRAFORM_EXTRA_VARS += terraform_openstack_cloud_name=$(subst ",,$(CONFIG_TERRAFORM_TERRAFORM_OPENSTACK_CLOUD_NAME))
 TERRAFORM_EXTRA_VARS += terraform_openstack_instance_prefix=$(subst ",,$(CONFIG_TERRAFORM_TERRAFORM_OPENSTACK_INSTANCE_PREFIX))
diff --git a/terraform/oci/kconfigs/Kconfig.network b/terraform/oci/kconfigs/Kconfig.network
index 9dc77a266eb4..22d1e5ad3062 100644
--- a/terraform/oci/kconfigs/Kconfig.network
+++ b/terraform/oci/kconfigs/Kconfig.network
@@ -9,7 +9,12 @@ config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
 
 config TERRAFORM_OCI_SUBNET_OCID
 	string "OCI Subnet OCID"
+	output yaml
 	help
-	  The OCI ID of the subnet.
-	  Read this:
-	  https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
+	  If there is a long-lived VNC and subnet already available
+	  to which to attach kdevops compute instances, specify the
+	  OCID of this subnet via this option.
+
+	  kdevops does not manage this resource. Before running
+	  "make bringup", the subnet must already exist and your OCI
+	  user must have permission to attach to it.
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 26/31] terraform/OCI: Add a default VCN
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (24 preceding siblings ...)
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 27/31] terraform/OCI: Add a Kconfig switch to create a VCN on the fly cel
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

The kdevops set-up for other cloud providers assumes that kdevops
will provision a VCN/subnet for use during test runs. OCI does not
have that option; it assumes that a long-lived subnet already
exists to which kdevops instances should be attached.

In a moment I will introduced a Kconfig option to use network
resources that kdevops manages instead of a pre-existing subnet.
This patch adds those resources, but does not yet use them, so that
the new network resource configuration can be reviewed easily.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/main.tf | 112 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index f6596a104c51..250c3b722537 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -51,3 +51,115 @@ module "volumes" {
   vol_volume_count        = var.oci_volumes_per_instance
   vol_volume_size         = var.oci_volumes_size
 }
+
+resource "oci_core_vcn" "kdevops_vcn" {
+  cidr_blocks = [
+    "10.0.0.0/16",
+  ]
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  display_name   = "kdevops VCN"
+  dns_label      = "kdevops"
+  is_ipv6enabled = false
+}
+
+resource "oci_core_internet_gateway" "kdevops_internet_gateway" {
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  display_name   = "kdevops internet gateway"
+  vcn_id         = oci_core_vcn.kdevops_vcn.id
+}
+
+resource "oci_core_dhcp_options" "kdevops_dhcp_options" {
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  display_name   = "kdevops dhcp options"
+  vcn_id         = oci_core_vcn.kdevops_vcn.id
+
+  options {
+    type        = "DomainNameServer"
+    server_type = "VcnLocalPlusInternet"
+  }
+  options {
+    type                = "SearchDomain"
+    search_domain_names = ["kdevops.oraclevcn.com"]
+  }
+}
+
+resource "oci_core_route_table" "kdevops_route_table" {
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  display_name   = "kdevops route table"
+  vcn_id         = oci_core_vcn.kdevops_vcn.id
+  route_rules {
+    destination       = "0.0.0.0/0"
+    destination_type  = "CIDR_BLOCK"
+    network_entity_id = oci_core_internet_gateway.kdevops_internet_gateway.id
+  }
+}
+
+resource "oci_core_security_list" "kdevops_security_list" {
+  compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  display_name   = "kdevops security list"
+  vcn_id         = oci_core_vcn.kdevops_vcn.id
+
+  egress_security_rules {
+    description      = "Allow all outbound traffic"
+    destination      = "0.0.0.0/0"
+    destination_type = "CIDR_BLOCK"
+    protocol         = "all"
+    stateless        = false
+  }
+
+  ingress_security_rules {
+    description = "Enable Path MTU Discovery to work"
+    icmp_options {
+      code = 4
+      type = 3
+    }
+    protocol    = 1
+    source      = "0.0.0.0/0"
+    source_type = "CIDR_BLOCK"
+    stateless   = false
+  }
+  ingress_security_rules {
+    description = "Allow applications within VCN to fail fast"
+    icmp_options {
+      type = 3
+    }
+    protocol    = 1
+    source      = "10.0.0.0/16"
+    source_type = "CIDR_BLOCK"
+    stateless   = false
+  }
+  ingress_security_rules {
+    description = "Enable instance management via Ansible"
+    protocol    = 6
+    source      = "0.0.0.0/0"
+    source_type = "CIDR_BLOCK"
+    stateless   = false
+    tcp_options {
+      min = 22
+      max = 22
+    }
+  }
+  ingress_security_rules {
+    description = "Allow VCN-local TCP traffic for ports: all"
+    protocol    = 6
+    source      = "10.0.0.0/16"
+    source_type = "CIDR_BLOCK"
+    stateless   = false
+    tcp_options {
+      min = 1
+      max = 65535
+    }
+  }
+}
+
+resource "oci_core_subnet" "kdevops_subnet" {
+  availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
+  cidr_block          = "10.0.0.0/24"
+  compartment_id      = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
+  dhcp_options_id     = oci_core_dhcp_options.kdevops_dhcp_options.id
+  dns_label           = "runners"
+  display_name        = "kdevops subnet"
+  route_table_id      = oci_core_route_table.kdevops_route_table.id
+  security_list_ids   = ["${oci_core_security_list.kdevops_security_list.id}"]
+  vcn_id              = oci_core_vcn.kdevops_vcn.id
+}
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 27/31] terraform/OCI: Add a Kconfig switch to create a VCN on the fly
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (25 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 26/31] terraform/OCI: Add a default VCN cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 28/31] terraform/OCI: Run "terraform fmt" on provider.tf cel
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Make it simpler to use OCI: create a kdevops VCN if there isn't
already a persistent VCN to use.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/gen_tfvars/defaults/main.yml  |  1 +
 .../templates/oci/terraform.tfvars.j2         |  3 ++
 terraform/oci/kconfigs/Kconfig.network        | 19 +++++++++++
 terraform/oci/main.tf                         | 32 +++++++++++++------
 terraform/oci/vars.tf                         |  6 ++++
 5 files changed, 51 insertions(+), 10 deletions(-)

diff --git a/playbooks/roles/gen_tfvars/defaults/main.yml b/playbooks/roles/gen_tfvars/defaults/main.yml
index b6caadcb7e0c..24b932974f36 100644
--- a/playbooks/roles/gen_tfvars/defaults/main.yml
+++ b/playbooks/roles/gen_tfvars/defaults/main.yml
@@ -49,6 +49,7 @@ terraform_gce_image_name: "invalid"
 terraform_gce_credentials: "invalid"
 
 terraform_oci_assign_public_ip: false
+terraform_oci_use_existing_vcn: false
 
 terraform_openstack_cloud_name: "invalid"
 terraform_openstack_instance_prefix: "invalid"
diff --git a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2 b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
index 192d72ff32a9..56402d13630b 100644
--- a/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
+++ b/playbooks/roles/gen_tfvars/templates/oci/terraform.tfvars.j2
@@ -14,7 +14,10 @@ oci_instance_flex_memory_in_gbs = {{ terraform_oci_instance_flex_memory_in_gbs }
 {% endif %}
 oci_os_image_ocid = "{{ terraform_oci_os_image_ocid }}"
 oci_assign_public_ip = {{ terraform_oci_assign_public_ip | lower }}
+oci_use_existing_vcn = {{ terraform_oci_use_existing_vcn | lower }}
+{% if terraform_oci_use_existing_vcn %}
 oci_subnet_ocid = "{{ terraform_oci_subnet_ocid }}"
+{% endif %}
 oci_volumes_per_instance = {{ terraform_oci_volumes_per_instance }}
 oci_volumes_size = {{ terraform_oci_volumes_size }}
 oci_data_volume_device_file_name = "{{ terraform_oci_data_volume_device_file_name }}"
diff --git a/terraform/oci/kconfigs/Kconfig.network b/terraform/oci/kconfigs/Kconfig.network
index 22d1e5ad3062..8130ca04de6d 100644
--- a/terraform/oci/kconfigs/Kconfig.network
+++ b/terraform/oci/kconfigs/Kconfig.network
@@ -7,6 +7,23 @@ config TERRAFORM_OCI_ASSIGN_PUBLIC_IP
 	  assigned to each instance. Leave it unset to prevent your
 	  instances from being accessible on the public internet.
 
+config TERRAFORM_OCI_USE_EXISTING_VCN
+	bool "Attach instances to an existing VCN"
+	output yaml
+	default y
+	help
+	  If your tenancy administrator prefers to create and secure
+	  the network resources used within a compartment, or your
+	  tenancy has special networking requirements, enable this
+	  option. Then enter the OCID of the existing subnet in the
+	  TERRAFORM_OCI_SUBNET_OCID option below. kdevops will join
+	  its compute instances to that subnet.
+
+	  Disable this option if you'd like kdevops to create a
+	  secure VPN and subnet automatically.
+
+if TERRAFORM_OCI_USE_EXISTING_VCN
+
 config TERRAFORM_OCI_SUBNET_OCID
 	string "OCI Subnet OCID"
 	output yaml
@@ -18,3 +35,5 @@ config TERRAFORM_OCI_SUBNET_OCID
 	  kdevops does not manage this resource. Before running
 	  "make bringup", the subnet must already exist and your OCI
 	  user must have permission to attach to it.
+
+endif # TERRAFORM_OCI_USE_EXISTING_VCN
diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index 250c3b722537..20aa7c5a612b 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -30,7 +30,7 @@ resource "oci_core_instance" "kdevops_instance" {
 
   create_vnic_details {
     assign_public_ip = var.oci_assign_public_ip
-    subnet_id = var.oci_subnet_ocid
+    subnet_id        = var.oci_use_existing_vcn ? var.oci_subnet_ocid : one(oci_core_subnet.kdevops_subnet[*].id)
   }
 
   metadata = {
@@ -53,6 +53,8 @@ module "volumes" {
 }
 
 resource "oci_core_vcn" "kdevops_vcn" {
+  count = var.oci_use_existing_vcn ? 0 : 1
+
   cidr_blocks = [
     "10.0.0.0/16",
   ]
@@ -63,15 +65,19 @@ resource "oci_core_vcn" "kdevops_vcn" {
 }
 
 resource "oci_core_internet_gateway" "kdevops_internet_gateway" {
+  count = var.oci_use_existing_vcn ? 0 : 1
+
   compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   display_name   = "kdevops internet gateway"
-  vcn_id         = oci_core_vcn.kdevops_vcn.id
+  vcn_id         = one(oci_core_vcn.kdevops_vcn[*].id)
 }
 
 resource "oci_core_dhcp_options" "kdevops_dhcp_options" {
+  count = var.oci_use_existing_vcn ? 0 : 1
+
   compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   display_name   = "kdevops dhcp options"
-  vcn_id         = oci_core_vcn.kdevops_vcn.id
+  vcn_id         = one(oci_core_vcn.kdevops_vcn[*].id)
 
   options {
     type        = "DomainNameServer"
@@ -84,20 +90,24 @@ resource "oci_core_dhcp_options" "kdevops_dhcp_options" {
 }
 
 resource "oci_core_route_table" "kdevops_route_table" {
+  count = var.oci_use_existing_vcn ? 0 : 1
+
   compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   display_name   = "kdevops route table"
-  vcn_id         = oci_core_vcn.kdevops_vcn.id
+  vcn_id         = one(oci_core_vcn.kdevops_vcn[*].id)
   route_rules {
     destination       = "0.0.0.0/0"
     destination_type  = "CIDR_BLOCK"
-    network_entity_id = oci_core_internet_gateway.kdevops_internet_gateway.id
+    network_entity_id = one(oci_core_internet_gateway.kdevops_internet_gateway[*].id)
   }
 }
 
 resource "oci_core_security_list" "kdevops_security_list" {
+  count = var.oci_use_existing_vcn ? 0 : 1
+
   compartment_id = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
   display_name   = "kdevops security list"
-  vcn_id         = oci_core_vcn.kdevops_vcn.id
+  vcn_id         = one(oci_core_vcn.kdevops_vcn[*].id)
 
   egress_security_rules {
     description      = "Allow all outbound traffic"
@@ -153,13 +163,15 @@ resource "oci_core_security_list" "kdevops_security_list" {
 }
 
 resource "oci_core_subnet" "kdevops_subnet" {
+  count = var.oci_use_existing_vcn ? 0 : 1
+
   availability_domain = data.oci_identity_availability_domain.kdevops_av_domain.name
   cidr_block          = "10.0.0.0/24"
   compartment_id      = data.oci_identity_compartments.kdevops_compartment.compartments[0].id
-  dhcp_options_id     = oci_core_dhcp_options.kdevops_dhcp_options.id
+  dhcp_options_id     = one(oci_core_dhcp_options.kdevops_dhcp_options[*].id)
   dns_label           = "runners"
   display_name        = "kdevops subnet"
-  route_table_id      = oci_core_route_table.kdevops_route_table.id
-  security_list_ids   = ["${oci_core_security_list.kdevops_security_list.id}"]
-  vcn_id              = oci_core_vcn.kdevops_vcn.id
+  route_table_id      = one(oci_core_route_table.kdevops_route_table[*].id)
+  security_list_ids   = ["${one(oci_core_security_list.kdevops_security_list[*].id)}"]
+  vcn_id              = one(oci_core_vcn.kdevops_vcn[*].id)
 }
diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index 7c19720bebc2..225ebdf51648 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -61,10 +61,16 @@ variable "oci_assign_public_ip" {
 }
 
 variable "oci_subnet_ocid" {
+  default     = null
   description = "Subnet OCID"
   type        = string
 }
 
+variable "oci_use_existing_vcn" {
+  description = "Use a pre-existing VCN"
+  type        = bool
+}
+
 variable "oci_volumes_per_instance" {
   description = "The count of additional block volumes per instance"
   type        = number
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 28/31] terraform/OCI: Run "terraform fmt" on provider.tf
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (26 preceding siblings ...)
  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 ` cel
  2025-04-01  0:59 ` [RFC PATCH 29/31] terraform/OCI: Run "terraform fmt" on main.tf cel
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

And alphabetize.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/provider.tf | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/terraform/oci/provider.tf b/terraform/oci/provider.tf
index 80361d3ac562..5bea98de7f4f 100644
--- a/terraform/oci/provider.tf
+++ b/terraform/oci/provider.tf
@@ -2,9 +2,9 @@ terraform {
 }
 
 provider "oci" {
-  tenancy_ocid			= var.oci_tenancy_ocid
-  user_ocid			= var.oci_user_ocid
-  private_key_path		= var.oci_user_private_key_path
-  fingerprint			= var.oci_user_fingerprint
-  region			= var.oci_region
+  fingerprint      = var.oci_user_fingerprint
+  private_key_path = var.oci_user_private_key_path
+  region           = var.oci_region
+  tenancy_ocid     = var.oci_tenancy_ocid
+  user_ocid        = var.oci_user_ocid
 }
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 29/31] terraform/OCI: Run "terraform fmt" on main.tf
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (27 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 28/31] terraform/OCI: Run "terraform fmt" on provider.tf cel
@ 2025-04-01  0:59 ` cel
  2025-04-01  0:59 ` [RFC PATCH 30/31] terraform/OCI: Nit: alphabetize vars.tf cel
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/main.tf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/terraform/oci/main.tf b/terraform/oci/main.tf
index 20aa7c5a612b..d231f2225e5d 100644
--- a/terraform/oci/main.tf
+++ b/terraform/oci/main.tf
@@ -19,10 +19,10 @@ resource "oci_core_instance" "kdevops_instance" {
   shape               = var.oci_shape
   shape_config {
     memory_in_gbs = var.oci_instance_flex_memory_in_gbs
-    ocpus = var.oci_instance_flex_ocpus
+    ocpus         = var.oci_instance_flex_ocpus
   }
   source_details {
-    source_id = var.oci_os_image_ocid
+    source_id   = var.oci_os_image_ocid
     source_type = "image"
   }
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 30/31] terraform/OCI: Nit: alphabetize vars.tf
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (28 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 29/31] terraform/OCI: Run "terraform fmt" on main.tf cel
@ 2025-04-01  0:59 ` 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
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  0:59 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

It's getting to be a large file. I find alphabetic order makes
it quicker to eyeball.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/oci/vars.tf | 96 +++++++++++++++++++++----------------------
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/terraform/oci/vars.tf b/terraform/oci/vars.tf
index 225ebdf51648..f2b7a6e69000 100644
--- a/terraform/oci/vars.tf
+++ b/terraform/oci/vars.tf
@@ -3,21 +3,69 @@ variable "oci_ad_number" {
   type        = number
 }
 
+variable "oci_assign_public_ip" {
+  description = "Assign public IP to the instance"
+  type        = bool
+}
+
 variable "oci_compartment_name" {
   description = "Name of compartment in which to create resources"
   type        = string
 }
 
+variable "oci_data_volume_device_file_name" {
+  description = "Data volume's device file name"
+  type        = string
+}
+
+variable "oci_instance_flex_memory_in_gbs" {
+  default     = null
+  description = "The total amount of memory available to the instance, in gigabytes."
+  type        = number
+}
+
+variable "oci_instance_flex_ocpus" {
+  default     = null
+  description = "The total number of OCPUs available to the instance."
+  type        = number
+}
+
+variable "oci_os_image_ocid" {
+  description = "OCID of OS image"
+  type        = string
+}
+
 variable "oci_region" {
   description = "An OCI region"
   type        = string
 }
 
+variable "oci_shape" {
+  description = "Shape name"
+  type        = string
+}
+
+variable "oci_sparse_volume_device_file_name" {
+  description = "Sparse volume's device file name"
+  type        = string
+}
+
+variable "oci_subnet_ocid" {
+  default     = null
+  description = "Subnet OCID"
+  type        = string
+}
+
 variable "oci_tenancy_ocid" {
   description = "OCID of your tenancy"
   type        = string
 }
 
+variable "oci_user_fingerprint" {
+  description = "Fingerprint for the key pair being used"
+  type        = string
+}
+
 variable "oci_user_ocid" {
   description = "OCID of the user calling the API"
   type        = string
@@ -28,44 +76,6 @@ variable "oci_user_private_key_path" {
   type        = string
 }
 
-variable "oci_user_fingerprint" {
-  description = "Fingerprint for the key pair being used"
-  type        = string
-}
-
-variable "oci_shape" {
-  description = "Shape name"
-  type        = string
-}
-
-variable "oci_instance_flex_ocpus" {
-  default     = null
-  description = "The total number of OCPUs available to the instance."
-  type        = number
-}
-
-variable "oci_instance_flex_memory_in_gbs" {
-  default     = null
-  description = "The total amount of memory available to the instance, in gigabytes."
-  type        = number
-}
-
-variable "oci_os_image_ocid" {
-  description = "OCID of OS image"
-  type        = string
-}
-
-variable "oci_assign_public_ip" {
-  description = "Assign public IP to the instance"
-  type        = bool
-}
-
-variable "oci_subnet_ocid" {
-  default     = null
-  description = "Subnet OCID"
-  type        = string
-}
-
 variable "oci_use_existing_vcn" {
   description = "Use a pre-existing VCN"
   type        = bool
@@ -80,13 +90,3 @@ variable "oci_volumes_size" {
   description = "The size of additional block volumes, in gibibytes"
   type        = number
 }
-
-variable "oci_data_volume_device_file_name" {
-  description = "Data volume's device file name"
-  type        = string
-}
-
-variable "oci_sparse_volume_device_file_name" {
-  description = "Sparse volume's device file name"
-  type        = string
-}
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [RFC PATCH 31/31] terraform/OCI: Update the OCI section of docs/kdevops-terraform.md
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (29 preceding siblings ...)
  2025-04-01  0:59 ` [RFC PATCH 30/31] terraform/OCI: Nit: alphabetize vars.tf cel
@ 2025-04-01  1:00 ` cel
  2025-04-02 19:21 ` [RFC PATCH 00/31] Simplify OCI configuration menu Luis Chamberlain
  31 siblings, 0 replies; 39+ messages in thread
From: cel @ 2025-04-01  1:00 UTC (permalink / raw)
  To: kdevops; +Cc: Chandan Babu R, Chuck Lever

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

Update documentation URLs, focus on the basics.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 docs/kdevops-terraform.md | 117 ++++++++++++--------------------------
 1 file changed, 35 insertions(+), 82 deletions(-)

diff --git a/docs/kdevops-terraform.md b/docs/kdevops-terraform.md
index 5e5107fef73e..34ac1a19eff1 100644
--- a/docs/kdevops-terraform.md
+++ b/docs/kdevops-terraform.md
@@ -298,86 +298,39 @@ https://www.terraform.io/docs/providers/google/index.html
 https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource
 
 ### OCI - Oracle Cloud Infrastructure
-OCI documentation is located at
-1. https://docs.oracle.com/en-us/iaas/Content/home.htm
-2. https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraform.htm
 
-The following is a list of OCI specific configuration variables that the user
-needs to provide values (through `make menuconfig` interface).
-  1. `CONFIG_TERRAFORM_SSH_CONFIG_USER`
-	 - User name used for the logging into the cloud instance.
-     - Please use,
-	   - `opc` for Oracle Linux.
-	   - `ubuntu` for Ubuntu Linux
-  2. `CONFIG_TERRAFORM_SSH_CONFIG_PUBKEY_FILE`
-     - Path to user's ssh public key (e.g. `~/.ssh/id_rsa.pub`).
-     - This key will be copied over to the cloud instance during its
-       creation.
-  3. `CONFIG_TERRAFORM_OCI_REGION`
-	 - String representing the name of the region (e.g. `us-ashburn-1`).
-     - https://docs.oracle.com/en-us/iaas/Content/anomaly/using/regions.htm
-     - List of the regions can be found at
-       https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm 
-  4. `CONFIG_TERRAFORM_OCI_TENANCY_OCID`
-	 - OCID of the tenancy being used.
-     - In order to obtain the OCID, Please refer to
-	   https://docs.oracle.com/en-us/iaas/Content/GSG/Tasks/contactingsupport_topic-Finding_Your_Tenancy_OCID_Oracle_Cloud_Identifier.htm 
-  5. `CONFIG_TERRAFORM_OCI_USER_OCID`
-	 - OCID of the user.
-     - In order to obtain the OCID, Please refer to
-       https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five
-  6. `CONFIG_TERRAFORM_OCI_USER_PRIVATE_KEY_PATH`
-	 - Path to API private key.
-	 - Documentation
-	   - Generating API keys.
-	     Refer to section `Generating an API Signing Key (Linux and Mac OS X)`
-	     at
-	     https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm
-	   - Uploading Public API key.
-	     Refer to section `How to Upload the Public Key` at
-	     https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm 
-       - Video: https://www.youtube.com/watch?v=LMvYOSkXF1k
-  7. `CONFIG_TERRAFORM_OCI_USER_FINGERPRINT`
-     - Finger print of the API key.
-  8. `CONFIG_TERRAFORM_OCI_AVAILABLITY_DOMAIN` ="VkEH:US-ASHBURN-AD-3"
-     - String specifying the availability domain to use in the region
-	 - Availability domain names can be obtained from the web page used to
-       launch an cloud instance.
-  9. `CONFIG_TERRAFORM_OCI_COMPARTMENT_OCID`
-	 - OCID of the compartment can be obtained by following the instructions
-	   at
-	   https://docs.oracle.com/en-us/iaas/Content/GSG/Tasks/contactingsupport_topic-Finding_the_OCID_of_a_Compartment.htm
-  10. `CONFIG_TERRAFORM_OCI_SHAPE`="VM.Standard.E2.8"
-      - String representing the name of the compute shape to create.
-      - https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm
-  11. `CONFIG_TERRAFORM_OCI_OS_IMAGE_OCID`
-	  - OCID of the OS image to be installed.
-      - Image's OCID can be obtained by following instructions at
-	    https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformbestpractices_topic-Referencing_Images.htm
-  12. `CONFIG_TERRAFORM_OCI_SUBNET_OCID`
-	  - OCID of the subnet to be assigned to the cloud instance.
-      - Overview:
-        https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/Overview_of_VCNs_and_Subnets.htm
-      - Instructions on how to get a list of available subnets can be found at
-        https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/get-subnet.htm 
-      - Click on the hamburger menu provided the right side of a subnet entry
-        and select `Copy OCID`.
-  13. `CONFIG_TERRAFORM_OCI_DATA_VOLUME_DISPLAY_NAME`
-	  - String representing the name for the `data` disk.
-      - This is used for storing sources and binaries corresponding to Linux
-        kernel, Fstests & Kdevops.
-  14. `CONFIG_TERRAFORM_OCI_DATA_VOLUME_DEVICE_FILE_NAME`
-      - Device node to be used for `data` disk.
-      - Please specify `/dev/oracleoci/oraclevdb` as the device file.
-  15. `CONFIG_TERRAFORM_OCI_SPARSE_VOLUME_DISPLAY_NAME`
-	  - String representing the name for the `sparse` disk.
-      - This is used for creating regular files to back loop devices.
-  16. `CONFIG_TERRAFORM_OCI_SPARSE_VOLUME_DEVICE_FILE_NAME`
-      - Device node to be used for `sparse` disk.
-      - Please specify `/dev/oracleoci/oraclevdc` as the device file.
-  17. `CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_OCPUS`
-      - Number of OCPUs for a flexiable compute shape.
-      - https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#flexible
-  18. `CONFIG_TERRAFORM_OCI_INSTANCE_FLEX_MEMORY_IN_GBS`
-      - Amount of RAM in GB for a flexiable compute shape.
-      - https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#flexible
+kdevops supports using the OCI Public Cloud (OCI).
+
+#### New To OCI?
+
+You can find a generic tutorial guide at the following link. You'll
+need many (but not all) of these steps to bring up kdevops with OCI.
+
+https://docs.oracle.com/en-us/iaas/Content/dev/terraform/tutorials/tf-provider.htm
+
+This explains what an "OCID" is:
+
+https://docs.oracle.com/en-us/iaas/Content/General/Concepts/identifiers.htm
+
+#### Quick Start
+
+To authenticate to the Oracle cloud, kdevops uses the API Key
+authentication method, described here:
+
+ https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm
+
+Copy these items into the Kconfig settings under the "Identity &
+Access" submenu. Additional guidance is available in the Kconfig
+help text in this menu.
+
+OCI pre-configures an admin ssh user on each instance. Under the
+CONFIG_TERRAFORM_SSH_CONFIG_USER option, you need to explicitly set
+kconfig's ssh login name depending on which OS image you have
+selected:
+
+   - `opc` for Oracle Linux.
+   - `ubuntu` for Ubuntu Linux
+
+If your Ansible controller (where you run "make bringup") and your
+test instances operate inside the same subnet, you can disable the
+TERRAFORM_OCI_ASSIGN_PUBLIC_IP option for better network security.
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  2025-04-01  0:59 [RFC PATCH 00/31] Simplify OCI configuration menu cel
                   ` (30 preceding siblings ...)
  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 ` Luis Chamberlain
  2025-04-02 19:24   ` Luis Chamberlain
  2025-04-02 19:38   ` Chuck Lever
  31 siblings, 2 replies; 39+ messages in thread
From: Luis Chamberlain @ 2025-04-02 19:21 UTC (permalink / raw)
  To: cel; +Cc: kdevops, Chandan Babu R, Chuck Lever

On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> I've come up with some simplifications that can apply to all of
> the providers, but I'd like to start with OCI because 

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

>  26 files changed, 1472 insertions(+), 556 deletions(-)

That's huge, for all this! I know AWS supports a simple .aws/credentials
and I think OCI might too support something similar. If so that might beg
the question if eventually we should transition to just that to help
simplify things on bring up even further. That should enable users to quickly
"fly" on enablement.
                                                                                
Other than that, any chance you might be up to add yourself as the
cloud / terraform maintainer under MAINTAINERS ?

  Luis

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  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
  1 sibling, 0 replies; 39+ messages in thread
From: Luis Chamberlain @ 2025-04-02 19:24 UTC (permalink / raw)
  To: cel; +Cc: kdevops, Chandan Babu R, Chuck Lever

On Wed, Apr 02, 2025 at 12:21:06PM -0700, Luis Chamberlain wrote:
> On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
> > From: Chuck Lever <chuck.lever@oracle.com>
> > I've come up with some simplifications that can apply to all of
> > the providers, but I'd like to start with OCI because 
> 
> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
> 
> >  26 files changed, 1472 insertions(+), 556 deletions(-)
> 
> That's huge, for all this!

I meant:  thanks for all this!

  Luis

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  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
  1 sibling, 1 reply; 39+ messages in thread
From: Chuck Lever @ 2025-04-02 19:38 UTC (permalink / raw)
  To: Luis Chamberlain, cel; +Cc: kdevops, Chandan Babu R

On 4/2/25 3:21 PM, Luis Chamberlain wrote:
> On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>> I've come up with some simplifications that can apply to all of
>> the providers, but I'd like to start with OCI because 
> 
> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

Thanks for taking a look!

I guess my basic concern here is that I'm changing the name of some
Kconfig variables, which would break backwards compatibility.

If you and Chandan feel that is not a roadblock, then I will start
committing these and the similar patches I have for the other three
major providers.


>>  26 files changed, 1472 insertions(+), 556 deletions(-)
> 
> That's huge, for all this! I know AWS supports a simple .aws/credentials
> and I think OCI might too support something similar. If so that might beg
> the question if eventually we should transition to just that to help
> simplify things on bring up even further. That should enable users to quickly
> "fly" on enablement.

The varying way that the providers handle authentication is one of
the triggers that started me down this road. I would like something
that is easy to bring up and matches the authentication that each
provider's CLI tool does.

I'm still on the fence about whether keeping the secrets in the
kdevops .config or in environment variables or in a ~/.{aws,oci,azure}
profile is the better approach. I was thinking of enabling all these
possibilities and let users choose which one suits their security
requirements...

The values of environment variables, I will note, are leaked into the
Buildbot log. The best answer might therefore be ~/.oci/profile etc.


> Other than that, any chance you might be up to add yourself as the
> cloud / terraform maintainer under MAINTAINERS ?

I can do that.

I promise I will hang out for a beer next time we meet f2f!


-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  2025-04-02 19:38   ` Chuck Lever
@ 2025-04-02 20:08     ` Luis Chamberlain
  2025-04-08 12:42       ` Chandan Babu R
  0 siblings, 1 reply; 39+ messages in thread
From: Luis Chamberlain @ 2025-04-02 20:08 UTC (permalink / raw)
  To: Chuck Lever; +Cc: cel, kdevops, Chandan Babu R

On Wed, Apr 02, 2025 at 03:38:04PM -0400, Chuck Lever wrote:
> On 4/2/25 3:21 PM, Luis Chamberlain wrote:
> > On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
> >> From: Chuck Lever <chuck.lever@oracle.com>
> >> I've come up with some simplifications that can apply to all of
> >> the providers, but I'd like to start with OCI because 
> > 
> > Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
> 
> Thanks for taking a look!
> 
> I guess my basic concern here is that I'm changing the name of some
> Kconfig variables, which would break backwards compatibility.

I've addressed concerns like that befored by adding a respective kconfig
value and mapping the old one to the new shiny one with an XXX to
annotate we should remove the older one later. But if for cloud I
suspect most users might stick to that version of kdevops and have no
need to upgrade too, and so I am not sure if its needed as much as
the guest / virtualization use case.

> If you and Chandan feel that is not a roadblock, then I will start
> committing these and the similar patches I have for the other three
> major providers.

My use cases of cloud are all completely ephemeral and stuck to one
version of kdevops in particular because of the cost, and so I am
careful to always 'make destroy' as soon as I'm done otheriwse you
can economically bleed. And so I think economics drives kdevops
cloud instances to be super ephemeral.

So for *me*, I say go for it.

But I am not sure if other folks are using kdevops for the cloud
in other ways, but certainly Chandan would have good sensing on that.

> The varying way that the providers handle authentication is one of
> the triggers that started me down this road. I would like something
> that is easy to bring up and matches the authentication that each
> provider's CLI tool does.

Definitely.

> I'm still on the fence about whether keeping the secrets in the
> kdevops .config

Secrets don't have to be part of an output .config, they should not.
The reasin being that we want to support using cloud for CI too and
in doing so we don't want any secrets leaked out on .config as we
automatically upload to kdevops-results-archive the .config used
so to enable reproducible CI builds / testing. If you look at
kdevops-results-archive the .configs are never sensitive to the
environment or host. Its just generic info.

We support some secrets for enterprise releases like SUSE, but I forget
what was done for RHEL. At least for SUSE the expectations is that you
fill in a yaml optional secret file readin for extra vars. Even if we
had a new "output private_yaml" that kconfig symbol would still be part
of .config, and so if we wantd to add a "output private_yaml" we'd have
to negate the entry being put on .config but not sure if that may mess
with Kconfig's dep mechanisms.

> or in environment variables or in a ~/.{aws,oci,azure}

The nice thing about ~/.{aws,oci,azure} is its out of the way and
we just infer you have it, we never have any of that added to .config.

> profile is the better approach. I was thinking of enabling all these
> possibilities and let users choose which one suits their security
> requirements...

Makes sense. We know AWS supports it, OCI I have heard does too, but
not sure about azure.

> The values of environment variables, I will note, are leaked into the
> Buildbot log.

Oh no.

> The best answer might therefore be ~/.oci/profile etc.

I think that's a clean simple solution to the problem, if we can
support it.

> > Other than that, any chance you might be up to add yourself as the
> > cloud / terraform maintainer under MAINTAINERS ?
> 
> I can do that.
> 
> I promise I will hang out for a beer next time we meet f2f!

Great!

  Luis

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  2025-04-02 20:08     ` Luis Chamberlain
@ 2025-04-08 12:42       ` Chandan Babu R
  2025-04-08 13:20         ` Chuck Lever
  0 siblings, 1 reply; 39+ messages in thread
From: Chandan Babu R @ 2025-04-08 12:42 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: Chuck Lever, cel, kdevops

On Wed, Apr 02, 2025 at 01:08:34 PM -0700, Luis Chamberlain wrote:
> On Wed, Apr 02, 2025 at 03:38:04PM -0400, Chuck Lever wrote:
>> On 4/2/25 3:21 PM, Luis Chamberlain wrote:
>> > On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
>> >> From: Chuck Lever <chuck.lever@oracle.com>
>> >> I've come up with some simplifications that can apply to all of
>> >> the providers, but I'd like to start with OCI because 
>> > 
>> > Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
>> 
>> Thanks for taking a look!
>> 
>> I guess my basic concern here is that I'm changing the name of some
>> Kconfig variables, which would break backwards compatibility.
>
> I've addressed concerns like that befored by adding a respective kconfig
> value and mapping the old one to the new shiny one with an XXX to
> annotate we should remove the older one later. But if for cloud I
> suspect most users might stick to that version of kdevops and have no
> need to upgrade too, and so I am not sure if its needed as much as
> the guest / virtualization use case.
>
>> If you and Chandan feel that is not a roadblock, then I will start
>> committing these and the similar patches I have for the other three
>> major providers.
>
> My use cases of cloud are all completely ephemeral and stuck to one
> version of kdevops in particular because of the cost, and so I am
> careful to always 'make destroy' as soon as I'm done otheriwse you
> can economically bleed. And so I think economics drives kdevops
> cloud instances to be super ephemeral.
>
> So for *me*, I say go for it.
>
> But I am not sure if other folks are using kdevops for the cloud
> in other ways, but certainly Chandan would have good sensing on that.
>

The changes made by the patchset definitely improve the usability of OCI via
kdevops. Thanks for working on this.

Reviewed-by: Chandan Babu R <chandanbabu@kernel.org>

Also, Can you please include the VM.Standard.x86.Generic shape in the list of
shapes introduced by "[RFC PATCH 16/31] terraform/OCI: Add a shape selector
for Flex shapes" patch. This shape is recommended for developers from my
department who do not require a specific model of CPU for their work.

-- 
Chandan

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  2025-04-08 12:42       ` Chandan Babu R
@ 2025-04-08 13:20         ` Chuck Lever
  2025-04-09  4:04           ` Chandan Babu R
  0 siblings, 1 reply; 39+ messages in thread
From: Chuck Lever @ 2025-04-08 13:20 UTC (permalink / raw)
  To: Chandan Babu R, Luis Chamberlain; +Cc: cel, kdevops

On 4/8/25 8:42 AM, Chandan Babu R wrote:
> On Wed, Apr 02, 2025 at 01:08:34 PM -0700, Luis Chamberlain wrote:
>> On Wed, Apr 02, 2025 at 03:38:04PM -0400, Chuck Lever wrote:
>>> On 4/2/25 3:21 PM, Luis Chamberlain wrote:
>>>> On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
>>>>> From: Chuck Lever <chuck.lever@oracle.com>
>>>>> I've come up with some simplifications that can apply to all of
>>>>> the providers, but I'd like to start with OCI because 
>>>>
>>>> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
>>>
>>> Thanks for taking a look!
>>>
>>> I guess my basic concern here is that I'm changing the name of some
>>> Kconfig variables, which would break backwards compatibility.
>>
>> I've addressed concerns like that befored by adding a respective kconfig
>> value and mapping the old one to the new shiny one with an XXX to
>> annotate we should remove the older one later. But if for cloud I
>> suspect most users might stick to that version of kdevops and have no
>> need to upgrade too, and so I am not sure if its needed as much as
>> the guest / virtualization use case.
>>
>>> If you and Chandan feel that is not a roadblock, then I will start
>>> committing these and the similar patches I have for the other three
>>> major providers.
>>
>> My use cases of cloud are all completely ephemeral and stuck to one
>> version of kdevops in particular because of the cost, and so I am
>> careful to always 'make destroy' as soon as I'm done otheriwse you
>> can economically bleed. And so I think economics drives kdevops
>> cloud instances to be super ephemeral.
>>
>> So for *me*, I say go for it.
>>
>> But I am not sure if other folks are using kdevops for the cloud
>> in other ways, but certainly Chandan would have good sensing on that.
>>
> 
> The changes made by the patchset definitely improve the usability of OCI via
> kdevops. Thanks for working on this.
> 
> Reviewed-by: Chandan Babu R <chandanbabu@kernel.org>

Thanks for your review!


> Also, Can you please include the VM.Standard.x86.Generic shape in the list of
> shapes introduced by "[RFC PATCH 16/31] terraform/OCI: Add a shape selector
> for Flex shapes" patch. This shape is recommended for developers from my
> department who do not require a specific model of CPU for their work.

Yes, I can do that. An alternative would be to retain the ability to
enter an arbitrary string here (and maybe for image selection).


-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [RFC PATCH 00/31] Simplify OCI configuration menu
  2025-04-08 13:20         ` Chuck Lever
@ 2025-04-09  4:04           ` Chandan Babu R
  0 siblings, 0 replies; 39+ messages in thread
From: Chandan Babu R @ 2025-04-09  4:04 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Luis Chamberlain, cel, kdevops

On Tue, Apr 08, 2025 at 09:20:30 AM -0400, Chuck Lever wrote:
> On 4/8/25 8:42 AM, Chandan Babu R wrote:
>> On Wed, Apr 02, 2025 at 01:08:34 PM -0700, Luis Chamberlain wrote:
>>> On Wed, Apr 02, 2025 at 03:38:04PM -0400, Chuck Lever wrote:
>>>> On 4/2/25 3:21 PM, Luis Chamberlain wrote:
>>>>> On Mon, Mar 31, 2025 at 08:59:29PM -0400, cel@kernel.org wrote:
>>>>>> From: Chuck Lever <chuck.lever@oracle.com>
>>>>>> I've come up with some simplifications that can apply to all of
>>>>>> the providers, but I'd like to start with OCI because 
>>>>>
>>>>> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
>>>>
>>>> Thanks for taking a look!
>>>>
>>>> I guess my basic concern here is that I'm changing the name of some
>>>> Kconfig variables, which would break backwards compatibility.
>>>
>>> I've addressed concerns like that befored by adding a respective kconfig
>>> value and mapping the old one to the new shiny one with an XXX to
>>> annotate we should remove the older one later. But if for cloud I
>>> suspect most users might stick to that version of kdevops and have no
>>> need to upgrade too, and so I am not sure if its needed as much as
>>> the guest / virtualization use case.
>>>
>>>> If you and Chandan feel that is not a roadblock, then I will start
>>>> committing these and the similar patches I have for the other three
>>>> major providers.
>>>
>>> My use cases of cloud are all completely ephemeral and stuck to one
>>> version of kdevops in particular because of the cost, and so I am
>>> careful to always 'make destroy' as soon as I'm done otheriwse you
>>> can economically bleed. And so I think economics drives kdevops
>>> cloud instances to be super ephemeral.
>>>
>>> So for *me*, I say go for it.
>>>
>>> But I am not sure if other folks are using kdevops for the cloud
>>> in other ways, but certainly Chandan would have good sensing on that.
>>>
>> 
>> The changes made by the patchset definitely improve the usability of OCI via
>> kdevops. Thanks for working on this.
>> 
>> Reviewed-by: Chandan Babu R <chandanbabu@kernel.org>
>
> Thanks for your review!
>
>
>> Also, Can you please include the VM.Standard.x86.Generic shape in the list of
>> shapes introduced by "[RFC PATCH 16/31] terraform/OCI: Add a shape selector
>> for Flex shapes" patch. This shape is recommended for developers from my
>> department who do not require a specific model of CPU for their work.
>
> Yes, I can do that. An alternative would be to retain the ability to
> enter an arbitrary string here (and maybe for image selection).

Yes, That would be very helpful. Thanks!

-- 
Chandan

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2025-04-09  4:05 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [RFC PATCH 16/31] terraform/OCI: Add a shape selector for Flex shapes cel
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox