Bug 1265049

Summary: Offline migration failed with memory device when guest is shutoff.
Product: Red Hat Enterprise Linux 7 Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: dyuan, lhuang, mzhan, pkrempa, rbalakri, yafu, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.3.1-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 18:24:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fangge Jin 2015-09-22 02:12:26 UTC
Description of problem:
Configure the guest xml with memory device:
    <memory model='dimm'>
      <target>
        <size unit='KiB'>256000</size>
        <node>0</node>
      </target>
    </memory>

Then do offline migration and failed:
# virsh migrate test4 qemu+ssh://10.66.4.226/system --offline --persistent
root.4.226's password: 
error: Requested operation is not valid: domain's dimm info lacks slot ID or base address


Version-Release number of selected component (if applicable):
libvirt-1.2.17-9.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Configure the guest xml with memory device:
    <memory model='dimm'>
      <target>
        <size unit='KiB'>256000</size>
        <node>0</node>
      </target>
    </memory>

2.When the guest is shutoff, do offline migration:
# virsh migrate test4 qemu+ssh://10.66.4.226/system --offline --persistent
root.4.226's password: 
error: Requested operation is not valid: domain's dimm info lacks slot ID or base address

3.Start the guest, then do offline migration again and succeed.


Actual results:
Offline migration failed when guest is shutoff.

Expected results:
Offline migration can succeed when guest is shutoff.

Comment 1 Peter Krempa 2015-09-24 10:23:51 UTC
2015-09-24 07:59:23.506+0000: 209905: debug : qemuMigrationIsAllowed:2253 : Requested operation is not valid: domain's dimm info lacks slot ID or base address

qemuMigrationIsAllowed rejects the migration even if we are migrating offline. The function will need to be modified to skip certain checks when doing offline migration.

Comment 2 Peter Krempa 2015-10-07 07:14:40 UTC
Fixed upstream:

commit 01b4baba59db2478ad260ebc61693a2325229f5b
Author: Peter Krempa <pkrempa>
Date:   Tue Oct 6 17:02:09 2015 +0200

    qemu: migration: Skip few checks while doing offline migration
    
    qemuMigrationIsAllowed would disallow offline migration if the VM
    contained host devices or memory modules. Since during offline migration
    we don't transfer any state we can safely migrate VMs with such
    configuration.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1265049

commit b6c44af0f7edb9eec3d3ba2dd1a423f17bf0e633
Author: Peter Krempa <pkrempa>
Date:   Tue Oct 6 16:24:48 2015 +0200

    qemu: migration: Use migration flags in qemuMigrationIsAllowed
    
    Use the migration @flags for checking various migration aspects rather
    than picking them out as booleans. Document the new semantics in the
    function header.

commit f558c66f17e633ae912e339bd196fcd4861a61a8
Author: Peter Krempa <pkrempa>
Date:   Tue Oct 6 15:53:02 2015 +0200

    qemu: migration: Drop @def from qemuMigrationIsAllowed
    
    Now that qemuMigrationIsAllowed is always called with @vm, we can drop
    the @def argument and simplify the control flow.
    
    Additionally the comment is invalid so drop it.

commit b866991f0c47c95a97ae4440eef99592b27bb8a8
Author: Peter Krempa <pkrempa>
Date:   Tue Oct 6 15:39:48 2015 +0200

    qemu: migration: Split source and destination migration checks
    
    Extract the hostdev check from qemuMigrationIsAllowed into a separate
    function since that is the only part that needs to be done in the v2
    migration protocol prepare phase on the destination. All other checks
    were added when the v3 protocol existed so they don't need to be
    extracted.
    
    This change will allow to drop the @def argument for
    qemuMigrationIsAllowed and further simplify the function.

Comment 4 Fangge Jin 2016-03-03 03:25:52 UTC
Test pass with build libvirt-1.3.2-1.el7.x86_64.

Steps are as comment 0

Comment 6 errata-xmlrpc 2016-11-03 18:24:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2577.html