mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-13 01:26:06 +08:00
feat: expose KubeVirt high-performance storage features in VM and Volume UI (#1133)
* feat: expose KubeVirt high-performance storage features in VM and Volume UI
Adds UI to configure KubeVirt high-performance disk/storage settings that
were previously only reachable via VMBuilder/Terraform:
- Per-volume "Storage Performance Options": a performance profile
(Default / High Performance / Custom) exposing per-disk cache, io and
dedicatedIOThread on all disk types (VM image/root, new, existing,
container) and on the standalone Volume form.
- VM-wide "High Performance (I/O Threads and Multi-Queue)": blockMultiQueue
and ioThreadsPolicy (+ supplemental-pool thread count), shown only in the
VM section since these are domain-level and cannot be set per-PVC.
- Compatibility guardrails: io=native forces cache=none; cache=none on
Filesystem volumeMode warns; blockMultiQueue requires a virtio disk.
Ref: harvester/harvester#11550
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
* fix: address review feedback on high-performance storage UI
Resolves the Copilot review comments on #1133:
- Gate the whole feature behind a new `highPerformanceStorage` release
feature flag (v1.9.0) so older supported clusters never render the
controls or receive unsupported KubeVirt fields.
- Force Cache Mode to "none" whenever Native I/O is selected, including
from the "Default" ('') cache value, and disable every non-"none" cache
option (Default included) while Native is active. Previously the empty
cache value slipped past the guardrail and produced an invalid combo.
- Clear an already-enabled blockMultiQueue when the last virtio disk is
removed, so a disabled checkbox can no longer persist an invalid setting.
- Strip stale cache/io/dedicatedIOThread fields from the merged disk spec
when a regenerated disk no longer requests them, so switching a disk back
to "Default" (or unchecking Dedicated I/O Thread) while editing no longer
silently preserves the previous values.
- Expose the disclosure toggle's state to assistive tech via aria-expanded
and an expand/collapse aria-label.
- Add unit tests for the profile transitions and the Native/cache guardrails.
Ref: harvester/harvester#11550
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
* fix: address second-round review on high-performance storage UI
Resolves the two Copilot findings on #1133 and votdev's UX feedback on
harvester/harvester#11550:
- Restore the disk's original bus when the performance profile goes back
to "Default". The "High Performance" preset switches the bus to virtio,
but leaving the preset only cleared cache/io/dedicatedIOThread, so a
SATA/SCSI disk was silently left on virtio — a bus change that can make
an existing guest unbootable. The pre-preset bus is now remembered and
put back, unless the user picked a different bus themselves in the
meantime.
- Pass the VM-wide performance values from the VM detail page to the
shared Volume component. The mixin already parsed them via
getInitConfig(), but the detail caller never forwarded them, so
VMPerformanceOptions fell back to its prop defaults and hid itself in
view mode — configured blockMultiQueue / ioThreadsPolicy settings were
invisible. They are also refreshed in the value watcher so the panel
does not go stale.
- Make the VM-wide "High Performance" panel expandable/collapsible,
matching the per-volume "Storage Performance Options" disclosure. It
stays collapsed unless the VM already has something configured, so the
average user is not faced with specialist tuning controls by default.
- Fix the unit tests to use Vue Test Utils v2 mount options. They used
the v1 top-level `mocks` key, which VTU 2.x ignores, so every case
failed on mount. The repo has no jest config or test script, so this
was not caught. Add coverage for the bus save/restore behaviour.
Ref: harvester/harvester#11550
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
---------
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 528255dea4)
# Conflicts:
# pkg/harvester/mixins/harvester-vm/index.js
This commit is contained in:
committed by
Mergify
parent
fb190996b6
commit
d0bda99f00
@@ -800,6 +800,56 @@ harvester:
|
||||
setFirst: Set as root volume
|
||||
saveVolume: Update Volume
|
||||
encryption: Encryption
|
||||
performance:
|
||||
title: Storage Performance Options
|
||||
expand: Show high-performance options
|
||||
collapse: Hide high-performance options
|
||||
profile:
|
||||
label: Performance Profile
|
||||
tip: "\"High Performance\" applies a tuned preset (no host cache, native AIO, a dedicated I/O thread on the virtio bus). Choose \"Custom\" to set each option yourself."
|
||||
default: Default (Balanced)
|
||||
highPerformance: High Performance
|
||||
custom: Custom
|
||||
highProfileTip: This disk will use the virtio bus with host cache disabled, native AIO and a dedicated I/O thread.
|
||||
cacheMode:
|
||||
label: Cache Mode
|
||||
tip: "How the host caches disk I/O. \"None\" (host cache disabled) is best for high-throughput guests on block storage; \"WriteBack\" favours performance; \"WriteThrough\" favours durability."
|
||||
default: Default (hypervisor)
|
||||
none: None (no host cache)
|
||||
writeback: WriteBack
|
||||
writethrough: WriteThrough
|
||||
filesystemWarning: "\"None\" (O_DIRECT) requires storage that supports direct I/O. It is recommended only for Block volume mode; on Filesystem volumes the VM may fail to start."
|
||||
ioMode:
|
||||
label: I/O Mode
|
||||
tip: "How QEMU submits I/O. \"Native\" (Linux AIO) offers the lowest overhead but requires host cache set to \"None\"; \"Threads\" uses a host thread pool."
|
||||
default: Default (hypervisor)
|
||||
native: Native (AIO)
|
||||
threads: Threads
|
||||
nativeRequiresNoCacheTip: Native I/O mode requires cache mode "None"; it has been set for you.
|
||||
dedicatedIOThread:
|
||||
label: Dedicated I/O Thread
|
||||
tip: Allocate an exclusive libvirt I/O thread to this disk instead of sharing one. Useful for disks with heavy I/O. Enabling this on any disk turns on the VM's I/O threads policy.
|
||||
busTip: High-performance features work best on the virtio bus.
|
||||
diskPerformance:
|
||||
title: High Performance (I/O Threads and Multi-Queue)
|
||||
description: These settings apply to all volumes in the Virtual Machine and complement the per-volume options above.
|
||||
expand: Show VM-wide high-performance options
|
||||
collapse: Hide VM-wide high-performance options
|
||||
blockMultiQueue:
|
||||
label: Virtio Block Multi-Queue
|
||||
tip: Map disk I/O to multiple queues so it is processed across multiple CPUs. Applies to virtio disks and requires a fixed CPU allocation (Harvester always sets one).
|
||||
noVirtioTip: Add at least one disk on the virtio bus to enable Block Multi-Queue.
|
||||
ioThreadsPolicy:
|
||||
label: I/O Threads Policy
|
||||
tip: "How libvirt allocates I/O threads. \"Shared\" uses one thread for all disks; \"Auto\" pools threads round-robin (up to ~2x vCPUs); \"Supplemental Pool\" lets you pick a fixed thread count and adds matching CPUs to the pod."
|
||||
default: "Disabled (default)"
|
||||
shared: Shared
|
||||
auto: Auto
|
||||
supplementalPool: Supplemental Pool
|
||||
autoEnabledTip: A disk requests a dedicated I/O thread, so the policy is enabled (defaults to "Shared").
|
||||
ioThreadCount:
|
||||
label: I/O Thread Count
|
||||
tip: Number of I/O threads for the supplemental pool. 4-8 is a common range depending on workload.
|
||||
shareable:
|
||||
label: Shareable
|
||||
tip: Allow multiple virtual machines to attach and write to this volume simultaneously.
|
||||
@@ -997,6 +1047,8 @@ harvester:
|
||||
createWithDataVolumeTooltip: Create Volume with Kubevirt/Containerized Data Importer way. It can fill accessMode/volumeMode automatically.
|
||||
showAdvanced: Show Advanced Options
|
||||
hideAdvanced: Hide Advanced Options
|
||||
performance:
|
||||
pvcTip: These high-performance options are saved as defaults on the volume and applied when it is attached to a virtual machine as a disk.
|
||||
source: Source
|
||||
kind: Kind
|
||||
sourceOptions:
|
||||
|
||||
Reference in New Issue
Block a user