Tag Info

Hot answers tagged

24

Qemu: QEmu is a complete and standalone software of its own. You use it to emulate machines, it is very flexible and portable. Mainly it works by a special 'recompiler' that transforms binary code written for a given processor into another one (say, to run MIPS code on a PPC mac, or ARM in an x86 PC). To emulate more than just the processor, Qemu ...


12

The image will not shrink automatically, since when you delete files, you don't actually delete data (this is why undelete works). Qemu has a facility to shrink qcow2 images back, but what the utility does is really deduplicate the zeroes from the disk, leaving all other information intact. So the idea would be to: Zero-fill the drive (dd if=/dev/zero ...


12

You are partially correct. Just be careful, as there can be some confusion. KVM is the name of the virtualization technology in the Linux kernel. KVM is also commonly used as the name of a fork (a more accurate name would be qemu-kvm) of the QEMU project with better support for the hardware virtualization. This claim was confirmed by the QEMU project, but ...


10

When working together, KVM arbitrates access to the CPU and memory, and QEMU emulates the hardware resources (hard disk, video, USB, etc.). When working alone, QEMU emulates both CPU and hardware.


7

Did you try to 'telnet' way? I.e.: Ctrl+] telnet> quit


6

This issue was caused by the way libvirt uses apparmor. The default behavior is to provide some protection for the host against the guest by restricting which files the virtualization process on the host is allowed to access. libvirt knows that the virtualization process (kvm in this case) needs the disk image in order to operate properly, so it creates an ...


6

Storing QEMU-images in a database is on many levels very impractical. Using an ordinary filesystem for the storage itself, and referencing the files from the database is a lot simpler - and will probably grant you what you're trying to achieve. If this doesn't work for you, I'd like to know more about what you're trying to achieve.


6

When connected to the monitor via telnet, anything that you type will be interpreted as a command by the monitor itself. You can view the full list of commands in the QEMU Emulator User Documentation, one of which is quit (or q for short). To disconnect the telnet session you need to first use the telnet escape key which is Ctrl-] and then you can type quit ...


6

Add conv=notrunc: dd if=/dev/zero of=YOUR_IMAGE_FILE bs=512 count=1 conv=notrunc


6

Try using dd with conv=notrunc dd if=/dev/zero of=myserver.img bs=512 count=1 conv=notrunc From the dd man page notrunc do not truncate the output file e.g. ls -l myserver.img -rw-r--r-- 1 iain users 1536 Mar 27 12:31 myserver.img dd if=/dev/zero of=myserver.img bs=512 count=1 conv=notrunc ls -l myserver.img -rw-r--r-- 1 iain users ...


6

It's quite simple really. For homogeneous clusters and single host setups use the host option. For mixed clusters, use the lowest available CPU version, so if one host is Penryn and the other Nehalem, use Penryn on both. If you are using RHEV or oVirt, this is already built in. VMWare have this called "EVC" and position it as a huge feature. Getting back ...


5

If libvirt doesn't reload VM settings on start/stop, virsh edit command may help. And please write entire XML file and libvirt version Hmm... everything seems OK. Try adding <boot dev='hd'/> <boot dev='cdrom'/> <bootmenu enable='yes'/> to <os> section and look if cdrom appears in boot menu. Also try removing all <boot> records ...


5

How about this (example for vnet13): $ VNET=vnet13; for vm in $(virsh list | grep running | awk '{print $2}'); do virsh dumpxml $vm|grep -q "$VNET" && echo $vm; done Here we use virsh dumpxml to show dynamic properties about the VM, which are not available in the static XML definition of the VM in /etc/libvirt/qemu/foo.xml. Which vnetX interface ...


5

The Windows guests currently have no VirtIO Don't lose more time with tweaking anything. Install the virtIO drivers and come back. The difference is so huge that any enhancement you can find now will have no meaning with virtIO. Just an example with one of our servers: - without virtIO a W2k3 can handle about 10 Terminal Server users - with virtIO, the ...


5

I believe the tool you're looking for is kpartx. The general procedure is: List partitions in the disk image: kpartx -l /dev/vg0/mylv Add the partitions to device-mapper: kpartx -a /dev/vg0/mylv Mount the partition you're interested in: mount -o ro /dev/mapper/loop0p5 /mnt


