From 3e165dad1709a0c8befefaef8d407df2716e613d Mon Sep 17 00:00:00 2001 From: Nijin Ashok Date: Fri, 10 Nov 2023 11:19:54 +0530 Subject: [PATCH 1/2] ovirt: Reconcile disk on USER_UPDATE_VM_DISK When a disk is extended in RHV, the size was not updated in the inventory causing the VM to be imported with old disk size. This is now solved by reconciling the disk on USER_UPDATE_VM_DISK. Signed-off-by: Nijin Ashok --- pkg/controller/provider/container/ovirt/model.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/controller/provider/container/ovirt/model.go b/pkg/controller/provider/container/ovirt/model.go index 1ea9f4129..89f611668 100644 --- a/pkg/controller/provider/container/ovirt/model.go +++ b/pkg/controller/provider/container/ovirt/model.go @@ -996,6 +996,7 @@ func (r *DiskAdapter) Event() []int { USER_ADD_VM_FINISHED_SUCCESS, IMPORTEXPORT_IMPORT_VM, USER_REMOVE_VM, + USER_UPDATE_VM_DISK, // StorageDomain. USER_DETACH_STORAGE_DOMAIN_FROM_POOL, USER_FORCE_REMOVE_STORAGE_DOMAIN, @@ -1064,6 +1065,7 @@ func (r *DiskAdapter) Apply(ctx *Context, event *Event) (updater Updater, err er case USER_ADD_VM, USER_ADD_VM_FINISHED_SUCCESS, IMPORTEXPORT_IMPORT_VM, + USER_UPDATE_VM_DISK, USER_REMOVE_VM: err = collection.Reconcile(desired) default: From 9a5e7f0fc658e35ce394919265b291b86e11c662 Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Sun, 12 Nov 2023 14:20:25 +0200 Subject: [PATCH 2/2] place USER_UPDATE_VM_DISK in the 'Disk' section The VM-specific properties (e.g., disk interface) are handled by VMAdapter. The handling by DiskAdapter of USER_UPDATE_VM_DISK events is for updating the disk properties that are not VM-specific, this moving this event to the section of disk-events (minor change). Signed-off-by: Arik Hadas --- pkg/controller/provider/container/ovirt/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/provider/container/ovirt/model.go b/pkg/controller/provider/container/ovirt/model.go index 89f611668..14aa43ad5 100644 --- a/pkg/controller/provider/container/ovirt/model.go +++ b/pkg/controller/provider/container/ovirt/model.go @@ -988,6 +988,7 @@ func (r *DiskAdapter) Event() []int { USER_ADD_DISK_FINISHED_SUCCESS, USER_ADD_DISK_TO_VM_SUCCESS, USER_REMOVE_DISK, + USER_UPDATE_VM_DISK, // VM USER_FINISHED_REMOVE_DISK_ATTACHED_TO_VMS, USER_REMOVE_DISK_FROM_VM, @@ -996,7 +997,6 @@ func (r *DiskAdapter) Event() []int { USER_ADD_VM_FINISHED_SUCCESS, IMPORTEXPORT_IMPORT_VM, USER_REMOVE_VM, - USER_UPDATE_VM_DISK, // StorageDomain. USER_DETACH_STORAGE_DOMAIN_FROM_POOL, USER_FORCE_REMOVE_STORAGE_DOMAIN,