Change in vdsm[ovirt-3.6]: v2v: Skip vm if XMLDesc() fails

fromani at redhat.com fromani at redhat.com
Mon Oct 19 11:10:58 UTC 2015


Francesco Romani has submitted this change and it was merged.

Change subject: v2v: Skip vm if XMLDesc() fails
......................................................................


v2v: Skip vm if XMLDesc() fails

The current code assumes that XMLDesc() always succeeds when dealing
foreign vms, which seems to be too optimistic as seen here:

      File "/usr/share/vdsm/v2v.py", line 152, in get_external_vms
        root = ET.fromstring(vm.XMLDesc(0))
      File "/usr/lib64/python2.7/site-packages/libvirt.py", line 478, in XMLDesc
        if ret is None: raise libvirtError ('virDomainGetXMLDesc() failed', dom=self)
    libvirtError: internal error: Invalid or not yet handled value
    'emptyBackingString' for VMX entry 'ide1:0.fileName' for device type
    'cdrom-image'

If XMLDesc() failed, we aborted the entire request, making it impossible
to import good vm if libvirt could not handle another bad vm on the same
server.

Now we log the libvirt error and continue, increasing the chance to
return useful information to engine.

Change-Id: Iab912bc9524b94834d7f54172dd9401ddb4aa45b
Reported-by: Ian Fraser <ian.fraser at asm.org.uk>
Bug-Url: https://bugzilla.redhat.com/1266088
Backport-to: 3.6
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46634
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/47363
Tested-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/v2v.py
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Nir Soffer: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Francesco Romani: Verified; Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/47363
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab912bc9524b94834d7f54172dd9401ddb4aa45b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list