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 AB9962DBF6E for ; Tue, 2 Sep 2025 13:54:43 +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=1756821283; cv=none; b=uEMLr2KAmQuICvKjMZgr0bFuwjmDVPcsTRAib88d2g4xH7v36L2uZkTI1yiLIlxYbXde7cLSwCjxfz9SytAjq1p5GOtX/IzTIn5m3DAkTj4wNaOufg5uvvejP2kPXGKTij1erI5L/1IgxqdlDPoTnp0sAjqUuW6xA5gqceWuWwY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756821283; c=relaxed/simple; bh=tEyWd09Qp8JYQ++OPu0KuefRJlgEEJ6nhoH8nIzOzuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gPDLALiRCIcTyNeQLjKbblBrJuM8mFLyacnfzXu8bcY73ZYL9Zo2Q+uWbPRNNTauSPwj25yiZEhoAZlbO9ExOvKpkzAaGEvNYl4vkJVwpRlyl8gUdkizvtheTzs7ZuhLyj1qG/JY9CsWm9WtI18mrLbtXIHp/F8MJ8s+vFPf4Rk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tReDKSI4; 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="tReDKSI4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A5F0C4CEED; Tue, 2 Sep 2025 13:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756821283; bh=tEyWd09Qp8JYQ++OPu0KuefRJlgEEJ6nhoH8nIzOzuw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tReDKSI4cs+auS1HZ7/Ivr/T/1fhSsl3uxDozmYwUn/C55zx065LQxhN8fdal9DEJ pEmkxn8lPWrLpFONkKXZkAxeionYAzVfHuRqmUlunlGrylLF7Ft8h1Y6dNpBnMJsbj dQJEc698F4j9qHW0QTbNrumuA+rgHk7oajDRL2hQdKOSQyWBmaPmI5jg2dTcu7zEJj 83Jfe93OPraIsSaUT6NTJHL8Cztl0mfDY+igoFz2JlvFvOWBk/Mernu46KXq9Bxynv QaCe2h9CVPHr+e62JBeerk1XrMFOtW1FpLGRHPmox/VJAacQg7iga5w8k/pT8XDuLg Gi1/Q6Fm5oGwg== From: Chuck Lever To: Cc: Chuck Lever Subject: [PATCH v2 29/37] guestfs: Configure how many extra drives to provision Date: Tue, 2 Sep 2025 09:54:16 -0400 Message-ID: <20250902135426.815079-30-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250902135426.815079-1-cel@kernel.org> References: <20250902135426.815079-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 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. Signed-off-by: Chuck Lever --- 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