Skip to content

Commit ede6f4d

Browse files
feat(vm): set error policy report as default (#983)
Change VM behavior to I/O problems for disks. Previously, the presence of I/O problems stopped the VM and paused it. Now, instead of stopping the VM, I/O errors will be reported to the guest OS, allowing the guest system to deal with the problem (e.g., through retry mechanisms, failover). Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
1 parent f7ce0a9 commit ede6f4d

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

  • images/virtualization-artifact/pkg

images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_volume.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
corev1 "k8s.io/api/core/v1"
2727
"k8s.io/apimachinery/pkg/runtime"
2828
"k8s.io/apiserver/pkg/registry/rest"
29+
"k8s.io/utils/ptr"
2930
virtv1 "kubevirt.io/api/core/v1"
3031

3132
"github.com/deckhouse/virtualization-controller/pkg/tls/certmanager"
@@ -122,9 +123,10 @@ func (r AddVolumeREST) genMutateRequestHook(opts *subresources.VirtualMachineAdd
122123
hotplugRequest := AddVolumeOptions{
123124
Name: opts.Name,
124125
Disk: &virtv1.Disk{
125-
Name: opts.Name,
126-
DiskDevice: dd,
127-
Serial: serial,
126+
Name: opts.Name,
127+
DiskDevice: dd,
128+
Serial: serial,
129+
ErrorPolicy: ptr.To(virtv1.DiskErrorPolicyReport),
128130
},
129131
}
130132
switch opts.VolumeKind {

images/virtualization-artifact/pkg/controller/kvbuilder/kvvm.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/types"
2727
"k8s.io/apimachinery/pkg/util/intstr"
28+
"k8s.io/utils/ptr"
2829
virtv1 "kubevirt.io/api/core/v1"
2930

3031
"github.com/deckhouse/virtualization-controller/pkg/common"
@@ -307,9 +308,10 @@ func (b *KVVM) SetDisk(name string, opts SetDiskOptions) error {
307308
}
308309

309310
disk := virtv1.Disk{
310-
Name: name,
311-
DiskDevice: dd,
312-
Serial: opts.Serial,
311+
Name: name,
312+
DiskDevice: dd,
313+
Serial: opts.Serial,
314+
ErrorPolicy: ptr.To(virtv1.DiskErrorPolicyReport),
313315
}
314316

315317
if opts.BootOrder > 0 {

0 commit comments

Comments
 (0)