* fix(vm): block VM creation with invalid CloudInit YAML content
* fix(vm): add isWindows guard to validateCloudInit in template version
* fix: validate Windows CloudInit YAML on save
Co-authored-by: a110605 <5744158+a110605@users.noreply.github.com>
* fix: validate cloud-init by format in the VM mixin
Cloud-init picks the user data format from the first line, so scripts,
MIME messages and Jinja templates are valid without being YAML. Parsing
all user data blocked them, and it stopped any existing VM holding one
from being saved, even with nothing changed.
Only parse user data that starts with #cloud-config, and require a
mapping for it and for network data, because plain words are valid YAML
and were still saved.
Both forms already use the VM mixin, so the check moves there and shares
the header pattern with hasCloudConfigComment.
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
* fix: save other user data formats as typed and check text without a header
The form added #cloud-config to any user data that parses as YAML, so a
script was saved with the header and its lines folded together, and Edit
Config then failed the check on it. User data that starts with a script,
MIME or another cloud-init or Cloudbase-Init format is now saved as typed,
and any other text is checked as cloud-config, with or without the header,
because the form adds the header when saving it.
Editing only checks cloud-init that changed, so a VM saved before this
change can still be edited with the cloud-init it already has.
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
---------
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: a110605 <5744158+a110605@users.noreply.github.com>
Co-authored-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
(cherry picked from commit aa6d11a840)
* feat: move OS type, CPU model and system options to the VM Basics tab
OS Type, CPU Model and the CPU/system checkboxes (CPU pinning, USB
tablet, TPM, EFI, Secure Boot and their persistent-state options) are
core machine settings, but they were buried at the bottom of Advanced
Options. Show them on the Basics tab, next to CPU and memory.
Install Guest Agent stays in Advanced Options because it changes the
cloud config. It now sits right below the User Data editor (the data it
modifies) through a new optional slot in the Cloud Config component.
Only the placement changes; behaviour and validation are untouched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
* feat: follow the review on the VM Basics layout
- Basics now reads OS Type and CPU Model, then CPU and memory, then the
system checkboxes, the CPU Manager banner and the SSH key, in the order
proposed in review. The checkboxes sit in one wrapper; USB Tablet drops
its extra mt-20 and uses the plain `check` class like the others.
- Advanced Options puts Maintenance Strategy on the same row as Run
Strategy; Reserved Memory moves to its own row.
- The moved labels leave harvester.virtualMachine.advancedOptions: TPM,
EFI, Secure Boot and the persistent-state labels are now under
harvester.virtualMachine.systemOptions (also used by the template
version editor), and the CPU Manager banner text is under
harvester.virtualMachine.cpuPinning.cpuManager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
* feat: match the VM template form and address review on the VM Basics layout
The VM template form still had OS Type, CPU Model and the CPU/system
checkboxes under Advanced Options, so creating a VM and creating a
template put them in different places. Use the same layout as the VM
form:
- Basics: OS Type and CPU Model, then CPU and memory, then the CPU
Pinning, USB Tablet, TPM, EFI and Secure Boot checkboxes (plus the
persistent-state options when they apply), then the SSH key.
- Advanced Options: Run Strategy and Maintenance Strategy on one row,
Reserved Memory on its own row, then Show more and Cloud Config.
Install Guest Agent sits right below the User Data editor through the
after-user-data slot.
Review follow-ups on both forms:
- OS Type shows an info icon in create mode warning that selecting an
image with an OS label on the Volumes tab may change the OS Type
selection, now that OS Type comes before the volumes.
- The CPU Manager banner under CPU Pinning is info in create mode, where
it only explains why the checkbox is disabled, and stays a warning in
edit mode, where it is about the restart.
Only placement and presentation change; behaviour and validation are
untouched.
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
---------
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Add an "Enable network boot (PXE)" option to bridge network interfaces and
a VM-level choice to place network boot devices before or after volumes.
The form now owns interface boot order: enabled NICs get sequential boot
orders ahead of or behind the volumes, and a stale bootOrder is no longer
inherited from the old spec.
This also fixes editing a VM whose interface bootOrder was set in YAML
(the documented workaround): the form used to renumber disks from 1 while
keeping the NIC's bootOrder, producing a duplicate that KubeVirt rejects.
The boot order shown on the VM, snapshot and backup detail pages now
includes network interfaces.
Related: harvester/harvester#3325
Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* 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>
* feat: add filesystem tab
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add filesystem tab in create VM page
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: update some wordings
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add support for filesystem feature flag and enable filesystem tab
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: remove unneeded wordings
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add support for filesystem feature flag and update icon button positioning
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: based on copilot review
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: remove wrong feature flag
Signed-off-by: Andy Lee <andy.lee@suse.com>
* fix: vm template
Signed-off-by: Andy Lee <andy.lee@suse.com>
---------
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add filesystem tab
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add filesystem tab in create VM page
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: update some wordings
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add support for filesystem feature flag and enable filesystem tab
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: remove unneeded wordings
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add support for filesystem feature flag and update icon button positioning
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: based on copilot review
Signed-off-by: Andy Lee <andy.lee@suse.com>
* refactor: tab name
Signed-off-by: Andy Lee <andy.lee@suse.com>
---------
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add maxCPU and maxMemory
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add hotplug dialog
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add restart message
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: let VM template support cpuMemoryHotplug
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add feature flag
Signed-off-by: Andy Lee <andy.lee@suse.com>
* feat: add max-hotplug-ratio setting
Signed-off-by: Andy Lee <andy.lee@suse.com>
---------
Signed-off-by: Andy Lee <andy.lee@suse.com>
* fix error banner can't be dismissed
Signed-off-by: Andy Lee <andy.lee@suse.com>
* update all CruResource
Signed-off-by: Andy Lee <andy.lee@suse.com>
---------
Signed-off-by: Andy Lee <andy.lee@suse.com>