[libvirt-users] Error creating a new vm

Hi, I wonder if anyone can help me with this, I have been trying to get a vm up and running for a while now and cant for the life of me work out why it isnt working. The errors I get arnt very helpful and im at a loss as how to debug this any further. Here is the command and output that I get...(Also nothing shows up with virsh list --all after so its starting to install then dropping out) Hope someone can help. Thanks! [root@server ~]# /usr/bin/virt-install -n test01 -r 512 --os-variant=virtio26 -l http://172.16.0.100/iso/centos-5.5/ --nographics --noautoconsole --disk path=/dev/vg_storage/test01, bus=virtio -w bridge:br0 -x "console=ttyS0 ks=http://172.16.0.100/ks/ks-vm.cfg" -d -v Sun, 19 Dec 2010 20:45:05 DEBUG Requesting libvirt URI default Sun, 19 Dec 2010 20:45:05 DEBUG Received libvirt URI 'qemu:///system' Sun, 19 Dec 2010 20:45:05 DEBUG Requesting virt method 'hvm' Sun, 19 Dec 2010 20:45:05 DEBUG Received virt method 'hvm' Sun, 19 Dec 2010 20:45:05 DEBUG Hypervisor name is 'qemu' Sun, 19 Dec 2010 20:45:05 DEBUG parse_disk: returning ('/dev/vg_storage/test01', None, None, 'disk', None, False, False, None, True, None) Sun, 19 Dec 2010 20:45:05 DEBUG Setting size for existing storage to '10.0' Sun, 19 Dec 2010 20:45:05 DEBUG Detected storage as type 'block' Sun, 19 Dec 2010 20:45:05 DEBUG Setting size for existing storage to '10.0' Sun, 19 Dec 2010 20:45:05 DEBUG Detected storage as type 'block' Sun, 19 Dec 2010 20:45:05 DEBUG Setting size for existing storage to '10.0' Sun, 19 Dec 2010 20:45:05 DEBUG Detected storage as type 'block' Sun, 19 Dec 2010 20:45:05 DEBUG Setting os type to 'linux' for variant 'virtio26' Sun, 19 Dec 2010 20:45:05 DEBUG DistroInstaller location is a network source. Starting install... Sun, 19 Dec 2010 20:45:05 DEBUG Attempting to detect distro: Sun, 19 Dec 2010 20:45:05 DEBUG HTTP hasFile: didn't find http://172.16.0.100/iso/centos-5.5/.treeinfo Sun, 19 Dec 2010 20:45:05 DEBUG HTTP hasFile: didn't find http://172.16.0.100/iso/centos-5.5/Fedora Sun, 19 Dec 2010 20:45:05 DEBUG HTTP hasFile: didn't find http://172.16.0.100/iso/centos-5.5/Server Sun, 19 Dec 2010 20:45:05 DEBUG HTTP hasFile: didn't find http://172.16.0.100/iso/centos-5.5/Client Sun, 19 Dec 2010 20:45:05 DEBUG HTTP hasFile: didn't find http://172.16.0.100/iso/centos-5.5/RedHat Sun, 19 Dec 2010 20:45:05 DEBUG Detected a CentOS distro Sun, 19 Dec 2010 20:45:05 DEBUG Fetching URI: http://172.16.0.100/iso/centos-5.5/images/pxeboot/vmlinuz Sun, 19 Dec 2010 20:45:05 DEBUG Saved file to /var/lib/libvirt/boot/virtinst-vmlinuz.MKBsh1 Retrieving file vmlinuz... | 1.9 MB 00:00 Sun, 19 Dec 2010 20:45:05 DEBUG Fetching URI: http://172.16.0.100/iso/centos-5.5/images/pxeboot/initrd.img Sun, 19 Dec 2010 20:45:05 DEBUG Saved file to /var/lib/libvirt/boot/virtinst-initrd.img.T2dfhc Retrieving file initrd.img... | 7.7 MB 00:00 Sun, 19 Dec 2010 20:45:05 DEBUG Creating guest from: <domain type='qemu'> <name>test01</name> <currentMemory>524288</currentMemory> <memory>524288</memory> <uuid>5cbb288b-d9f7-bae4-0d05-9157553f53fe</uuid> <os> <type arch='x86_64'>hvm</type> <kernel>/var/lib/libvirt/boot/virtinst-vmlinuz.oddwKg</kernel> <initrd>/var/lib/libvirt/boot/virtinst-initrd.img.POxZ5X</initrd> <cmdline>method=http://172.16.0.100/iso/centos-5.5/ console=ttyS0 ks=http://172.16.0.100/ks/ks-vm.cfg</cmdline> </os> <features> <acpi/><apic/><pae/> </features> <clock offset="utc"/> <on_poweroff>destroy</on_poweroff> <on_reboot>destroy</on_reboot> <on_crash>destroy</on_crash> <vcpu>1</vcpu> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <console type='pty'/> <disk type='block' device='disk'> <driver name='qemu' cache='none'/> <source dev='/dev/vg_storage/test01'/> <target dev='hda' bus='ide'/> </disk> <interface type='bridge'> <source bridge='br0'/> <mac address='54:52:00:66:25:22'/> </interface> <input type='mouse' bus='ps2'/> </devices> </domain> Sun, 19 Dec 2010 20:44:48 DEBUG Removing /var/lib/libvirt/boot/virtinst-vmlinuz.oddwKg Sun, 19 Dec 2010 20:44:48 DEBUG Removing /var/lib/libvirt/boot/virtinst-initrd.img.POxZ5X Sun, 19 Dec 2010 20:44:48 ERROR internal error Domain ims-gl-lin01g01 didn't show up Domain installation may not have been successful. If it was, you can restart your domain by running 'virsh start test01'; otherwise, please restart your installation. Sun, 19 Dec 2010 20:44:48 ERROR internal error Domain test01 didn't show up Traceback (most recent call last): File "/usr/bin/virt-install", line 889, in ? main() File "/usr/bin/virt-install", line 751, in main start_time, guest.start_install) File "/usr/bin/virt-install", line 813, in do_install dom = install_func(conscb, progresscb, wait=(not wait)) File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 541, in start_install return self._do_install(consolecb, meter, removeOld, wait) File "/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 633, in _do_install self.domain = self.conn.createLinux(install_xml, 0) File "/usr/lib64/python2.4/site-packages/libvirt.py", line 974, in createLinux if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self) libvirtError: internal error Domain ims-gl-lin01g01 didn't show up

于 2010年12月20日 04:48, Anthony Davis 写道:
Hi,
I wonder if anyone can help me with this, I have been trying to get a vm up and running for a while now and cant for the life of me work out why it isnt working. The errors I get arnt very helpful and im at a loss as how to debug this any further.
Here is the command and output that I get...(Also nothing shows up with virsh list --all after so its starting to install then dropping out)
Hope someone can help. Thanks!
[root@server ~]# /usr/bin/virt-install -n test01 -r 512 --os-variant=virtio26 -l http://172.16.0.100/iso/centos-5.5/ --nographics --noautoconsole --disk path=/dev/vg_storage/test01, bus=virtio -w bridge:br0 -x "console=ttyS0 ks=http://172.16.0.100/ks/ks-vm.cfg" -d -v Hi, Anthony
Which libvirt version do you use? If I'm right, it should be caused by a recent patch. /* wait for qemu process to to show up */ if (ret == 0) { if (virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) { qemuReportError(VIR_ERR_INTERNAL_ERROR, _("Domain %s didn't show up\n"), vm->def->name); ret = -1; } #if 0 } else if (ret == -2) { /* * XXX this is bogus. It isn't safe to set vm->pid = child * because the child no longer exists. */ /* The virExec process that launches the daemon failed. Pending on * when it failed (we can't determine for sure), there may be * extra info in the domain log (if the hook failed for example). * * Pretend like things succeeded, and let 'WaitForMonitor' report * the log contents for us. */ vm->pid = child; ret = 0; #endif } could you check your guest log, and also libvirtd log? /var/log/libvirt/qemu/$guest.log /var/log/messages Regards Osier

On 20 Dec 2010, at 02:09, Osier Yang wrote:
于 2010年12月20日 04:48, Anthony Davis 写道:
Hi,
I wonder if anyone can help me with this, I have been trying to get a vm up and running for a while now and cant for the life of me work out why it isnt working. The errors I get arnt very helpful and im at a loss as how to debug this any further.
Here is the command and output that I get...(Also nothing shows up with virsh list --all after so its starting to install then dropping out)
Hope someone can help. Thanks!
[root@server ~]# /usr/bin/virt-install -n test01 -r 512 --os-variant=virtio26 -l http://172.16.0.100/iso/centos-5.5/ --nographics --noautoconsole --disk path=/dev/vg_storage/test01, bus=virtio -w bridge:br0 -x "console=ttyS0 ks=http://172.16.0.100/ks/ks-vm.cfg" -d -v Hi, Anthony
Which libvirt version do you use? If I'm right, it should be caused by a recent patch.
/* wait for qemu process to to show up */ if (ret == 0) { if (virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) { qemuReportError(VIR_ERR_INTERNAL_ERROR, _("Domain %s didn't show up\n"), vm->def->name); ret = -1; } #if 0 } else if (ret == -2) { /* * XXX this is bogus. It isn't safe to set vm->pid = child * because the child no longer exists. */
/* The virExec process that launches the daemon failed. Pending on * when it failed (we can't determine for sure), there may be * extra info in the domain log (if the hook failed for example). * * Pretend like things succeeded, and let 'WaitForMonitor' report * the log contents for us. */ vm->pid = child; ret = 0; #endif }
could you check your guest log, and also libvirtd log?
/var/log/libvirt/qemu/$guest.log /var/log/messages
Regards Osier
Hi Osier, Here are the version numbers: virsh # version Compiled against library: libvir 0.6.3 Using library: libvir 0.6.3 Using API: QEMU 0.6.3 Running hypervisor: QEMU 0.9.0 Also here are the logs: # cat /var/log/libvirt/qemu/test01.log LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/ /usr/bin/qemu-system-x86_64 -S -M rhel5.4.0 -no-kqemu -m 512 -smp 1 -nographic -monitor pty -pidfile /var/run/libvirt/qemu//test01.pid -no-reboot -boot c -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.wmv9KP -initrd /var/lib/libvirt/boot/virtinst-initrd.img.PBIGHX -append method=http://10.0.0.100/iso/centos-5.5/ console=ttyS0 ks=http://10.0.0.100/ks/ks-vm.cfg -hda /dev/vg_storage/test01 -net nic,macaddr=54:52:00:6f:8e:05,vlan=0 -net tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb Supported machines are: pc Standard PC (default) isapc ISA-only PC # cat /var/log/messages | grep "10:42" Dec 20 10:42:11 ims-gl-lin01 libvirtd: 10:42:11.309: error : Domain not found: no domain with matching name 'test01' Dec 20 10:42:11 ims-gl-lin01 libvirtd: 10:42:11.329: error : Domain not found: no domain with matching uuid '?ނ?P??' Dec 20 10:42:11 ims-gl-lin01 libvirtd: 10:42:11.600: error : Domain not found: no domain with matching name 'test01' Dec 20 10:42:11 ims-gl-lin01 libvirtd: 10:42:11.611: warning : Unexpected exit status '1', qemu probably failed Dec 20 10:42:11 ims-gl-lin01 kernel: device vnet0 entered promiscuous mode Dec 20 10:42:11 ims-gl-lin01 kernel: type=1700 audit(1292841731.617:22): dev=vnet0 prom=256 old_prom=0 auid=4294967295 ses=4294967295 Dec 20 10:42:11 ims-gl-lin01 kernel: br0: port 2(vnet0) entering learning state Dec 20 10:42:12 ims-gl-lin01 avahi-daemon[3118]: New relevant interface vnet0.IPv6 for mDNS. Dec 20 10:42:12 ims-gl-lin01 avahi-daemon[3118]: Joining mDNS multicast group on interface vnet0.IPv6 with address fe80::fc52:ff:fe6f:8e05. Dec 20 10:42:12 ims-gl-lin01 avahi-daemon[3118]: Registering new address record for fe80::fc52:ff:fe6f:8e05 on vnet0. Dec 20 10:42:21 ims-gl-lin01 libvirtd: 10:42:21.720: error : internal error Domain test01 didn't show up Dec 20 10:42:21 ims-gl-lin01 avahi-daemon[3118]: Interface vnet0.IPv6 no longer relevant for mDNS. Dec 20 10:42:21 ims-gl-lin01 avahi-daemon[3118]: Leaving mDNS multicast group on interface vnet0.IPv6 with address fe80::fc52:ff:fe6f:8e05. Dec 20 10:42:21 ims-gl-lin01 kernel: br0: port 2(vnet0) entering disabled state Dec 20 10:42:21 ims-gl-lin01 avahi-daemon[3118]: Withdrawing address record for fe80::fc52:ff:fe6f:8e05 on vnet0. Dec 20 10:42:21 ims-gl-lin01 kernel: device vnet0 left promiscuous mode Dec 20 10:42:21 ims-gl-lin01 kernel: type=1700 audit(1292841741.733:23): dev=vnet0 prom=0 old_prom=256 auid=4294967295 ses=4294967295 Dec 20 10:42:21 ims-gl-lin01 kernel: br0: port 2(vnet0) entering disabled state Hope you can help. Kind Regads Tony

Here are the version numbers:
virsh # version Compiled against library: libvir 0.6.3 Using library: libvir 0.6.3 Using API: QEMU 0.6.3 Running hypervisor: QEMU 0.9.0
Also here are the logs:
# cat /var/log/libvirt/qemu/test01.log LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/ /usr/bin/qemu-system-x86_64 -S -M rhel5.4.0 -no-kqemu -m 512 -smp 1 -nographic -monitor pty -pidfile /var/run/libvirt/qemu//test01.pid -no-reboot -boot c -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.wmv9KP -initrd /var/lib/libvirt/boot/virtinst-initrd.img.PBIGHX -append method=http://10.0.0.100/iso/centos-5.5/ console=ttyS0 ks=http://10.0.0.100/ks/ks-vm.cfg -hda /dev/vg_storage/test01 -net nic,macaddr=54:52:00:6f:8e:05,vlan=0 -net tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb Supported machines are: pc Standard PC (default) isapc ISA-only PC
Ah, that is the problem. Your /usr/bin/qemu-system-x86_64 binary only supports the above machine types but domain XML wants rhel5.4.0 machine type. Did you install qemu from an unofficial package or something like that? Since normally it supports rhel5.4.0 and the binary is called /usr/libexec/qemu-kvm. If you really want to use the /usr/bin/qemu-system-x86_64 binary, you need to make virt-install use "pc" machine type since by default it doesn't use any and libvirt 0.6.3 selects rhel5.4.0 as a default (newer libvirt versions are more clever in this). However, virt-install doesn't seem to have an option which could be used for overriding machine type :-/ You would need to change the type element in domain XML from <type arch='x86_64'>hvm</type> to <type arch='x86_64' machine='pc'>hvm</type> The easiest fix is to use the /usr/libexec/qemu-kvm binary, which is provided by kvm package. Jirka

On 20 Dec 2010, at 12:57, Jiri Denemark wrote:
Here are the version numbers:
virsh # version Compiled against library: libvir 0.6.3 Using library: libvir 0.6.3 Using API: QEMU 0.6.3 Running hypervisor: QEMU 0.9.0
Also here are the logs:
# cat /var/log/libvirt/qemu/test01.log LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/ /usr/bin/qemu-system-x86_64 -S -M rhel5.4.0 -no-kqemu -m 512 -smp 1 -nographic -monitor pty -pidfile /var/run/libvirt/qemu//test01.pid -no-reboot -boot c -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.wmv9KP -initrd /var/lib/libvirt/boot/virtinst-initrd.img.PBIGHX -append method=http://10.0.0.100/iso/centos-5.5/ console=ttyS0 ks=http://10.0.0.100/ks/ks-vm.cfg -hda /dev/vg_storage/test01 -net nic,macaddr=54:52:00:6f:8e:05,vlan=0 -net tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb Supported machines are: pc Standard PC (default) isapc ISA-only PC
Ah, that is the problem. Your /usr/bin/qemu-system-x86_64 binary only supports the above machine types but domain XML wants rhel5.4.0 machine type. Did you install qemu from an unofficial package or something like that? Since normally it supports rhel5.4.0 and the binary is called /usr/libexec/qemu-kvm. If you really want to use the /usr/bin/qemu-system-x86_64 binary, you need to make virt-install use "pc" machine type since by default it doesn't use any and libvirt 0.6.3 selects rhel5.4.0 as a default (newer libvirt versions are more clever in this). However, virt-install doesn't seem to have an option which could be used for overriding machine type :-/ You would need to change the type element in domain XML from <type arch='x86_64'>hvm</type> to <type arch='x86_64' machine='pc'>hvm</type>
The easiest fix is to use the /usr/libexec/qemu-kvm binary, which is provided by kvm package.
Jirka
Hi Jirka, Thanks for your reply :) Well iv installed the default RPMS via Centos (5.5) How do I get around this? Isnt that kind of weird that you an install a rhel machine on what is essentially a rhel machine? Kind Regards Tony

Hi Tony,
Well iv installed the default RPMS via Centos (5.5)
Hmm, than you should probably ask CentOS guys for help. They apparently left RHEL's libvirt but made their own qemu package. Since libvirt 0.6.3 wasn't very smart, it had to be modified to support machine types provided by RHEL's qemu. Newer libvirt releases have automatic runtime detection of supported machine types so they don't suffer this issue.
How do I get around this? Isnt that kind of weird that you an install a rhel machine on what is essentially a rhel machine?
The OS you are trying to install inside a vm doesn't matter here. It's just an issue of your host OS (which is not exactly RHEL). To work around this, you basically have three options. 1. Do the install manually, that is download the images virt-install downloads for you, take the XML generated by virt-install, add the "machine='pc'" attribute in <type> element, define the XML using virsh define and start it with virsh start. 2. Rename /usr/bin/qemu-system-x86_64 to /usr/bin/qemu-system-x86_64.orig, create /usr/bin/qemu-system-x86_64 shell script, which executes /usr/bin/qemu-system-x86_64.orig with -M pc instead of -M rhel5.4.0. Once you have the machine installed, you can use virsh edit VM to change machine type to 'pc' and then you can rename /usr/bin/qemu-system-x86_64.orig back to /usr/bin/qemu-system-x86_64. 3. Install upstream virt-install and use its --machine as suggested by Cole. Jirka

