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 ECA3B22F74F for ; Thu, 4 Sep 2025 15:15: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=1756998944; cv=none; b=FUn1dqn0GjXJrVmxnimYqbu+t9993/ybsQSM5vn/bY6/MF50D7Zka7FaRIUCWFoxC2QWobSwXmrB0Cpen88nuBAIrEL6AuKV5B6yoUgZy8Eyf7iCwAdlH+5BSzekB/aLbw/snQqbWeqUUZfqr+enbBx01/ZAm04z7JgRnxz2NBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756998944; c=relaxed/simple; bh=/n2qHptefd24lvNFoJizxgRIfAZkL0Ozgq3VKH3Af98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AKhROZC/m0ZRbPK5NoGJA3BdT03Yz6sF6nVrngm6hPXdOeW7laXurxhEb51bV3TL8QNGF/27CsUxyeCyHDQcBmLJSYim1G3+/vNH7YA0PgEG+nBHmruq2f3XMUmvucuZWLfIlwt9JJKMufAZQX+2xxa3ccP21Na1eA6d6xDQmZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iZcHf/wU; 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="iZcHf/wU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F88C4CEF1; Thu, 4 Sep 2025 15:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756998943; bh=/n2qHptefd24lvNFoJizxgRIfAZkL0Ozgq3VKH3Af98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZcHf/wU46E9LTe98oZaOBpXoHax3Us8JNtDc/eerIL4QJKY8n8ZJBgXJfw6HCPrf oE60P78mBy0zII3nM16MRZzugG6Q+V566tSemgxG0B4d85kOsL4w1/gIsEmQGpKwgj H93A5fDay/autbxfG9bHapc1/OjUXFQv91SyRbhgBvrmy472dxCDvOIVS7Bd3ltECs B/64BTrTcuWqay/Bm7OBqVwuqQ2ccSe+PHi/nw4Xpwa2BhSuOcv+YpWAyJzgV9Lx4n FfcqsyUCoMRRHM/7pY7gpFuGsRI6mTuVuSNZGq+EFH+7nlWXn2bKGNjOqnGgEpxmSk BgQqLQYl+kDqA== From: Chuck Lever To: Cc: Chuck Lever , Luis Chamberlain , Daniel Gomez Subject: [PATCH v3 28/36] guestfs: Configure how many extra drives to provision Date: Thu, 4 Sep 2025 11:15:16 -0400 Message-ID: <20250904151526.1596282-29-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250904151526.1596282-1-cel@kernel.org> References: <20250904151526.1596282-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. Reviewed-by: Luis Chamberlain Reviewed-by: Daniel Gomez 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