Richard W.M. Jones
2018-Jun-19 11:12 UTC
Re: [Libguestfs] [PATCH] v2v: Set machine type explicitly for outputs which support it (RHBZ#1581428).
On Tue, Jun 19, 2018 at 11:43:38AM +0100, Daniel P. Berrangé wrote:> I'd encourage apps to check the capabilities XML to see what > machine types are available.One issue is we don't always have access to the target hypervisor. For example in the Glance case we have to write something which will be picked up by Nova much later:> > + "hw_machine_type", > > + (match guestcaps.gcaps_machine with > > + | I440FX -> "pc" > > + | Q35 -> "q35" > > + | Virt -> "virt");I read the Nova code and it seems very ad-hoc. As far as I can tell these strings are eventually passed down to libvirt. However libvirt capabilities doesn't advertise these machine types exactly, but something more like "pc-q35-2.6". Does libvirt map "q35" to something intelligent? In any case it's not passed to libvirt before Nova has also done various ad-hoc stuff based on substrings. For example Nova will only add PCIe root ports to a guest if the machine type has "q35" as a substring. I can see many ways this could all go horribly wrong. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Daniel P. Berrangé
2018-Jun-19 11:39 UTC
Re: [Libguestfs] [PATCH] v2v: Set machine type explicitly for outputs which support it (RHBZ#1581428).
On Tue, Jun 19, 2018 at 12:12:30PM +0100, Richard W.M. Jones wrote:> On Tue, Jun 19, 2018 at 11:43:38AM +0100, Daniel P. Berrangé wrote: > > I'd encourage apps to check the capabilities XML to see what > > machine types are available. > > One issue is we don't always have access to the target hypervisor. > > For example in the Glance case we have to write something which will > be picked up by Nova much later: > > > > + "hw_machine_type", > > > + (match guestcaps.gcaps_machine with > > > + | I440FX -> "pc" > > > + | Q35 -> "q35" > > > + | Virt -> "virt"); > > I read the Nova code and it seems very ad-hoc. As far as I can tell > these strings are eventually passed down to libvirt. However libvirt > capabilities doesn't advertise these machine types exactly, but > something more like "pc-q35-2.6". Does libvirt map "q35" to something > intelligent?It'll report both - one as an alias of the other eg <machine maxCpus='255'>pc-i440fx-2.11</machine> <machine canonical='pc-i440fx-2.11' maxCpus='255'>pc</machine> <machine maxCpus='1'>isapc</machine> <machine maxCpus='255'>pc-i440fx-2.9</machine> <machine maxCpus='255'>pc-i440fx-2.6</machine> <machine maxCpus='255'>pc-i440fx-2.7</machine> <machine maxCpus='288'>pc-q35-2.11</machine> <machine canonical='pc-q35-2.11' maxCpus='288'>q35</machine> <machine maxCpus='288'>pc-q35-2.10</machine> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Richard W.M. Jones
2018-Jun-19 11:54 UTC
Re: [Libguestfs] [PATCH] v2v: Set machine type explicitly for outputs which support it (RHBZ#1581428).
On Tue, Jun 19, 2018 at 12:39:06PM +0100, Daniel P. Berrangé wrote:> On Tue, Jun 19, 2018 at 12:12:30PM +0100, Richard W.M. Jones wrote: > > On Tue, Jun 19, 2018 at 11:43:38AM +0100, Daniel P. Berrangé wrote: > > > I'd encourage apps to check the capabilities XML to see what > > > machine types are available. > > > > One issue is we don't always have access to the target hypervisor. > > > > For example in the Glance case we have to write something which will > > be picked up by Nova much later: > > > > > > + "hw_machine_type", > > > > + (match guestcaps.gcaps_machine with > > > > + | I440FX -> "pc" > > > > + | Q35 -> "q35" > > > > + | Virt -> "virt"); > > > > I read the Nova code and it seems very ad-hoc. As far as I can tell > > these strings are eventually passed down to libvirt. However libvirt > > capabilities doesn't advertise these machine types exactly, but > > something more like "pc-q35-2.6". Does libvirt map "q35" to something > > intelligent? > > It'll report both - one as an alias of the other > > eg > > <machine canonical='pc-i440fx-2.11' maxCpus='255'>pc</machine> > <machine canonical='pc-q35-2.11' maxCpus='288'>q35</machine>Oh I see, I missed that in all the output. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Maybe Matching Threads
- Re: [PATCH] v2v: Set machine type explicitly for outputs which support it (RHBZ#1581428).
- Re: [PATCH] v2v: Set machine type explicitly for outputs which support it (RHBZ#1581428).
- [PATCH] v2v: Set machine type explicitly for outputs which support it (RHBZ#1581428).
- [PATCH] v2v: Model machine type explicitly.
- how to detect if qemu supports live disk snapshot