On 12/20/2010 07:57 AM, Jiri Denemark wrote:
Here are the version numbers:
virsh # version Compiled against library: libvir 0.6.3 Using library: libvir 0.6.3 Using API: QEMU 0.6.3 Running hypervisor: QEMU 0.9.0
Also here are the logs:
# cat /var/log/libvirt/qemu/test01.log LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/ /usr/bin/qemu-system-x86_64 -S -M rhel5.4.0 -no-kqemu -m 512 -smp 1 -nographic -monitor pty -pidfile /var/run/libvirt/qemu//test01.pid -no-reboot -boot c -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.wmv9KP -initrd /var/lib/libvirt/boot/virtinst-initrd.img.PBIGHX -append method=http://10.0.0.100/iso/centos-5.5/ console=ttyS0 ks=http://10.0.0.100/ks/ks-vm.cfg -hda /dev/vg_storage/test01 -net nic,macaddr=54:52:00:6f:8e:05,vlan=0 -net tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb Supported machines are: pc Standard PC (default) isapc ISA-only PC
Ah, that is the problem. Your /usr/bin/qemu-system-x86_64 binary only supports the above machine types but domain XML wants rhel5.4.0 machine type. Did you install qemu from an unofficial package or something like that? Since normally it supports rhel5.4.0 and the binary is called /usr/libexec/qemu-kvm. If you really want to use the /usr/bin/qemu-system-x86_64 binary, you need to make virt-install use "pc" machine type since by default it doesn't use any and libvirt 0.6.3 selects rhel5.4.0 as a default (newer libvirt versions are more clever in this). However, virt-install doesn't seem to have an option which could be used for overriding machine type :-/
Just an FYI, upstream virt-install does have a --machine option - Cole
participants (4)
-
Anthony Davis
-
Cole Robinson
-
Jiri Denemark
-
Osier Yang