Francesco Romani has uploaded a new change for review.
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@asm.org.uk Bug-Url: https://bugzilla.redhat.com/1266088 Backport-to: 3.6 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/46634 Continuous-Integration: Jenkins CI Reviewed-by: Francesco Romani fromani@redhat.com --- M vdsm/v2v.py 1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/47363/1
diff --git a/vdsm/v2v.py b/vdsm/v2v.py index 56340e8..5daa4f0 100644 --- a/vdsm/v2v.py +++ b/vdsm/v2v.py @@ -149,10 +149,16 @@ with closing(conn): vms = [] for vm in conn.listAllDomains(): - root = ET.fromstring(vm.XMLDesc(0)) params = {} _add_vm_info(vm, params) try: + xml = vm.XMLDesc(0) + except libvirt.libvirtError as e: + logging.error("error getting domain xml for vm %r: %s", + vm.name(), e) + continue + root = ET.fromstring(xml) + try: _add_general_info(root, params) except InvalidVMConfiguration as e: logging.error('error parsing domain xml, msg: %s xml: %s',
automation@ovirt.org has posted comments on this change.
Change subject: v2v: Skip vm if XMLDesc() fails ......................................................................
Patch Set 1:
* Update tracker::#1266088::OK * Check Bug-Url::OK * Check Public Bug::#1266088::OK, public bug * Check Product::#1266088::OK, Correct classification oVirt * Check TM::SKIP, not in a monitored branch (ovirt-3.5 ovirt-3.4 ovirt-3.3 ovirt-3.2) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: v2v: Skip vm if XMLDesc() fails ......................................................................
Patch Set 1:
not strictly needed, but nice to have
Francesco Romani has posted comments on this change.
Change subject: v2v: Skip vm if XMLDesc() fails ......................................................................
Patch Set 1: Verified+1
verified on master, and using tests as per https://gerrit.ovirt.org/#/q/status:open+project:vdsm+branch:master+topic:v2...
Nir Soffer has posted comments on this change.
Change subject: v2v: Skip vm if XMLDesc() fails ......................................................................
Patch Set 1: Code-Review+1
Francesco Romani has posted comments on this change.
Change subject: v2v: Skip vm if XMLDesc() fails ......................................................................
Patch Set 1: Code-Review+2
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@asm.org.uk Bug-Url: https://bugzilla.redhat.com/1266088 Backport-to: 3.6 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/46634 Continuous-Integration: Jenkins CI Reviewed-by: Francesco Romani fromani@redhat.com Reviewed-on: https://gerrit.ovirt.org/47363 Tested-by: Francesco Romani fromani@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
automation@ovirt.org has posted comments on this change.
Change subject: v2v: Skip vm if XMLDesc() fails ......................................................................
Patch Set 2:
* Update tracker::#1266088::OK * Set MODIFIED::bug 1266088::::#1266088::::IGNORE, not oVirt prod but vdsm
vdsm-patches@lists.fedorahosted.org