From: Chuck Lever <cel@kernel.org>
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>,
Luis Chamberlain <mcgrof@kernel.org>,
Daniel Gomez <da.gomez@samsung.com>
Subject: [PATCH v3 28/36] guestfs: Configure how many extra drives to provision
Date: Thu, 4 Sep 2025 11:15:16 -0400 [thread overview]
Message-ID: <20250904151526.1596282-29-cel@kernel.org> (raw)
In-Reply-To: <20250904151526.1596282-1-cel@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
Some workflows create several guests but use only one or two extra
storage drives per guest. Enable configurations that reduce the
amount of storage allocated per guest to conserve local persistent
storage space on the host.
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
kconfigs/Kconfig.libvirt | 45 +++++++++++++++++++
.../roles/gen_nodes/templates/gen_drives.j2 | 8 ++--
.../roles/guestfs/tasks/bringup/main.yml | 2 +-
3 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/kconfigs/Kconfig.libvirt b/kconfigs/Kconfig.libvirt
index 7fe231668229..961276ccc1b1 100644
--- a/kconfigs/Kconfig.libvirt
+++ b/kconfigs/Kconfig.libvirt
@@ -556,6 +556,51 @@ config LIBVIRT_HOST_PASSTHROUGH
--pre 'make -s mrproper defconfig' \
\-- make -s -j$(nproc) bzImage
+choice
+ prompt "Libvirt extra storage drive count"
+ default LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_4
+ help
+ This option selects the number of extra storage drives to
+ provision for each libvirt guest. Reduce this number to
+ conserve local host storage capacity, if your workflows do
+ not use all the extra drives.
+
+config LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_0
+ bool "0"
+ help
+ Provision no extra storage drives per guest.
+
+config LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_1
+ bool "1"
+ help
+ Provision one extra storage drive per guest.
+
+config LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_2
+ bool "2"
+ help
+ Provision two extra storage drives per guest.
+
+config LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_3
+ bool "3"
+ help
+ Provision three extra storage drives per guest.
+
+config LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_4
+ bool "4"
+ help
+ Provision four extra storages drive per guest.
+
+endchoice
+
+config LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT
+ int
+ output yaml
+ default 0 if LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_0
+ default 1 if LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_1
+ default 2 if LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_2
+ default 3 if LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_3
+ default 4 if LIBVIRT_EXTRA_STORAGE_DRIVE_COUNT_4
+
choice
prompt "Libvirt extra storage driver to use"
default LIBVIRT_EXTRA_STORAGE_DRIVE_VIRTIO
diff --git a/playbooks/roles/gen_nodes/templates/gen_drives.j2 b/playbooks/roles/gen_nodes/templates/gen_drives.j2
index 2de13da4ab8e..1040c0e19d84 100644
--- a/playbooks/roles/gen_nodes/templates/gen_drives.j2
+++ b/playbooks/roles/gen_nodes/templates/gen_drives.j2
@@ -1,6 +1,6 @@
{% import './templates/drives.j2' as drives %}
{% if libvirt_extra_storage_drive_ide %}
-{{ drives.gen_drive_ide(4,
+{{ drives.gen_drive_ide(libvirt_extra_storage_drive_count,
kdevops_storage_pool_path,
hostname,
libvirt_extra_drive_format,
@@ -18,7 +18,7 @@
libvirt_extra_storage_aio_cache_mode,
kdevops_storage_pool_path) }}
{% else %}
-{{ drives.gen_drive_virtio(4,
+{{ drives.gen_drive_virtio(libvirt_extra_storage_drive_count,
kdevops_storage_pool_path,
hostname,
libvirt_extra_drive_format,
@@ -28,7 +28,7 @@
libvirt_extra_storage_virtio_physical_block_size) }}
{% endif %}
{% elif libvirt_extra_storage_drive_scsi %}
-{{ drives.gen_drive_scsi(4,
+{{ drives.gen_drive_scsi(libvirt_extra_storage_drive_count,
kdevops_storage_pool_path,
hostname,
libvirt_extra_drive_format,
@@ -46,7 +46,7 @@
libvirt_extra_storage_aio_cache_mode,
kdevops_storage_pool_path) }}
{% else %}
-{{ drives.gen_drive_nvme(4,
+{{ drives.gen_drive_nvme(libvirt_extra_storage_drive_count,
kdevops_storage_pool_path,
hostname,
libvirt_extra_drive_format,
diff --git a/playbooks/roles/guestfs/tasks/bringup/main.yml b/playbooks/roles/guestfs/tasks/bringup/main.yml
index bd9f52603a3b..3fd677ff4659 100644
--- a/playbooks/roles/guestfs/tasks/bringup/main.yml
+++ b/playbooks/roles/guestfs/tasks/bringup/main.yml
@@ -102,7 +102,7 @@
path: "{{ storagedir }}/{{ inventory_hostname }}/extra{{ item }}.{{ libvirt_extra_drive_format }}"
ansible.builtin.include_tasks:
file: "{{ role_path }}/tasks/bringup/extra-disks.yml"
- loop: "{{ range(0, 4) | list }}"
+ loop: "{{ range(0, libvirt_extra_storage_drive_count) | list }}"
when:
- not libvirt_enable_largeio|bool
--
2.51.0
next prev parent reply other threads:[~2025-09-04 15:15 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 15:14 [PATCH v3 00/36] Various fixes Chuck Lever
2025-09-04 15:14 ` [PATCH v3 01/36] scripts: Update gen_ssh_key.sh Chuck Lever
2025-09-04 15:14 ` [PATCH v3 02/36] terraform/azure: Fix count of managed disks Chuck Lever
2025-09-04 15:14 ` [PATCH v3 03/36] terraform/azure: Remove tags from terraform configuration Chuck Lever
2025-09-04 15:14 ` [PATCH v3 04/36] terraform/azure: Enable network acceleration Chuck Lever
2025-09-04 15:14 ` [PATCH v3 05/36] terraform/azure: Make the resource group name a variable Chuck Lever
2025-09-04 15:14 ` [PATCH v3 06/36] terraform/azure: Remove the provider version constraint Chuck Lever
2025-09-04 15:14 ` [PATCH v3 07/36] terraform/azure: Update the RHEL publishers Chuck Lever
2025-09-04 15:14 ` [PATCH v3 08/36] terraform/oci: Work around oracle/oci provider bug Chuck Lever
2025-09-04 15:14 ` [PATCH v3 09/36] terraform/oci: Add Kconfig choices for disk performance provisioning Chuck Lever
2025-09-04 15:14 ` [PATCH v3 10/36] terraform/oci: Enable preemptible compute instances Chuck Lever
2025-09-04 15:14 ` [PATCH v3 11/36] terraform/aws: Fix zone selection for us_west1 Chuck Lever
2025-09-04 15:15 ` [PATCH v3 12/36] Revert "terraform/aws: Add Oracle Linux AMI selections" Chuck Lever
2025-09-04 15:15 ` [PATCH v3 13/36] terraform/aws: Remove unused terraform tags Chuck Lever
2025-09-04 15:15 ` [PATCH v3 14/36] terraform/GCE: Fix the default disk throughput values Chuck Lever
2025-09-04 15:15 ` [PATCH v3 15/36] terraform/gce: Remove unused tags Chuck Lever
2025-09-04 15:15 ` [PATCH v3 16/36] terraform/gce: Remove support for Fedora Chuck Lever
2025-09-04 15:15 ` [PATCH v3 17/36] terraform/gce: Update existing machine types and introduce new ones Chuck Lever
2025-09-04 15:15 ` [PATCH v3 18/36] terraform: Create the user's .ssh/config if it does not already exist Chuck Lever
2025-09-04 15:15 ` [PATCH v3 19/36] pynfs: Don't install xdrlib3 on older RHEL Chuck Lever
2025-09-04 15:15 ` [PATCH v3 20/36] guestfs: Update the guestfs playbook description Chuck Lever
2025-09-04 15:15 ` [PATCH v3 21/36] gen_hosts: Add 'localhost' to the [all] group Chuck Lever
2025-09-04 15:15 ` [PATCH v3 22/36] guestfs: Don't run the 'destroy' tags on the controller Chuck Lever
2025-09-04 15:15 ` [PATCH v3 23/36] base_image: Skip "locales-all" package installation Chuck Lever
2025-09-04 15:15 ` [PATCH v3 24/36] update_etc_hosts: ipaddr Chuck Lever
2025-09-04 15:15 ` [PATCH v3 25/36] Add an Ansible requirements.yml file Chuck Lever
2025-09-04 15:15 ` [PATCH v3 26/36] terraform/oci: Clean up the route table resource Chuck Lever
2025-09-04 15:15 ` [PATCH v3 27/36] guestfs: Correct the spelling of "drives" Chuck Lever
2025-09-04 15:15 ` Chuck Lever [this message]
2025-09-04 15:15 ` [PATCH v3 29/36] ltp: Replace /opt with a symlink to data partition Chuck Lever
2025-09-04 15:15 ` [PATCH v3 30/36] terraform: Squelch Ansible complaints about missing inventory file Chuck Lever
2025-09-04 15:15 ` [PATCH v3 31/36] terraform: Skip localhost when waiting for targets to reboot Chuck Lever
2025-09-04 15:15 ` [PATCH v3 32/36] devconfig: include the "service" group in the playbooks hosts list Chuck Lever
2025-09-05 10:25 ` Daniel Gomez
2025-09-04 15:15 ` [PATCH v3 33/36] Makefile: Remove CONFIG_TOPDIR_PATH_HAS_SHA256SUM Chuck Lever
2025-09-04 15:15 ` [PATCH v3 34/36] Makefile: Set TOPDIR_PATH and generate its sha256sum at run time Chuck Lever
2025-09-04 15:15 ` [PATCH v3 35/36] ansible.cfg: generate an ansible.cfg file in TOPDIR Chuck Lever
2025-09-04 15:15 ` [PATCH v3 36/36] inventory: generate the inventory pathname dynamically Chuck Lever
2025-09-05 13:21 ` Daniel Gomez
2025-09-04 17:16 ` [PATCH v3 00/36] Various fixes Luis Chamberlain
2025-09-05 13:06 ` Daniel Gomez
2025-09-05 16:37 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250904151526.1596282-29-cel@kernel.org \
--to=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=da.gomez@samsung.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox