Bug 1591789 - p2v: error: XML error: CPU vendor specified without CPU model
Summary: p2v: error: XML error: CPU vendor specified without CPU model
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.6
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: P2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-15 14:52 UTC by mxie@redhat.com
Modified: 2018-10-30 07:46 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.38.2-8.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 07:45:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virt-p2v-to-libvirt-log (269.53 KB, application/x-gzip)
2018-06-15 14:52 UTC, mxie@redhat.com
no flags Details
virt-p2v-1.38.2-2-log (186.12 KB, application/x-gzip)
2018-07-03 09:26 UTC, mxie@redhat.com
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:3021 0 None None None 2018-10-30 07:46:59 UTC

Description mxie@redhat.com 2018-06-15 14:52:39 UTC
Created attachment 1451954 [details]
virt-p2v-to-libvirt-log

Description of problem:
Failed to define guest by virsh after virt-p2v converting host to libvirt

Version-Release number of selected component (if applicable):
virt-v2v-1.38.2-3.el7.x86_64
libguestfs-1.38.2-3.el7.x86_64
libvirt-4.4.0-2.el7.x86_64
qemu-kvm-rhev-2.12.0-3.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Install rhel7.5 on physical machine
2.Boot machine into virt-p2v client
3.Input v2v conversion server info and pass the test connection
4.Input conversion info(-o libvirt -os default) and start convert host to libvirt
5.But can't find the guest in default pool after finishing p2v conversion, check virt-v2v log and find below error:
# cat /tmp/virt-p2v-20180615-b8mcvuf9/virt-v2v-conversion-log.txt 
....
virsh 'define' '/tmp/v2vlibvirt6da80d.xml'
error: Failed to define domain from /tmp/v2vlibvirt6da80d.xml
error: XML error: CPU vendor specified without CPU model

virt-v2v: warning: could not define libvirt domain.  The libvirt XML is 
still available in ‘/tmp/v2vlibvirt6da80d.xml’.  Try running ‘virsh 
define /tmp/v2vlibvirt6da80d.xml’ yourself instead.
....


Actual results:
As above description

Expected Results:
Guest is listed in default pool after virt-p2v converting host to libvirt

Additional info:

Comment 2 Richard W.M. Jones 2018-06-15 14:55:47 UTC
The error is:

  error: XML error: CPU vendor specified without CPU model

and the XML we are generating is:

  <cpu match='minimum'>
    <vendor>Intel</vendor>
    <topology sockets='2' cores='10' threads='2'/>
  </cpu>

Comment 3 mxie@redhat.com 2018-06-15 15:08:21 UTC
(In reply to Richard W.M. Jones from comment #2)
> The error is:
> 
>   error: XML error: CPU vendor specified without CPU model
> 
> and the XML we are generating is:
> 
>   <cpu match='minimum'>
>     <vendor>Intel</vendor>
>     <topology sockets='2' cores='10' threads='2'/>
>   </cpu>

And the vcpu num (2) is inconsistent with the num (40)of cpu topology in the xml after p2v conversion


resulting XML for libvirt:
<?xml version='1.0' encoding='utf-8'?>
<domain type='kvm'>
  <!-- generated by virt-v2v 1.38.2rhel=7,release=3.el7,libvirt -->
  <name>host-to-libvirt</name>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu>2</vcpu>
  <cpu match='minimum'>
    <vendor>Intel</vendor>
    <topology sockets='2' cores='10' threads='2'/>
  </cpu>

Comment 5 Richard W.M. Jones 2018-06-15 15:20:15 UTC
(In reply to mxie from comment #3)
> (In reply to Richard W.M. Jones from comment #2)
> > The error is:
> > 
> >   error: XML error: CPU vendor specified without CPU model
> > 
> > and the XML we are generating is:
> > 
> >   <cpu match='minimum'>
> >     <vendor>Intel</vendor>
> >     <topology sockets='2' cores='10' threads='2'/>
> >   </cpu>
> 
> And the vcpu num (2) is inconsistent with the num (40)of cpu topology in the
> xml after p2v conversion
> 
> 
> resulting XML for libvirt:
> <?xml version='1.0' encoding='utf-8'?>
> <domain type='kvm'>
>   <!-- generated by virt-v2v 1.38.2rhel=7,release=3.el7,libvirt -->
>   <name>host-to-libvirt</name>
>   <memory unit='KiB'>2097152</memory>
>   <currentMemory unit='KiB'>2097152</currentMemory>
>   <vcpu>2</vcpu>
>   <cpu match='minimum'>
>     <vendor>Intel</vendor>
>     <topology sockets='2' cores='10' threads='2'/>
>   </cpu>

Did you modify the P2V vCPUs field?  It might be:
https://bugzilla.redhat.com/show_bug.cgi?id=1590721 ?

Comment 6 mxie@redhat.com 2018-06-15 15:27:15 UTC
Yes,I modified the vCPU num before p2v converting because physical machine has 40 vCPUs

Comment 9 mxie@redhat.com 2018-07-03 09:24:03 UTC
Verify the bug with builds:
virt-p2v-1.38.2-2.el7.noarch
virt-v2v-1.38.2-6.el7.x86_64
libguestfs-1.38.2-6.el7.x86_64
libvirt-4.4.0-2.el7.x86_64
qemu-kvm-rhev-2.12.0-6.el7.x86_64

Steps:
1.Install ubuntu18.04 LTS on physical machine
2.Boot machine into virt-p2v client
3.Input v2v conversion server info and pass the test connection
4.Input conversion info(-o libvirt -os default) and start convert host to libvirt
5.But can't find the guest in default pool after finishing p2v conversion, find below error in virt-v2v-conversion-log.txt:

virsh 'define' '/tmp/v2vlibvirt04a2c8.xml'
error: Failed to define domain from /tmp/v2vlibvirt04a2c8.xml
error: unsupported configuration: CPU topology doesn't match maximum vcpu count

virt-v2v: warning: could not define libvirt domain.  The libvirt XML is 
still available in ‘/tmp/v2vlibvirt04a2c8.xml’.  Try running ‘virsh 
define /tmp/v2vlibvirt04a2c8.xml’ yourself instead.


Hi rjones,

  Seems the bug is not fixed, pls help to check the virt-p2v log

Comment 10 mxie@redhat.com 2018-07-03 09:26:25 UTC
Created attachment 1456155 [details]
virt-p2v-1.38.2-2-log

Comment 11 Richard W.M. Jones 2018-07-03 09:56:43 UTC
Yup, this is physical XML created by virt-p2v is completely wrong:

  <vcpu>1</vcpu>
  <cpu match="minimum">
    <vendor>Intel</vendor>
    <topology sockets="3" cores="1" threads="1"/>
  </cpu>

1 != 3*1*1

I think this is another instance of bug 1590721.

However what is interesting is how did it happen?  Did you change
the number in the vCPUs box or did it happen without you doing
anything?  If the second, then it's either a new bug or a variation
of bug 1590721.

FWIW I'm currently fixing a lot of issues in virt-p2v, including
bug 1590721 and complicated bugs with -o rhv-upload.

Comment 12 mxie@redhat.com 2018-07-06 07:17:08 UTC
Hi rjones,

   1) If modify the vcpu num (less than actual vcpu num) before conversion, then virsh can't define guest's xml after p2v conversion due to vcpu num is not consistent with cpu topology in guest xml
   2) If don't modify the vcpu num before conversion,virsh can define guest's xml successfully after p2v conversion 
 

Thanks

Comment 13 Pino Toscano 2018-07-12 08:20:12 UTC
(In reply to mxie from comment #12)
> Hi rjones,
> 
>    1) If modify the vcpu num (less than actual vcpu num) before conversion,
> then virsh can't define guest's xml after p2v conversion due to vcpu num is
> not consistent with cpu topology in guest xml
>    2) If don't modify the vcpu num before conversion,virsh can define
> guest's xml successfully after p2v conversion 

This is correct, and confirms what Rich said in comment 11. Considering the vCPUs <=> topology issue tracked as bug 1590721, isn't the rest enough to verify this bug?

