From 33f7000671181922ce84e1c2e1108620af9d8c02 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Tue, 26 May 2026 12:18:09 +0300 Subject: [PATCH 01/15] e2e Signed-off-by: Valeriy Khorunzhin --- api/core/v1alpha2/vmcondition/condition.go | 1 + .../pkg/controller/vm/internal/lifecycle.go | 11 +++ test/e2e/vm/no_bootable_device.go | 81 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 test/e2e/vm/no_bootable_device.go diff --git a/api/core/v1alpha2/vmcondition/condition.go b/api/core/v1alpha2/vmcondition/condition.go index 6abfecbe0c..1b4ae829c5 100644 --- a/api/core/v1alpha2/vmcondition/condition.go +++ b/api/core/v1alpha2/vmcondition/condition.go @@ -167,6 +167,7 @@ func (r RunningReason) String() string { const ( ReasonVirtualMachineNotRunning RunningReason = "NotRunning" ReasonVirtualMachineRunning RunningReason = "Running" + ReasonNoBootableDeviceFound RunningReason = "NoBootableDevice" ReasonInternalVirtualMachineError RunningReason = "InternalVirtualMachineError" ReasonPodNotStarted RunningReason = "PodNotStarted" ReasonPodTerminating RunningReason = "PodTerminating" diff --git a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go index 370a26d909..ae7aba2ea7 100644 --- a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go +++ b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go @@ -208,6 +208,17 @@ func (h *LifeCycleHandler) syncRunning(ctx context.Context, vm *v1alpha2.Virtual if vm.Status.Phase == v1alpha2.MachineRunning { cb.Reason(vmcondition.ReasonVirtualMachineRunning).Status(metav1.ConditionTrue) + + for _, c := range kvvmi.Status.Conditions { + if c.Type == "BootFailed" { + cb.Status(conditionStatus(string(c.Status))). + Reason(vmcondition.ReasonNoBootableDeviceFound). + Message("Among all the virtual machine’s block devices, there is no device from which it can boot.") + conditions.SetCondition(cb, &vm.Status.Conditions) + return nil + } + } + conditions.SetCondition(cb, &vm.Status.Conditions) return nil } diff --git a/test/e2e/vm/no_bootable_device.go b/test/e2e/vm/no_bootable_device.go new file mode 100644 index 0000000000..b35403bce4 --- /dev/null +++ b/test/e2e/vm/no_bootable_device.go @@ -0,0 +1,81 @@ +/* +Copyright 2026 Flant JSC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "context" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + crclient "sigs.k8s.io/controller-runtime/pkg/client" + + vmbuilder "github.com/deckhouse/virtualization-controller/pkg/builder/vm" + "github.com/deckhouse/virtualization-controller/pkg/controller/conditions" + "github.com/deckhouse/virtualization/api/core/v1alpha2" + "github.com/deckhouse/virtualization/api/core/v1alpha2/vmcondition" + "github.com/deckhouse/virtualization/test/e2e/internal/framework" + "github.com/deckhouse/virtualization/test/e2e/internal/object" + "github.com/deckhouse/virtualization/test/e2e/internal/precheck" + "github.com/deckhouse/virtualization/test/e2e/internal/util" +) + +var _ = Describe("VirtualMachineNoBootableDevice", Label(precheck.NoPrecheck), func() { + var ( + f *framework.Framework + ctx context.Context + ) + + BeforeEach(func() { + ctx = context.Background() + f = framework.NewFramework("vm-no-bootable-device") + DeferCleanup(f.After) + f.Before() + }) + + It("sets Running condition reason to NoBootableDevice", func() { + By("Generating a blank disk and virtual machine with no bootable devices") + vdBlank := object.NewBlankVD("vd-blank", f.Namespace().Name, nil, ptr.To(resource.MustParse("100Mi"))) + + vm := object.NewMinimalVM("vm-", f.Namespace().Name, + vmbuilder.WithBlockDeviceRefs(v1alpha2.BlockDeviceSpecRef{ + Kind: v1alpha2.DiskDevice, + Name: vdBlank.Name, + }), + ) + + By("Creating resources") + err := f.CreateWithDeferredDeletion(ctx, vdBlank, vm) + Expect(err).NotTo(HaveOccurred()) + + By("Waiting for virtual machine to be Running") + util.UntilObjectPhase(ctx, string(v1alpha2.MachineRunning), framework.LongTimeout, vm) + + By("Checking Running condition reason indicates no bootable device") + Eventually(func(g Gomega) { + err = f.GenericClient().Get(ctx, crclient.ObjectKeyFromObject(vm), vm) + g.Expect(err).NotTo(HaveOccurred()) + + runningCondition, found := conditions.GetCondition(vmcondition.TypeRunning, vm.Status.Conditions) + g.Expect(found).To(BeTrue()) + g.Expect(runningCondition.Reason).To(Equal(vmcondition.ReasonNoBootableDeviceFound.String())) + g.Expect(runningCondition.Status).To(Equal(metav1.ConditionTrue)) + }).WithTimeout(framework.LongTimeout).WithPolling(framework.PollingInterval).Should(Succeed()) + }) +}) From bf54e13aa2082d8f5fe1c38a9d8488614ade1e19 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 12:19:36 +0300 Subject: [PATCH 02/15] comment Signed-off-by: Valeriy Khorunzhin --- api/core/v1alpha2/vmcondition/condition.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/core/v1alpha2/vmcondition/condition.go b/api/core/v1alpha2/vmcondition/condition.go index 1b4ae829c5..2320fd5da9 100644 --- a/api/core/v1alpha2/vmcondition/condition.go +++ b/api/core/v1alpha2/vmcondition/condition.go @@ -165,8 +165,9 @@ func (r RunningReason) String() string { } const ( - ReasonVirtualMachineNotRunning RunningReason = "NotRunning" - ReasonVirtualMachineRunning RunningReason = "Running" + ReasonVirtualMachineNotRunning RunningReason = "NotRunning" + ReasonVirtualMachineRunning RunningReason = "Running" + // ReasonNoBootableDeviceFound indicates that a virtual machine is running but no bootable device for an operating system was found. ReasonNoBootableDeviceFound RunningReason = "NoBootableDevice" ReasonInternalVirtualMachineError RunningReason = "InternalVirtualMachineError" ReasonPodNotStarted RunningReason = "PodNotStarted" From 5213f3256bb0787b1a193eecc1cd4328d1f7174e Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 17:06:43 +0300 Subject: [PATCH 03/15] Update images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go Co-authored-by: Ivan Mikheykin Signed-off-by: Valeriy Khorunzhin --- .../pkg/controller/vm/internal/lifecycle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go index ae7aba2ea7..1e5415a9c7 100644 --- a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go +++ b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go @@ -213,7 +213,7 @@ func (h *LifeCycleHandler) syncRunning(ctx context.Context, vm *v1alpha2.Virtual if c.Type == "BootFailed" { cb.Status(conditionStatus(string(c.Status))). Reason(vmcondition.ReasonNoBootableDeviceFound). - Message("Among all the virtual machine’s block devices, there is no device from which it can boot.") + Message(fmt.Sprintf("%s Check virtual machine’s block devices, check OS image is compatible with the chosen bootloader %q.", c.Message, vm.Spec.Bootloader)) conditions.SetCondition(cb, &vm.Status.Conditions) return nil } From f84c52659db10fdd59a89f0ebd22d290e679bd6a Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 17:08:09 +0300 Subject: [PATCH 04/15] change message Signed-off-by: Valeriy Khorunzhin --- .../pkg/controller/vm/internal/lifecycle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go index 1e5415a9c7..bcd0e1ebcf 100644 --- a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go +++ b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go @@ -213,7 +213,7 @@ func (h *LifeCycleHandler) syncRunning(ctx context.Context, vm *v1alpha2.Virtual if c.Type == "BootFailed" { cb.Status(conditionStatus(string(c.Status))). Reason(vmcondition.ReasonNoBootableDeviceFound). - Message(fmt.Sprintf("%s Check virtual machine’s block devices, check OS image is compatible with the chosen bootloader %q.", c.Message, vm.Spec.Bootloader)) + Message(fmt.Sprintf("Among all the virtual machine’s block devices, there is no device from which it can boot. Check OS image is compatible with the chosen bootloader %q.", vm.Spec.Bootloader)) conditions.SetCondition(cb, &vm.Status.Conditions) return nil } From 1265ba31179a818a75e4eee4fc51f37ed9cb2fca Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 17:55:06 +0300 Subject: [PATCH 05/15] 123 Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 542d241165..13a250f821 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,6 +15,8 @@ secrets: shell: install: - | + echo 123 + echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From d8768e50f1e361824258359f25d07c4eb497bbc0 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 18:10:21 +0300 Subject: [PATCH 06/15] ttt Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 13a250f821..542d241165 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,8 +15,6 @@ secrets: shell: install: - | - echo 123 - echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From 894f0cb7fb0fc6ca3bca9e2355b146de94998ce7 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 18:10:53 +0300 Subject: [PATCH 07/15] ttt Signed-off-by: Valeriy Khorunzhin --- build/components/versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/components/versions.yml b/build/components/versions.yml index 7f016066e7..82edecc82c 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: v1.6.2-v12n.36 + 3p-kubevirt: v1.6.2-v12n.35 3p-containerized-data-importer: v1.60.3-v12n.19 distribution: 2.8.3 package: From 8d93260ec9fc41a7f91ff28731a776634345b720 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 18:15:13 +0300 Subject: [PATCH 08/15] ttttt Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 542d241165..13a250f821 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,6 +15,8 @@ secrets: shell: install: - | + echo 123 + echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From 8b8f30e845bbe3d14d6b6cdc9e1af3285f774432 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 18:38:44 +0300 Subject: [PATCH 09/15] tt Signed-off-by: Valeriy Khorunzhin --- build/components/versions.yml | 2 +- images/virt-artifact/werf.inc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/components/versions.yml b/build/components/versions.yml index 82edecc82c..7f016066e7 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: v1.6.2-v12n.35 + 3p-kubevirt: v1.6.2-v12n.36 3p-containerized-data-importer: v1.60.3-v12n.19 distribution: 2.8.3 package: diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 13a250f821..5733ace029 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,7 +15,7 @@ secrets: shell: install: - | - echo 123 + echo 1234 echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From 66b8da2544f641e01efeeda57911244c43a549b4 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 27 May 2026 18:56:37 +0300 Subject: [PATCH 10/15] 123 Signed-off-by: Valeriy Khorunzhin --- build/components/versions.yml | 2 +- images/virt-artifact/werf.inc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/components/versions.yml b/build/components/versions.yml index 7f016066e7..54575ac3e7 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: v1.6.2-v12n.36 + 3p-kubevirt: test-not-merge-problem 3p-containerized-data-importer: v1.60.3-v12n.19 distribution: 2.8.3 package: diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 5733ace029..5367aeecb8 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,7 +15,7 @@ secrets: shell: install: - | - echo 1234 + echo 123456 echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From a59f3edd0549a4cfa2192570aa81b4ed0ca34c8c Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 28 May 2026 06:56:05 +0300 Subject: [PATCH 11/15] f Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 5367aeecb8..1c90623d77 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,7 +15,7 @@ secrets: shell: install: - | - echo 123456 + echo 1234567 echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From 272080251c876c9ec6b757f70c8bda7d46b03504 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 28 May 2026 07:43:43 +0300 Subject: [PATCH 12/15] ojvdsvigfiufd Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 1c90623d77..6e47c5a8bb 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,7 +15,7 @@ secrets: shell: install: - | - echo 1234567 + echo 12345678 echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From 1c2209e487264928b5898430f79a587e7eb431a8 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 28 May 2026 07:58:35 +0300 Subject: [PATCH 13/15] back Signed-off-by: Valeriy Khorunzhin --- build/components/versions.yml | 2 +- images/virt-artifact/werf.inc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/components/versions.yml b/build/components/versions.yml index 54575ac3e7..7f016066e7 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: test-not-merge-problem + 3p-kubevirt: v1.6.2-v12n.36 3p-containerized-data-importer: v1.60.3-v12n.19 distribution: 2.8.3 package: diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 6e47c5a8bb..bb00b67d64 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,7 +15,7 @@ secrets: shell: install: - | - echo 12345678 + echo 123456789 echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From 5d3720e865ee1bd11a47bd95bf1c39c087a5e9a5 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 28 May 2026 08:18:36 +0300 Subject: [PATCH 14/15] upd Signed-off-by: Valeriy Khorunzhin --- build/components/versions.yml | 2 +- images/virt-artifact/werf.inc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/components/versions.yml b/build/components/versions.yml index 7f016066e7..54575ac3e7 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: v1.6.2-v12n.36 + 3p-kubevirt: test-not-merge-problem 3p-containerized-data-importer: v1.60.3-v12n.19 distribution: 2.8.3 package: diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index bb00b67d64..4240328d37 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,7 +15,7 @@ secrets: shell: install: - | - echo 123456789 + echo 1234567890 echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt From d276483bc7f3e80e1ec71f82ab56a9c84ff57d4a Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 28 May 2026 08:31:46 +0300 Subject: [PATCH 15/15] fixxx Signed-off-by: Valeriy Khorunzhin --- build/components/versions.yml | 2 +- images/virt-artifact/werf.inc.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build/components/versions.yml b/build/components/versions.yml index 54575ac3e7..f79008f9d2 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: test-not-merge-problem + 3p-kubevirt: v1.6.2-v12n.37 3p-containerized-data-importer: v1.60.3-v12n.19 distribution: 2.8.3 package: diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 4240328d37..542d241165 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -15,8 +15,6 @@ secrets: shell: install: - | - echo 1234567890 - echo "Git clone {{ $gitRepoName }} repository..." git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt