Andrei Perietanu
2016-Oct-05 14:00 UTC
Re: [libvirt-users] problem with disk virtio driver
Hi Andrea, Thanks for the reply; To shed some more light on the matter I performed a few more tests; each time doing a clean install. I installed ubuntu14.04 as the guest OS, keeping everything else the same. On my custom Linux I've created ubuntu VMs before (using ide drivers) and it all works file. This time I created the VM using virtio disk drivers and the installation didn't even finish. It reported a disk related error saying it's not being able to read from /dev/vda. I restarted the machine...same error. Just to make sure that I have not messed anything up, I did the same on the ubuntu host, so installed ubuntu guest on an ubuntu host uding the same guest config xml. This time everything worked fine. So it looks like a problem with the kvm virtio drivers. I was trying to stay away from updating the qemu package because adding the package takes a long time (usually, because of missing dependencies), but I'm not sure I have any other option at this point... Andrei On Wed, Oct 5, 2016 at 2:45 PM, Andrea Bolognani <abologna@redhat.com> wrote:> On Wed, 2016-10-05 at 12:13 +0100, Andrei Perietanu wrote: > > I just ran into a problem I can't make heads or tails of, > > so I'm hoping to get some help here. > > > > I have a custom built Embedded Linux running qemu-kvm > > 1.1.2 and libvirt 1.2.20 > > > > I'm creating a domain with the following config: > > > > <domain type='kvm'> > > <name>myVM</name> > > <memory unit='KiB'>2097152</memory> > > <vcpu placement='static'>2</vcpu> > > <os> > > <type arch='x86_64'>hvm</type> > > <boot dev='hd'/> > > <boot dev='cdrom'/> > > </os> > > <features> > > <acpi/> > > <apic/> > > </features> > > <cpu mode='host-model'/> > > <clock offset='utc'> > > <timer name='rtc' tickpolicy='catchup'/> > > <timer name='pit' tickpolicy='delay'/> > > <timer name='hpet' present='no'/> > > </clock> > > <on_poweroff>destroy</on_poweroff> > > <on_reboot>restart</on_reboot> > > <on_crash>restart</on_crash> > > <devices> > > <disk type='file' device='cdrom'> > > <driver name='qemu' type='raw'/> > > <target dev='hdb' bus='ide'/> > > <source file='custom.iso'/> > > <readonly/> > > > > </disk> > > <disk type='file' device='disk'> > > <driver name='qemu' type='qcow2'/> > > <source file='/path/to/vdisk.img'/> > > <target dev='vda' bus='virtio'/> > > </disk> > > <controller type='pci' model='pci-root'/> > > <controller type='usb'/> > > <controller type='ide'/> > > <interface type='bridge'> > > <source bridge='virbr0'/> > > <model type='virtio'/> > > </interface> > > > > <serial type='pty'> > > <target port='0'/> > > </serial> > > <console type='pty'> > > <target type='serial' port='0'/> > > </console> > > <input type='tablet' bus='usb'/> > > <input type='mouse' bus='ps2'/> > > <input type='keyboard' bus='ps2'/> > > <graphics type='vnc' port='-1' autoport='yes'/> > > <video> > > <model type='qxl' ram='65536' vram='65536' vgamem='16384' > heads='1'/> > > </video> > > <watchdog model='i6300esb' action='reset'/> > > <memballoon model='none'/> > > </devices> > > </domain> > > There doesn't seem to be anything obviously wrong with your > guest configuration. > > > Granted the OS I'm installing is again a custom Linux with > > some software running on top ..so It's not a well known > > OS...but I'm hoping that does not matter much. > > It shouldn't. > > > After installation I get all sorts of kernel panics and > > errors about services not being able to start. > > Wait, so the OS installer is perfectly happy and runs to > completion, but once you boot the installed OS you get a > bunch of errors? > > That sounds more like a faulty guest OS configuration than > anything wrong with the virtual hardware. It most certainly > doesn't sound like it could be anything disk related, > because if that was the case the installer wouldn't have > been able to access it in the first place. > > "All sorts of kernel panics and errors about services not > being able to start" is *extremely* generic though, you'll > have to be way more specific if you hope to get any help :) > > > So I tried the same thing on ubuntu 14.04.2 LTS which > > installed qemu-kvm 2.0.0 and libvirt 1.2.2 > > > > Same config xml, but this time it worked better -I was > > not getting the kernel panics. > > Did you perform a new installation on the Ubuntu host? > Or did you copy the qcow2 image over from the custom > Linux host? Did you try going the other way around, eg. > copy the working guest from the Ubuntu host to the > custom Linux host? > > > The OS I'm installing does not support IDE disks, it > > needs a virtio disk. > > And your guest configuration supplies one, so you should > be all set on that front. > > > The obvious solution here would be to try and get a newer > > version of qemu, but since we're talking about a custom > > built Linux I'd have to add the package manually and > > compile from source...which cakes a long time to do. So > > before attempting that....just wondering....is there a > > better way? Anything I can try? > > I think you're seriously overestimating the time it would > take to compile QEMU or libvirt from source ;) > > An hour or so should be plenty to rebuild both components > from source, and most of that time would be spent figuring > out and gathering the build requirements rather than > compiling. > > -- > Andrea Bolognani / Red Hat / Virtualization >-- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you receive this in error please contact the sender and delete the material from any computer immediately. It is the policy of Klas Limited to disavow the sending of offensive material and should you consider that the material contained in the message is offensive you should contact the sender immediately and also your I.T. Manager. Klas Telecom Inc., a Virginia Corporation with offices at 1101 30th St. NW, Washington, DC 20007. Klas Limited (Company Number 163303) trading as Klas Telecom, an Irish Limited Liability Company, with its registered office at Fourth Floor, One Kilmainham Square, Inchicore Road, Kilmainham, Dublin 8, Ireland.
Martin Kletzander
2016-Oct-05 15:18 UTC
Re: [libvirt-users] problem with disk virtio driver
On Wed, Oct 05, 2016 at 03:00:40PM +0100, Andrei Perietanu wrote:>Hi Andrea, > Thanks for the reply; > To shed some more light on the matter I performed a few more tests; each >time doing a clean install. I installed ubuntu14.04 as the guest OS, >keeping everything else the same. >On my custom Linux I've created ubuntu VMs before (using ide drivers) and >it all works file. This time I created the VM using virtio disk drivers andSo switching only the guest OS (keeping the host OS, domain XML and everything) works, so how can the problem be anywhere else than the guest OS? You might be, most probably, missing some kernel option. What is the difference between the installer and the system installed? Are they using the same kernel? Accessing the same things?>the installation didn't even finish. It reported a disk related error >saying it's not being able to read from /dev/vda. I restarted the >machine...same error.You're adding more configurations into the mix, let's skip that and only talk about what you had before, the IDE and ubuntu/your distro.> Just to make sure that I have not messed anything up, I did the same on >the ubuntu host, so installed ubuntu guest on an ubuntu host uding the same >guest config xml. This time everything worked fine. So it looks like a >problem with the kvm virtio drivers. > > I was trying to stay away from updating the qemu package because adding >the package takes a long time (usually, because of missing dependencies), >but I'm not sure I have any other option at this point... >Are there that many since 1.1.2? I don't think that much has changed. But it should be solvable without updating (plus the update might not fix it for you.
Andrea Bolognani
2016-Oct-05 15:42 UTC
Re: [libvirt-users] problem with disk virtio driver
On Wed, 2016-10-05 at 15:00 +0100, Andrei Perietanu wrote:> Hi Andrea, > Thanks for the reply; > To shed some more light on the matter I performed a few > more tests; each time doing a clean install. I installed > ubuntu14.04 as the guest OS, keeping everything else the > same. > On my custom Linux I've created ubuntu VMs before (using > ide drivers) and it all works file. This time I created the > VM using virtio disk drivers and the installation didn't > even finish. It reported a disk related error saying it's > not being able to read from /dev/vda. I restarted the > machine...same error.Okay, that makes more sense :) If the OS installer can access the disk, the installed OS should as well - or at the very least it should be possible to configure it to do so, eg. by including the relevant kernel modules in the initramfs.> Just to make sure that I have not messed anything up, > I did the same on the ubuntu host, so installed ubuntu guest > on an ubuntu host uding the same guest config xml. This time > everything worked fine. So it looks like a problem with the > kvm virtio drivers. > > I was trying to stay away from updating the qemu package > because adding the package takes a long time (usually, > because of missing dependencies), but I'm not sure I have > any other option at this point...You should really try taking one of the Ubuntu-on-virtio guests that you managed to create successfully on the Ubuntu host and copying it over to the custom Linux host (guest configuration + qcow2 disk image) to see whether it can boot. Failing that I guess upgrading QEMU is your best bet. -- Andrea Bolognani / Red Hat / Virtualization
Andrei Perietanu
2016-Oct-05 16:07 UTC
Re: [libvirt-users] problem with disk virtio driver
On Wed, Oct 5, 2016 at 4:18 PM, Martin Kletzander <mkletzan@redhat.com> wrote:> On Wed, Oct 05, 2016 at 03:00:40PM +0100, Andrei Perietanu wrote: > >> Hi Andrea, >> Thanks for the reply; >> To shed some more light on the matter I performed a few more tests; each >> time doing a clean install. I installed ubuntu14.04 as the guest OS, >> keeping everything else the same. >> On my custom Linux I've created ubuntu VMs before (using ide drivers) and >> it all works file. This time I created the VM using virtio disk drivers >> and >> > > So switching only the guest OS (keeping the host OS, domain XML and > everything) works, so how can the problem be anywhere else than the > guest OS? You might be, most probably, missing some kernel option. > What is the difference between the installer and the system installed? > Are they using the same kernel? Accessing the same things? > > the installation didn't even finish. It reported a disk related error >> saying it's not being able to read from /dev/vda. I restarted the >> machine...same error. >> > > You're adding more configurations into the mix, let's skip that and only > talk about what you had before, the IDE and ubuntu/your distro. > > Just to make sure that I have not messed anything up, I did the same on >> the ubuntu host, so installed ubuntu guest on an ubuntu host uding the >> same >> guest config xml. This time everything worked fine. So it looks like a >> problem with the kvm virtio drivers. >> >> I was trying to stay away from updating the qemu package because adding >> the package takes a long time (usually, because of missing dependencies), >> but I'm not sure I have any other option at this point... >> >> > Are there that many since 1.1.2? I don't think that much has changed. > But it should be solvable without updating (plus the update might not > fix it for you. >Let me try and recap what is happening : On my custom embedded linux, using the same domain config xml, just changing the disk drivers and/or the iso Ubuntu.iso + ide disk drivers -> works Ubuntu.iso + virio disk drivers -> does not work; errors when reading from /dev/vda customLinuxOS.iso + virtio drivers -> does not seem to work; kernel panics and services stop working On Ubuntu10.04 host, using the same domain config xml as before, just changing the iso Ubuntu.iso + virtio disk drivers -> vorks customLinuxOS.iso + virtio drivers -> works This sounds to me like a problem with kvm virtio drivers (since when using ide drivers installing ubuntu as a guest works) If there is anything I'm missing, or you think I should try ..I'm open to trying it. Thanks, Andrei -- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you receive this in error please contact the sender and delete the material from any computer immediately. It is the policy of Klas Limited to disavow the sending of offensive material and should you consider that the material contained in the message is offensive you should contact the sender immediately and also your I.T. Manager. Klas Telecom Inc., a Virginia Corporation with offices at 1101 30th St. NW, Washington, DC 20007. Klas Limited (Company Number 163303) trading as Klas Telecom, an Irish Limited Liability Company, with its registered office at Fourth Floor, One Kilmainham Square, Inchicore Road, Kilmainham, Dublin 8, Ireland.