From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8A722E3371 for ; Tue, 1 Apr 2025 01:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743469221; cv=none; b=bcoH08R4XsrCdt2xwwrakFhaP/7nzIBez0URRYIff44++mM9siBTZZ9dfEmD+lizujZzTvjY16whuipddzNy5oK6wdM5Q7NFYuczgDhLqpXxyYlHa24RqhycW/JLovtb9hLeMfyYumanleZ5UywZ/mIEc9lutBKfjJAb5EDG5D8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743469221; c=relaxed/simple; bh=EcEoeoK/yJ9Dc2CIS1+esSM72oZx6GCwjtlkiubFls4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eVDocZh7a2PXgLLDndDqY86Q5hH5W4qGO7gMfQoGDufL2ULnaWglrQSXu/GfCTcsk0AGbl9+t7AsVu0L+yBIakx02HxxyNwkYLcFVwDjJdipiJG/0SLacYxYijlzk+iUit9wFlKuxKT1wx8QSOoUAgWuhr/Ug9IHgXYgx2mOZ+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XlkC1ZrT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XlkC1ZrT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4AD0C4CEEA; Tue, 1 Apr 2025 01:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743469221; bh=EcEoeoK/yJ9Dc2CIS1+esSM72oZx6GCwjtlkiubFls4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlkC1ZrTqoQ3VUB00mMYpAizCu3q2bTvw7Gf4PGOvo5FjT2ILA5Q08hqDGYFBqSSD ozjMuzzxAnsIppN+nQNQbxasQ4Plii6l9DcpOqfjx12rggF/3Naryzi8JCrZk/ihGd KcnK3mqrZa8/zPwavW3q9M88pKFZh4Zc4GwuJn8lQewSmsOHPOxmr04y23+cWYBMck VrJkxO34vJCgOys3j2KhPzfFt7EvGmEFz1GJ+RNvwOLVM/VAwB1nkeQHNW4FURTXCE xgVO1zp2R2O/EY7gzwIT5v+Gb5yTgOSNl4lEeFoOcsAB1LvtEUboVaDrrUaJBwG3MT P7PWaTTNe5VQg== From: cel@kernel.org To: Cc: Chandan Babu R , Chuck Lever Subject: [RFC PATCH 23/31] terraform/OCI: Remove TERRAFORM_OCI_VOLUMES_ENABLE_EXTRA Date: Mon, 31 Mar 2025 20:59:52 -0400 Message-ID: <20250401010000.764234-24-cel@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250401010000.764234-1-cel@kernel.org> References: <20250401010000.764234-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever 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 --- .../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