Bug 1434917 - Import of a VM with memory snapshot from storage domain fails
Summary: Import of a VM with memory snapshot from storage domain fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.1.1.3
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ovirt-4.1.2
: 4.1.2
Assignee: Tal Nisan
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
: 1437516 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-22 15:14 UTC by Tal Nisan
Modified: 2017-05-23 08:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-23 08:12:33 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+
ylavi: testing_plan_complete?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 75838 0 master MERGED core: Fix import of VMs with memory snapshot from domain 2020-10-22 09:28:42 UTC
oVirt gerrit 75842 0 ovirt-engine-4.1 MERGED core: Fix import of VMs with memory snapshot from domain 2020-10-22 09:28:42 UTC

Description Tal Nisan 2017-03-22 15:14:09 UTC
Description of problem:
When removing a storage domain containing a VM with memory snapshot and trying to import it back to the same setup the operation fails with unique constraint violation

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Create a VM and take a snapshot with memory
2. Detach the storage domain containing the VM disks and memory
3. Attach the storage domain to a data center
4. Import the VM

Actual results:
Operation fails

Expected results:
Operation should succeed

Additional info:
This occurs since the memory dump disk and the memory metadata disk are not deleted from the database on the detachment and when trying to import the VM the import command is trying to create new entry with the same identifier:

2017-03-22 16:03:38,576+02 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand] (org.ovirt.thread.pool-6-thread-6) [b8b971cf-bb56-48d0-a97c-f418a9a06908] Command 'org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand' failed: CallableStatementCallback; SQL [{call insertimage(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "pk_images"
  Detail: Key (image_guid)=(58b55584-a190-44fc-8903-1ee2c48783bd) already exists.
  Where: SQL statement "INSERT INTO images (
        creation_date,
        image_guid,
        it_guid,
        size,
        ParentId,
        imageStatus,
        lastModified,
        vm_snapshot_id,
        volume_type,
        image_group_id,
        volume_format,
        active,
        volume_classification
        )
    VALUES (
        v_creation_date,
        v_image_guid,
        v_it_guid,
        v_size,
        v_ParentId,
        v_imageStatus,
        v_lastModified,
        v_vm_snapshot_id,
        v_volume_type,
        v_image_group_id,
        v_volume_format,
        v_active,
        v_volume_classification
        )"

Comment 1 Tal Nisan 2017-04-02 08:55:39 UTC
*** Bug 1437516 has been marked as a duplicate of this bug. ***

Comment 2 Kevin Alon Goldblatt 2017-04-27 14:00:20 UTC
Verified with the following code:
---------------------------------------
ovirt-engine-4.1.2-0.1.el7.noarch
rhevm-4.1.2-0.1.el7.noarch
vdsm-4.19.11-1.el7ev.x86_64


Verified with the following scenario:
---------------------------------------
Steps to Reproduce:
1. Create a VM and take a snapshot with memory
2. Detach the storage domain containing the VM disks and memory
3. Attach the storage domain to a data center
4. Import the VM ->>> works fine



Moving to VERIFIED!


Note You need to log in before you can comment on or make changes to this bug.