Commit Graph
10 Commits
Author SHA1 Message Date
Alejandro BonillaandClaude Opus 5.5 39ed41e527 feat: move OS type, CPU model and system options to the VM Basics tab (#1179)
* 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>
2026-10-22 22:38:16 +08:00
Alejandro BonillaandVolker Theile e013534373 feat: allow Cloud Config for Windows guests (Cloudbase-Init) (#984)
* feat(vm): allow Cloud Config for Windows guests

Currently the Cloud Config editor is completely hidden when a VM's
OS Type is set to Windows, and no `cloudinitdisk` volume or secret
is written to the VM spec even if the user has entered content.

This blocks a common Windows-on-Harvester workflow: using
Cloudbase-Init to run first-boot configuration (install VMDP,
enable OpenSSH server, add authorized_keys, join a domain, run
`runcmd` steps, etc.). Users on Windows today have to hand-edit the
VM YAML after creation to attach a cloudinitdisk, which is fragile
and undiscoverable.

Changes:
- Remove the `v-if="!isWindows"` on the CloudConfig component so
  the editor is available for every OS type. The Sysprep editor
  continues to render only for Windows, so Windows now gets both
  panels; Linux is unchanged.
- Drop the `if (!this.isWindows)` guard around the cloudinitdisk
  volume serialization so the disk is attached whenever the user
  provided user-data or network-data, regardless of OS.
- Drop the `|| this.isWindows` early-return in `saveSecret` so the
  cloud-init secret is persisted for Windows VMs too.
- `getInitUserData` now returns a bare `#cloud-config\n` header for
  Windows instead of the Linux qemu-guest-agent runcmd template
  (which would fail on Cloudbase-Init). VMDP installs the QGA on
  Windows as a native service, so the runcmd path is not needed.

The "Install guest agent" checkbox stays disabled for Windows
because it specifically drives the Linux QGA-via-runcmd recipe.

Fixes point 2 of harvester/harvester#11124.

Signed-off-by: Alejandro Bonilla <abonilla@suse.com>

* fix(vm): do not clear cloud-config on isWindows watcher fire

The isWindows watcher runs on every change of the isWindows computed
property, including on mount when editing an existing Windows VM. Setting
this['userScript'] and this['networkScript'] to undefined at that point
wipes the cloud-config data that was just loaded from the existing VM's
cloudinit secret, so the Advanced -> Cloud Config editor shows empty
even though the VM has data on the wire.

Remove the two clears - Cloud Config is now supported for Windows guests
by this PR, so there is no reason to unset the user/network scripts when
the OS type is Windows. sshKey and installAgent remain gated (SSH keys
are injected via cloud-init on Linux only, and the qemu-guest-agent
package install checkbox does not apply to Windows).

Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
Co-authored-by: Volker Theile <vtheile@suse.com>

* refactor(vm): Get CloudInit working for VM templates

- Remove unnecessary osType watcher in cloud config. The watcher (see `pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue`) that cleared the cloud config template for Windows VMs is no longer necessary.
- Automatically strip the CloudInit `User Data` properties `package_update` and `packages` for OS type `Windows`.

Signed-off-by: Volker Theile <vtheile@suse.com>

---------

Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
Signed-off-by: Volker Theile <vtheile@suse.com>
Co-authored-by: Volker Theile <vtheile@suse.com>
2026-07-28 11:32:30 +02:00
Siva Kanakala 140a85f6a8 fix: Fix VM Template UserData editor remaining editable in view-mode (#951)
Signed-off-by: Siva Kanakala <siva.kanakala@suse.com>
2026-07-01 11:21:26 +08:00
Andy Lee 63c4810b99 Reset network / user script when choosing ostype from windows to linux (#292)
* reset network / user script when choosing windows

Signed-off-by: Andy Lee <andy.lee@suse.com>

* change OS type from Windows init user and network data

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
2025-05-14 14:15:39 +08:00
Francesco Torchia 4626d56acd Lint fixes
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-11-12 11:50:20 +01:00
Cody Jackson 20584d293a Updated all the components to use emits to remove the warnings from the console. 2024-10-23 17:01:04 +02:00
Cody Jackson d761b88ba0 Fixing more of the v-model usages that were referencing props
These were noticed when attempting to use `yarn build-pkg harvester`
2024-10-23 17:00:56 +02:00
Francesco Torchia aba9c167e0 Vue3 migration - vue-migration.js launch + shell compatibility fixes
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-10-23 17:00:51 +02:00
Francesco Torchia ea12a81174 Vue migration - remove Vuew.set & this.$set; add vue-migrate script
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-10-23 17:00:48 +02:00
Francesco Torchia 4f2688f6ab Add pkg/harvester components + shell portings - 1
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-10-23 17:00:46 +02:00