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 B074B26D4E2 for ; Tue, 2 Sep 2025 20:19:56 +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=1756844396; cv=none; b=aurbGzNM9GcghWLdetPvBSZsDyfiM8nSSqD63JSP6hYSZdhnKmKKM4JbhilDQ1BUHRhtmOJ53lKetyMREjPYiz1i+OgtPifkVWCX4x8vDHJIWldHWj+U+LilXSQGJnkuZ5DSWIxNfHpdUqrKy0HN04AoP+rRopJBOWYuyh33FpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756844396; c=relaxed/simple; bh=8xLaUt3PcYjGXSP2GQuncAEzXUQIg99yMNlk161TC1M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U2F56RB1dROSE1OsOeZiR7ffGo6kQTgTpFl8FcRHh1TBO734QRvc3jTJ40szIQY9FrLFUIk8l0gaPMBbaior6hrPWY76MLXTmkZ0laMF/dX+0CgWlQGSdoCxgxtoIxW8k5M5+8CBC0bGbPfl9pE/fd8mm53prRkjHaXzt2rWkcg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C+tsHgiK; 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="C+tsHgiK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91B9DC4CEED; Tue, 2 Sep 2025 20:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756844396; bh=8xLaUt3PcYjGXSP2GQuncAEzXUQIg99yMNlk161TC1M=; h=Date:Reply-To:Subject:To:Cc:References:From:In-Reply-To:From; b=C+tsHgiKSjywiR8zE1mQV2aFmNuHr8tIGjKQqE91exKslr22+5vdkBd5OGGDOWcPa 6lGpmAf8OdA5e8IEOX/FWf+yx3AfdKUGYECwqzSY/cw5oecinQAy4cupplA/pCCQKx x3ogmTL0DyfT6zPhesnvwHDkk3g/AGbjHa9JO2bEqIVZ0Clnr7utapOjjX5V8QW9Qo pfP9fpmsnvldVvQVsbc9Y9KxZc+6S/GsovUFNmyyyYKbNXwl5dNeuWXxwqF5KlUbM9 17RVlS9dli5Mb2asDcCkW/7SbHwcJeJ6dCSZy0Z+wgTvcQV6amEBVMt6shZXDZZLI6 aJPZqJfSMJeHA== Message-ID: <6fd30a08-3808-4cac-88dc-e879c9f484d9@kernel.org> Date: Tue, 2 Sep 2025 22:19:54 +0200 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: Daniel Gomez Subject: Re: [PATCH v2 29/37] guestfs: Configure how many extra drives to provision To: Chuck Lever , kdevops@lists.linux.dev Cc: Chuck Lever References: <20250902135426.815079-1-cel@kernel.org> <20250902135426.815079-30-cel@kernel.org> Content-Language: en-US From: Daniel Gomez Organization: kernel.org In-Reply-To: <20250902135426.815079-30-cel@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 02/09/2025 15.54, Chuck Lever wrote: > 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 This should allow workflows to specify the nr of drives needed, right? Looks great optimization, thanks! Reviewed-by: Daniel Gomez > --- > 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 I see we are defaulting to what we had. So it's up to the user or defconfig to leverage this. > + 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. Curious, any reason to have a menu/choice instead of int? > + > +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 >