Comment 14 mxie@redhat.com 2018-07-12 09:07:24 UTC
(In reply to Pino Toscano from comment #13)
> (In reply to mxie from comment #12)
> > Hi rjones,
> > 
> >    1) If modify the vcpu num (less than actual vcpu num) before conversion,
> > then virsh can't define guest's xml after p2v conversion due to vcpu num is
> > not consistent with cpu topology in guest xml
> >    2) If don't modify the vcpu num before conversion,virsh can define
> > guest's xml successfully after p2v conversion 
> 
> This is correct, and confirms what Rich said in comment 11. Considering the
> vCPUs <=> topology issue tracked as bug 1590721, isn't the rest enough to
> verify this bug?

Hi Pino,

   I'm not sure whether this bug is duplicated with bug 1590721, even if they are duplicated bugs, because bug 1590721 is not fixed, I can't verify this bug now.

Thanks

Comment 15 Pino Toscano 2018-07-12 09:12:04 UTC
(In reply to mxie from comment #14)
>    I'm not sure whether this bug is duplicated with bug 1590721, even if
> they are duplicated bugs, because bug 1590721 is not fixed, I can't verify
> this bug now.

Sorry, I was not clear: I'm saying that you hit bug 1590721 only if you change the number of vCPUs when converting a physical machine. If you convert a physical machine and do not change the number of vCPUs, then it should be possible to verify this bug.

Comment 21 mxie@redhat.com 2018-07-24 10:57:27 UTC
Try to reproduce the bug with builds:
virt-v2v-1.38.2-3.el7.x86_64
libguestfs-1.38.2-3.el7.x86_64
virt-p2v-1.38.2-1.el7.iso

Reproduce steps:
1.Install rhel7.5 on physical machine
2.Boot machine into virt-p2v client
3.Input v2v conversion server info and pass the test connection
4.Input conversion info(-o libvirt -os default) and do not modify vCPU numbers, then start convert host to libvirt
5.The conversion could be finished but with virt-v2v warning, check the details info in virt-v2v-conversion-log.txt as below:
....
virsh 'define' '/tmp/v2vlibvirt9ad908.xml'
error: Failed to define domain from /tmp/v2vlibvirt9ad908.xml
error: XML error: CPU vendor specified without CPU model

virt-v2v: warning: could not define libvirt domain.  The libvirt XML is 
still available in ‘/tmp/v2vlibvirt9ad908.xml’.  Try running ‘virsh 
define /tmp/v2vlibvirt9ad908.xml’ yourself instead.
...
6.Check the guest xml in virt-v2v-conversion-log.txt, there is  <vendor>Intel</vendor> in vcpu part
....
 <vcpu>4</vcpu>
  <cpu match='minimum'>
    <vendor>Intel</vendor>
    <topology sockets='1' cores='4' threads='1'/>
  </cpu>
....


Verify the bugs with builds:
virt-v2v-1.38.2-8.el7.x86_64
libguestfs-1.38.2-8.el7.x86_64
virt-p2v-1.38.2-2.el7.iso

Steps:
1.Install rhel7.5 on physical machine
2.Boot machine into virt-p2v client
3.Input v2v conversion server info and pass the test connection
4.Input conversion info(-o libvirt -os default) and do not modify vCPU numbers, then start convert host to libvirt
5.The conversion could be finished without virt-v2v warning
6.Check the guest xml in virt-v2v-conversion-log.txt, there is no <vendor>Intel</vendor> in vcpu part
....
 <vcpu>4</vcpu>
  <cpu match='minimum'>
    <topology sockets='1' cores='4' threads='1'/>
  </cpu>
....
7.Can power on guest normally and checkpoints of guest are passed except bug 1318922


Result:
   There is no <vendor>Intel</vendor> in vCPU part of guest libvirt xml after p2v converting host to libvirt now, so move the bug from ON_QA to VERIFIED

Comment 23 errata-xmlrpc 2018-10-30 07:45: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://access.redhat.com/errata/RHEA-2018:3021


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