5

I will give very rough idea/explanation. In OP situation, besides measuring within the VM, the host should be look at too. In this case, we can assume the following are correct In all the test, the host I/O(disk) bandwidth is not max out. As VM("monitoring") I/O increases with more CPUs allocated to it. If host I/O was already max out, there should be no ...


4

You probably need to make a label on the disk first. Try just running parted manually: parted /dev/hda unit GB mklabel msdos mkpartfs primary ext3 0 5


4

this is not your final answer - I would start by looking at disk iops - use tools like iostat and sar (sysstat) - find out what your practical iops are - and check if your swap is busy also I have seen similar behavior with sata drives in a software raid (md), every time a kvm guest was doing a lot of writes the vm's responsiveness lagged quite a bit. I ...


4

There's Google's ganeti. It does live migration, scheduling new guests, and restarts guests; however, it does all that without libvirt (has custom code to deal with hypervisors). It also has "unusual" security requirements (actively modifies the ssh keys of the nodes); they might not be acceptable for you.


4

KVM is a kernel module that allows, through virtualization specific CPU extensions, to schedule a VMs CPU request directly in the host CPU and RAM, with minimal amount of overhead. QEMU provides the rest of the emulated hardware, because a machine, even virtual, is not just a CPU - it's a lot of additional hardware. QEMU can also emulate the CPU, but ...


4

Qemu doesn't work in the same way many other hypervisors do. For starters, it can provide full emulation. That means you can run x86 code on an ARM processor, for example. When in KVM mode, as you're using it, it doesn't actually do that... the processor is exposed no matter what, but what is reported to the OS will be changed by the -cpu flag. If you want ...


4

Windows will only run in HVM and PV-HVM modes (which use the modified version of QEmu and require VT/AMD-V) You're looking for PV mode if you require a non-VT/AND-V CPU, and it only works with modified Operating Systems: Xen PV guest kernels exist for Linux, NetBSD, FreeBSD, OpenSolaris and Novell Netware operating systems. From: Xen Overview QEmu ...


4

try virt-sparcify - it will zerofill the unused blocks in the image and then deduplicate the zeroes


4

start using libvirt - there's no reason to use qemu-kvm directly, when you have a good management package available start using virtio devices for disks and networking define what it is you're trying to do, and ask a question then the benefits are very simple - libvirt generates the kvm command line for you, pushing in a large set of optimizations, ...


3

First, create a raw image of the required size. I'll assume 10G is enough. Using seek creates a sparse file, which saves space. dd if=/dev/null of=example.img bs=1M seek=10240 Next, create a filesystem on it. mkfs.ext4 -F example.img (Note that you need the -F option for mkfs.ext4 to operate on a file as opposed to a disk partition) Then, mount it. ...


3

The only way to add command-line switches that libvirt doesn't support yet is to create a wrapper script and change your VM's configuration to use it instead. For example, # cat >/usr/local/bin/qemu-snapshot <<'END' #!/bin/sh exec /usr/bin/qemu "$@" -snapshot END # chmod +x /usr/local/bin/qemu-snapshot # virsh -c qemu:///system edit my_vm change ...


3

Figured this out in the end. The trick is to ignore all the KVM networking nonsense. Create a bridge with brctl and then tell the KVM guest to use that as a bridge device. <interface type='bridge'> <mac address='00:a0:01:00:00:03'/> <source bridge='virbr0'/> <model type='e1000'/> </interface> And it works..


3

Some performance tips are here, you should definitely try to use raw format instead of qcow2 and raw devices instead of image files. You should also install paravirtualized disk drivers on guests and switch disk type from IDE to virtio.


3

If you want distributed image storage, QEMU supports using images on Rados Block Devices (implemented using Ceph): http://ceph.newdream.net/2010/12/rbd-upstream-updates/


3

Qemu's QMP is probably what you're looking for, but I am not aware of any tools that interface with it yet. You would have to write a script (or family of scripts) that opens the socket and sends appropriate messages to QEMU.



Only top voted, non community-wiki answers of a minimum length are eligible