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 0b9a801
Browse filesBrowse the repository at this point in the historyBrowse files
fix(vm-disk): name the importer error in the disk's WorkloadsReady message
A disk whose HTTP source answers 404 or does not resolve never leaves
ImportInProgress: CDI fails an import only on a fatal error and restarts
the importer pod otherwise, so the condition only ever said the disk was
still importing. The reason it will not finish was visible only in the
importer logs and on the DataVolume, whose Running condition carries the
error through the back-off between restarts.
Appending that message lets the user see why the disk is stuck from the
application status and the console, which already shows the
WorkloadsReady message for a disk.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <[email protected]>
// Running conditions CDI v1.64 wrote for importers that kept failing; only
1665
+
// the host name is changed. v1.66 builds the condition the same way for a
1666
+
// single-container importer.
1667
+
const (
1668
+
http404="Unable to connect to http data source: expected status code 200, got 404. Status: 404 Not Found"
1669
+
noHost=`Unable to connect to http data source: HTTP request errored: Get "http://image.example.invalid/disk.img": dial tcp: lookup image.example.invalid on 10.96.0.10:53: no such host`
1670
+
)
1671
+
cases:= []struct {
1672
+
namestring
1673
+
phase*string
1674
+
status, reason, messagestring
1675
+
wantstring
1676
+
}{
1677
+
{"404 from the source", phase("ImportInProgress"), "False", "Error", http404,
1678
+
"DataVolume vm-disk-test is ImportInProgress: "+http404},
Copy file name to clipboardExpand all lines: packages/apps/vm-disk/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ A Virtual Machine Disk
4
4
5
5
> `storageClass` and `source` are annotated as immutable in the chart schema — see [`docs/storage-immutability.md`](../../../docs/storage-immutability.md) for the contract and which consumers enforce it. `DataVolume.spec` is immutable in CDI, so the chart also fails the release on an attempted `storageClass`/`source` edit of an existing disk rather than silently reusing the old spec; delete and recreate the disk to change either field.
6
6
7
-
> Whether CDI has finished populating the disk shows up in the `WorkloadsReady` condition, not in `Ready`, which follows the Helm release and does not wait on the DataVolume: `WorkloadsReady` stays `False` while an import, clone or upload is in flight and when the DataVolume fails. Its message names the DataVolume and the phase it is in, `kubectl get vmdisks` shows the condition in the `WORKLOADS` column, and the console badge reads `DataVolumeNotReady` until it is `True`. A disk created before this behaviour was introduced keeps its old release settings, under which `Ready` may wait on the DataVolume, until its application is next updated. A `source.upload` disk reads `False` from the moment it is created until `virtctl image-upload` completes, because CDI reports waiting for the upload and receiving it as one phase. A disk counts as ready while it waits for its consumer with `bindImmediately` off on a `WaitForFirstConsumer` class, because that is a state such a disk is supposed to rest in.
7
+
> Whether CDI has finished populating the disk shows up in the `WorkloadsReady` condition, not in `Ready`, which follows the Helm release and does not wait on the DataVolume: `WorkloadsReady` stays `False` while an import, clone or upload is in flight and when the DataVolume fails. Its message names the DataVolume and the phase it is in, followed by the error CDI reports for the pod populating the disk when there is one, such as a 404 or an unresolvable host on an HTTP source: CDI keeps retrying such an import, so its phase stays `ImportInProgress`, and the error is shown between retries rather than while a retry is running. `kubectl get vmdisks` shows the condition in the `WORKLOADS` column, and the console badge reads `DataVolumeNotReady` until it is `True`. A disk created before this behaviour was introduced keeps its old release settings, under which `Ready` may wait on the DataVolume, until its application is next updated. A `source.upload` disk reads `False` from the moment it is created until `virtctl image-upload` completes, because CDI reports waiting for the upload and receiving it as one phase. A disk counts as ready while it waits for its consumer with `bindImmediately` off on a `WaitForFirstConsumer` class, because that is a state such a disk is supposed to rest in.
8
8
9
9
> `bindImmediately` is on by default, so a disk's volume is provisioned when the disk is created rather than deferred to the first consumer. That default exists because a VMDisk is a standalone object with a lifecycle of its own: on a `WaitForFirstConsumer` StorageClass a disk that no VM has attached yet would otherwise never populate at all. It costs something on a node-pinned class such as `local`, where the CDI worker pod becomes the first consumer and the volume lands where that pod was scheduled rather than where the VM will run, so a VM whose placement is constrained (a `nodeSelector`, a resource request only one node satisfies, or the Windows affinity applied by `_cluster.scheduling.dedicatedNodesForWindowsVMs`) can stay unschedulable against a node-affinity conflict, and `storageClass` is immutable so the only exit is deleting and recreating the disk. Turn `bindImmediately` off for a disk a VMInstance will consume on such a class: KubeVirt then renders a temporary launcher pod carrying the VM's own affinity and node selector, and the volume binds where the VM can actually run. The chart default `replicated` binds `Immediate` regardless, so neither setting changes anything there.
0 commit comments