[libvirt-users] Can't save domain: unexpectedly failed
by Mauricio Tavares
I am running libvirt 0.9.8,
virsh -V
Virsh command line tool of libvirt 0.9.8
See web site at http://libvirt.org/
Compiled with support for:
Hypervisors: Xen QEmu/KVM UML OpenVZ LXC Test
Networking: Remote Daemon Network Bridging Nwfilter VirtualPort
Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM
Miscellaneous: AppArmor Secrets Debug Readline
in an ubuntu 12.04.1 install. I created a vm client and wanted to save it:
root@vmhost:/tmp# /usr/bin/virsh save test /export/vms/dump/test.dump
error: Failed to save domain test to /export/vms/dump/test.dump
error: operation failed: domain save job: unexpectedly failed
root@vmhost:/tmp# cat /var/log/libvirt/qemu/test.log
2013-02-04 17:06:10.792+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.14 -cpu
core2duo,+lahf_lm,+aes,+popcnt,+sse4.2,+sse4.1,+cx16,-monitor,-vme
-enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name test
-uuid 82758b52-77e9-494c-8a9d-c666949c978c -nodefconfig -nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -boot order=cd,menu=on -drive
file=/dev/mapper/vmhost_vg1-test,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0
-drive if=none,media=cdrom,id=drive-ide0-0-0,readonly=on,format=raw
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0
-drive if=none,media=cdrom,id=drive-ide0-0-1,readonly=on,format=raw
-device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1
-netdev tap,fd=19,id=hostnet0 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=00:16:3e:6f:9c:6b,bus=pci.0,addr=0x3
-usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 -vga cirrus -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
root@vmhost:/tmp#
Does anyone know what could have caused this? Is there another log I
can check for what this unexpected failure really is?
11 years, 9 months
[libvirt-users] How to connect to console of domain on PowerPC?
by Yin Olivia-R63875
Hi,
I tried to use libvirt to run KVM/QEMU on Freescale PowerPC platforms.
So far there's only one serial device (spapr-vty) defined in QEMU to work as console for IBM PSeries platform.
There's no serial device support in QEMU for Freescale PowerPC (ePAPR).
libvirt/src/qemu/qemu_command.c
/* This function generates the correct '-device' string for character
* devices of each architecture.
*/
char *
qemuBuildChrDeviceStr(virDomainChrDefPtr serial,
virBitmapPtr qemuCaps,
char *os_arch,
char *machine)
{
virBuffer cmd = VIR_BUFFER_INITIALIZER;
if (STREQ(os_arch, "ppc64") && STREQ(machine, "pseries")) {
if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
serial->source.type == VIR_DOMAIN_CHR_TYPE_PTY &&
serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) {
virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s",
serial->info.alias);
if (qemuBuildDeviceAddressStr(&cmd, &serial->info, qemuCaps) < 0)
goto error;
}
} else
virBufferAsprintf(&cmd, "isa-serial,chardev=char%s,id=%s",
serial->info.alias, serial->info.alias);
if (virBufferError(&cmd)) {
virReportOOMError();
goto error;
}
return virBufferContentAndReset(&cmd);
error:
virBufferFreeAndReset(&cmd);
return NULL;
}
We usually connect guest with telnet.
For instance,
/usr/bin/qemu-system-ppc -name demo -M ppce500v2 -enable-kvm -m 256 -nographic -kernel /media/ram/uImage -initrd /media/ram/ramdisk -append "root=/dev/ram rw console=ttyS0,115200" -serial tcp::4445,server
Then to run 'telnet 10.193.20.xxx 4445' could connect the guest.
The temporary workaround is not add '-device' string after '-serial' option.
diff -Nur libvirt-0.10.1.orig/src/qemu/qemu_command.c libvirt-0.10.1/src/qemu/qemu_command.c
--- libvirt-0.10.1.orig/src/qemu/qemu_command.c 2012-08-30 15:35:18.000000000 +0530
+++ libvirt-0.10.1/src/qemu/qemu_command.c 2012-10-05 17:19:32.060368755 +0530
@@ -5501,13 +5501,15 @@
virCommandAddArg(cmd, devstr);
VIR_FREE(devstr);
- virCommandAddArg(cmd, "-device");
- if (!(devstr = qemuBuildChrDeviceStr(serial, qemuCaps,
+ if (!STREQ(def->os.arch, "ppc")) {
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildChrDeviceStr(serial,
+ qemuCaps,
def->os.arch,
def->os.machine)))
- goto error;
- virCommandAddArg(cmd, devstr);
- VIR_FREE(devstr);
+ goto error;
+ virCommandAddArg(cmd, devstr);
+ VIR_FREE(devstr);
+ }
} else {
virCommandAddArg(cmd, "-serial");
if (!(devstr = qemuBuildChrArgStr(&serial->source, NULL)))
Applying the above patch to libvirt, all the other domain control commands could work except 'virsh console domain'.
# cat >demo.args <<EOF
> /usr/bin/qemu-system-ppc -name demo -M ppce500v2 -enable-kvm -m 256
> -nographic -kernel /media/ram/uImage -initrd /media/ram/ramdisk
> -append "root=/dev/ram rw console=ttyS0,115200" -serial
> tcp::4445,server -net nic EOF
# vi demo.args
/usr/bin/qemu-system-ppc -name demo -M ppce500v2 -enable-kvm -m 256 -nographic -kernel /media/ram/uImage -initrd /media/ram/ramdisk -append "root=/dev/ram rw console=ttyS0,115200" -serial tcp::4445,server -net nic
# virsh domxml-from-native qemu-argv demo.args >demo.xml # vi demo.xml <domain type='kvm'>
<name>demo</name>
<uuid>985d7154-83c8-0763-cbac-ecd159eee8a6</uuid>
<memory unit='KiB'>262144</memory>
<currentMemory unit='KiB'>262144</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='ppc' machine='ppce500v2'>hvm</type>
<kernel>/media/ram/uImage</kernel>
<initrd>/media/ram/ramdisk</initrd>
<cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-ppc</emulator>
<serial type='tcp'>
<source mode='bind' host='' service='4445'/>
<protocol type='raw'/>
<target port='0'/>
</serial>
<console type='tcp'>
<source mode='bind' host='' service='4445'/>
<protocol type='raw'/>
<target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
</domain>
# virsh -c qemu:///system define demo.xml # virsh -c qemu:///system start demo
But it seemed that can't connect to the console.
# virsh -c qemu:///system console demo
Connected to domain test
Escape character is ^]
error: internal error character device (null) is not using a PTY
I tried also use '-serial pty' option,
/usr/bin/qemu-system-ppc -name test -M ppce500v2 -enable-kvm -m 256 -nographic -kernel /media/ram/uImage -initrd /media/ram/ramdisk -append "root=/dev/ram rw console=ttyS0,115200" -serial pty
Then there's no other output after the below message:
# virsh -c qemu:///system console demo
Connected to domain test
Escape character is ^]
It seemed not libvirt group issue.
I also tried the LXC.
It could connect to the console if <init>/bin/sh/</init> instead of <init>/sbin/init</init>
Best Regards,
Olivia
11 years, 9 months
[libvirt-users] Networking problem - multiple guests using MacVTap in bridge mode
by Filip Korzeniowski
Dear list,
I am getting strange problems using a setup outlined in the subject. I
want to run three guests on a single kvm host. The guests are connected
through macvtap directly to the network device 'eth0' of the host using
this configuration:
<interface type='direct'>
<mac address='52:54:00:86:3f:24'/>
<source dev='eth0' mode='bridge'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
Each guest is assigned a static ip address, no DHCP is involved.
When I start the guests the macvtap links are generated automatically,
ifconfig outputs this:
macvtap2 Link encap:Ethernet HWaddr 52:54:00:86:3f:24
inet6 addr: fe80::5054:ff:fe86:3f24/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:10946 (10.6 KiB) TX bytes:2184 (2.1 KiB)
However, depending on the startup order, only the first two guests are
able to reach the network! I can't access the third one. After the
initial startup, the last host won't connect to the network even if I restart
all the guests in a differnt order. I can only reset this by restarting
the host.
As far as I have tested this, it really depends on the initial startup order
of the guests after a host restart. This seems very strange to me.
As I am quite new to all of this, I have no clue how to start searching for the
problem here. Can anyone provide me with some hints?
11 years, 9 months
[libvirt-users] control ip address of VM
by zorg
HI
I have 15 vm (libvirt + kvm) with a network brigde and ip address like
192.168.0.1 VM1
192.168.0.2 VM2
192.168.0.3 VM3
.....
The vm are use by other people and I want to be sure that if someone
change the ip of VM3 to 192.168.0.1 it will filter it network traffic
for him and can't flood the VM1
What the best way to achieve this
Hope I m clear enough
11 years, 9 months
[libvirt-users] Sanlock gives up lock when VM is paused
by Michael Rodrigues
Hello,
I'm using libvirt and sanlock on qemu-kvm guests. Each guest has it's
own Logical Volume for it's root filesystem. Sanlock is configured and
working and prevents me from starting the same VM twice on multiple
nodes and corrupting it's root filesystem. Each VM's domain XML resides
on 2 servers that share the LVM volume group over fiber channel.
In testing, I noticed that if I pause a VM on node 1, the sanlock lock
is relinquished, and I am able to start the same VM, using the same root
filesystem, on node 2. I get a lock error when unpausing node 1's VM if
node 2's copy is still running, but by this point, the disk may already
be corrupted.
Is it necessary that paused VMs don't get to keep their locks? Is there
a way to configure sanlock to lock when a VM is paused?
Versions:
sanlock(-devel, -lib) 2.3-1.el6
libvirt(-lock-sanlock, -client) 0.9.10-21.el6_3.8
I'm using NFS for the lockspace.
Thanks,
Michael
--
Michael Rodrigues
Interim Help Desk Manager
Gevirtz Graduate School of Education
Education Building 4203
(805) 893-8031
help(a)education.ucsb.edu
11 years, 9 months
[libvirt-users] Live Migration and KSM merging
by James
Hi,
Could anyone provide (or point me to) information on how KSM merging
behaves when performing live migrations? Does libvirt perform any
special work to trigger KSM scanning of the migrated pages?
Any guidance is appreciated.
James
11 years, 9 months
[libvirt-users] How to copy snapshots of a VM to the other computer.
by Jonghee Youn
Currently, I've tried to move qemu VM image to a new computer.
So, I copied VM image files in /var/lib/libvirt/images, VM xml files in
/etc/libvirt/qemu, VM snapshot files in /var/lib/libvirt/qemu/snapshot to
the same places at the new computer.
Everything is OK except snapshot!!
When I use "qemu-img info" for the copied VM image, I can see the snapshot
list in the result as shown below:
root@doc-scheduler:/var/lib/libvirt/images# qemu-img info VM22.img
image: VM22.img
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 1.7G
cluster_size: 65536
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 VM22_A 228M 2013-01-31 10:06:45 00:06:38.110
But, when I use "virsh snapshot-list " for the copied VM, the result is
empty as follows:
root@doc-scheduler:~# virsh snapshot-list VM22
Name Creation Time State
------------------------------------------------------------
and of course, I can't revert to the snapshot.
Please let me know how I can copy my snapshots to the new machine.
Thanks.
11 years, 9 months
[libvirt-users] migrate vm images to new storage pool
by Jamie Fargen
I am searching for directions for using live block migration to copy
running vm's to a different storage pool.
Example: VM1 running on HOST1, the image(s) for VM1 are stored in
/var/lib/libvirt/images. I'd like to copy the disk image(s) that VM1
is using to /nfs/images. Without stopping/pausing/powering down the
VM.
Regards,
Jamie Ian Fargen
11 years, 9 months