Change in ovirt-engine[master]: core: Memory device specParams int -> String

From Arik Hadas <ahadas@redhat.com>:
Arik Hadas has submitted this change and it was merged. Change subject: core: Memory device specParams int -> String ...................................................................... core: Memory device specParams int -> String Previously memory VM device specParams attribute held properties `node` and `size` as type `int`. However only types String and Map<String, String|Map> in specParams can be serialized to OVF. Such state resulted in empty tags in OVF: <SpecParams> <node></node> <size></size> </SpecParams> and subsequently in these properties missing from `specParams` map.
From this patch on `node` and `size` are stored in specParams of memory devices as Strings.
Dealing with devices with integer properties: * engine memory: restart on update * DB: upgrade script * VDSM VM.conf: specParams are converted during device import (VmDevicesMonitoring#buildNewVmDevice) * snapshots: there shouldn't be any ints in snapshots, but rather empty xml tags in ovf files Since vdsm-api.yml defines 'node' and 'size' properties of VmMemoryDevice sturcture as type 'uint', these properties are converted before sending to vdsm (MemoryUtils). Dealing with devices with missing properties: These devices can survive in running VMs on VDSM or in VM snapshots created in engine version 3.6-4.1. VDSM can't currently can't parse missing properties from domain xml. Engine altered to be able to deal with missing properties (VmDeviceCommonUtils#getSizeOfMemoryDeviceMb). Memory devices are imported from snapshots only if snapshot is being previewed with memory (VmDeviceUtils#addImportedOtherDevices). Memory devices of snapshots previewed without memory would be automatically deleted during first VM device monitoring cycle anyway. Memory device is never sent to VDSM in field "custom" as unmanaged devices usually are. Memory device is sent to VDSM only with memory volume. In this case such memory devices would be created in libvirt anyway from snapshot created by libvirt. Sending these devices from engine prevent VDSM to report memory devices as unrecognized ones (VmInfoBuilderImpl#handleMemoryDevice). Bug-Url: https://bugzilla.redhat.com/1452631 Change-Id: If242a7938c7351001a35ad5f32bd62101bf74efc Signed-off-by: Jakub Niedermertl <jniederm@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetAmountOfMemoryCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotUnplugMemoryCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/exportimport/ConvertVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/exportimport/ImportVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/exportimport/ImportVmTemplateCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/RestoreAllSnapshotsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/TryBackToAllSnapshotsOfVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDevice.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtils.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/HotUnplugMemoryVDSCommand.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/SetAmountOfMemoryVDSCommand.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/architecture/MemoryUtils.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/VmInfoBuilder.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/builder/vminfo/VmInfoBuilderImpl.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/VmDevicesMonitoring.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CreateBrokerVDSCommand.java A packaging/dbscripts/upgrade/04_02_0300_malformed_memory_devices_removed.sql 20 files changed, 146 insertions(+), 32 deletions(-) Approvals: Jakub Niedermertl: Verified Eli Mesika: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Arik Hadas: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/76640 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If242a7938c7351001a35ad5f32bd62101bf74efc Gerrit-PatchSet: 10 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jakub Niedermertl <jniederm@redhat.com> Gerrit-Reviewer: Arik Hadas <ahadas@redhat.com> Gerrit-Reviewer: Eli Mesika <emesika@redhat.com> Gerrit-Reviewer: Jakub Niedermertl <jniederm@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Peřina <mperina@redhat.com> Gerrit-Reviewer: gerrit-hooks <automation@ovirt.org>
participants (1)
-
Code Review