You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f3e4f10
Browse filesBrowse the repository at this point in the historyBrowse files
feat(vm-instance): allow attaching a disk to a running VM
A disk added to `disks` of an existing VMInstance never reaches the running
guest. KubeVirt classifies the change as non-live-updatable, sets
`RestartRequired` on the VirtualMachine, and the volume only appears after the
guest is restarted. A blank disk is worse: its PVC binds on
`WaitForFirstConsumer`, and the only consumer that could bind it is the VMI
that is not getting the volume.
KubeVirt supports this declaratively behind the `DeclarativeHotplugVolumes`
feature gate (Alpha since v1.6.0, Beta in v1.9.0), and requires the volume to
carry `hotpluggable: true`. The chart cannot express it: `disks[]` exposes only
`name` and `bus`, so no consumer of the aggregated API can ask for a
hot-attach. This adds an optional `disks[].hotpluggable` that renders it.
The bus is not free here. `ValidateHotplugDiskConfiguration` in
pkg/storage/admitters/storagehotplug.go refuses a hotplugged disk whose bus is
neither `scsi` nor `virtio`, and nothing defaults an empty bus before that
admitter runs - every hotplug test upstream passes an explicit bus. The
template therefore fails early, naming the disk, rather than letting the VM
patch be rejected later: a rejection at that point leaves the HelmRelease in
UpgradeFailed, and a stuck release keeps every subsequent change from reaching
the machine, a restart included. `bootOrder` needs no change, the same
admitter only requires it to be greater than zero.
Rendering is unchanged when `hotpluggable` is unset. Generated files are
updated accordingly, and unit tests cover the rendered field, its absence,
both accepted buses and the two refusals.
The field is inert until the cluster enables `DeclarativeHotplugVolumes`. That
gate is documented as incompatible with the deprecated `HotplugVolumes` one -
"if both are declared, HotplugVolumes will have precedence" - so the
deprecated gate has to be removed, not merely complemented.
Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Loïc Fontaine <[email protected]>
|`external`| Enable external access from outside the cluster. |`bool`|`false`|
42
-
|`externalMethod`| Method to pass through traffic to the VM. |`string`|`PortList`|
43
-
|`externalPorts`| Ports to forward from outside the cluster. |`[]int`|`[22]`|
44
-
|`externalAllowICMP`| Whether to accept ICMP traffic to the VM in PortList mode (preserves ping and PMTU discovery). No effect in WholeIP mode. Default true so ping behaves as users expect even when port filtering is in effect. |`bool`|`true`|
45
-
|`runStrategy`| Requested running state of the VirtualMachineInstance |`string`|`Always`|
|`gpus`| List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM). |`[]object`|`[]`|
56
-
|`gpus[i].name`| The name of the GPU resource to attach. |`string`|`""`|
57
-
|`cpuModel`| Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map|`string`|`""`|
58
-
|`resources`| Resource configuration for the virtual machine. |`object`|`{}`|
59
-
|`resources.cpu`| Number of CPU cores allocated. |`quantity`|`""`|
60
-
|`resources.memory`| Amount of memory allocated. |`quantity`|`""`|
61
-
|`resources.sockets`| Number of CPU sockets (vCPU topology). |`quantity`|`""`|
62
-
|`sshKeys`| List of SSH public keys for authentication. |`[]string`|`[]`|
63
-
|`cloudInit`| Cloud-init user data. |`string`|`""`|
64
-
|`cloudInitSeed`| Seed string to generate SMBIOS UUID for the VM. |`string`|`""`|
|`external`| Enable external access from outside the cluster. |`bool`|`false`|
42
+
|`externalMethod`| Method to pass through traffic to the VM. |`string`|`PortList`|
43
+
|`externalPorts`| Ports to forward from outside the cluster. |`[]int`|`[22]`|
44
+
|`externalAllowICMP`| Whether to accept ICMP traffic to the VM in PortList mode (preserves ping and PMTU discovery). No effect in WholeIP mode. Default true so ping behaves as users expect even when port filtering is in effect. |`bool`|`true`|
45
+
|`runStrategy`| Requested running state of the VirtualMachineInstance |`string`|`Always`|
|`disks`| List of disks to attach. |`[]object`|`[]`|
49
+
|`disks[i].name`| Disk name. |`string`|`""`|
50
+
|`disks[i].bus`| Disk bus type (e.g. "sata"). |`string`|`""`|
51
+
|`disks[i].hotpluggable`| Allow attaching and detaching the disk while the VM is running. Requires the DeclarativeHotplugVolumes feature gate on the cluster, and bus to be "scsi" or "virtio". |`bool`|`false`|
52
+
|`networks`| Networks to attach the VM to. |`[]object`|`[]`|
|`gpus`| List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM). |`[]object`|`[]`|
57
+
|`gpus[i].name`| The name of the GPU resource to attach. |`string`|`""`|
58
+
|`cpuModel`| Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map|`string`|`""`|
59
+
|`resources`| Resource configuration for the virtual machine. |`object`|`{}`|
60
+
|`resources.cpu`| Number of CPU cores allocated. |`quantity`|`""`|
61
+
|`resources.memory`| Amount of memory allocated. |`quantity`|`""`|
62
+
|`resources.sockets`| Number of CPU sockets (vCPU topology). |`quantity`|`""`|
63
+
|`sshKeys`| List of SSH public keys for authentication. |`[]string`|`[]`|
64
+
|`cloudInit`| Cloud-init user data. |`string`|`""`|
65
+
|`cloudInitSeed`| Seed string to generate SMBIOS UUID for the VM. |`string`|`""`|
Copy file name to clipboardExpand all lines: packages/apps/vm-instance/values.schema.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,10 @@
73
73
"description": "Disk bus type (e.g. \"sata\").",
74
74
"type": "string"
75
75
},
76
+
"hotpluggable": {
77
+
"description": "Allow attaching and detaching the disk while the VM is running. Requires the DeclarativeHotplugVolumes feature gate on the cluster, and bus to be \"scsi\" or \"virtio\".",
Copy file name to clipboardExpand all lines: packages/apps/vm-instance/values.yaml
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
## @field {string} name - Disk name.
11
11
## @x-cozystack-options {source: vmdisk}
12
12
## @field {string} [bus] - Disk bus type (e.g. "sata").
13
+
## @field {bool} [hotpluggable] - Allow attaching and detaching the disk while the VM is running. Requires the DeclarativeHotplugVolumes feature gate on the cluster, and bus to be "scsi" or "virtio".
13
14
14
15
## @typedef {struct} Network - Network to attach the VM to.
0 commit comments