EzDevInfo.com

kvm-virtualization interview questions

Top kvm-virtualization frequently asked interview questions

Difference between KVM and QEMU

I have been reading about KVM and Qemu for sometime. As of now I have a clear understanding of what they do.

KVM supports hardware virtualization to provide near native performance to the Guest Operating sytems. On the other hand QEmu emulates the target operating system.

What I am confused is to what level these two co-ordinate. Like

  1. Who manages the sharing of RAM and/or memory?
  2. Who schedules I/O operations?

Source: (StackOverflow)

How do you increase a KVM guest's disk space?

I setup an Ubuntu guest on a CentOS KVM host with initially 6GB of disk space. How do I go about increasing the Ubuntu guest's disk space from the command line?

EDIT #1: I'm using a disk image file (qemu).


Source: (StackOverflow)

Advertisements

Difference between Xen PV, Xen KVM and HVM?

I know that Xen is usually better than OpenVZ as the provider cannot oversell in Xen. However, what is the difference between Xen PV, Xen KVM and HVM (I was going through this provider's specs? Which one is better for what purposes and why?


Edit:

For an end-user who will just be hosting websites, which is better? From efficiency or other point of view, is there any advantage of one over the other?


Source: (StackOverflow)

Xen vs KVM in performance

What is faster on same hardware - Xen or KVM?

I'm trying to pick-up a virtualization technology to work, which gives the best performance.

There are some benchmarks here that I found on the subject: http://virt.kernelnewbies.org/XenVsKVM

They show KVM as a winner, with significant difference in performance - which goes against the idea that KVM is a type-2 hypervisor, and by definition it should be slower then Type-1 hypervisors (like Xen) - or at least that what the articles on the web say.

Any idea on the subject?

Thanks!


Source: (StackOverflow)

Backing up qcow2 kvm guests

I can't find any good info on backing up qcow2 kvm guests. I'm not really interested in the guests running state, only the file system. This question suggests using savevm but that creates a snapshot in place. I'd like to backup the filesystem remotely.

Is there a better way than:

  1. suspend virt_machine # pause virtual machine
  2. rsync --sparse /home/vm/image.qcow2 /tmp/image.dec_14_2010.qcow2 # copy the image on the same drive
  3. resume virt_machine
  4. rsync --sparse /tmp/image.dec_14_2010.qcow2 ssh://backup@backupmachine:/vmbackups

There are a couple of downsides to this. First, copying a huge image file takes a (relatively) long time. Secondly, I must always make sure that I have enough space to backup my machines. This is not ideal. Are there any other better ways of managing KVM backups?

Thanks.


Source: (StackOverflow)

How do you synchronise huge sparse files (VM disk images) between machines?

Is there a command, such as rsync, which can synchronise huge, sparse, files from one linux server to another?

It is very important that the destination file remains sparse. It may be longer (but not bigger) than the drive which contains it. Only changed blocks should be sent across the wire.

I have tried rsync, but got no joy. groups.google.com/group/mailing.unix.rsync/browse_thread/thread/94f39271980513d3

If I write a programme to do this, am I just reinventing the wheel? http://www.finalcog.com/synchronise-block-devices

Thanks,

Chris.


Source: (StackOverflow)

what cluster management software to use for linux?

I have found the following cluster management software tools:

  • pacemaker (clusterlabs.org), - original a Heartbeat project, focus for high-availability, will be in the next debian version
  • openqrm (openqrm.com), - web gui - broader usage, a

A site with presentations for both

  • Virtual consolidated HA: Virtualization with KVM, Pacemaker, and DRBD
  • Virtual Machine Management mit openORM

It seems that pacemaker is used more widely. I have 2 Hardware Server for 12 different VMs. The linux system I will use is debian lenny. Setup I want to use: drdb, heartbeart, kvm. I have no experience with cluster management software.

Does anybody have some experience with pacemaker and/or openqrm? Which is easier to use? Are there other candidates?


Source: (StackOverflow)

Free hypervisor for small configuration

I'm building a server for virtualization for a non profit organization. I was planning on employing VMware ESXI free but I'm second guessing my plan because newer ESXI don't seem to be well supported by the vSphere Client and the web interface which is supposed to be used instead, is not free.

On the hardware we are limited to just one server right now. It's probably going to be an Xeon E5-1650 v3 (6x 3.5 Ghz) on a Supermicro X10SRH-CLN4F-O with 32 GB RAM and 2x 256 GB SSDs and 2x 1TB HDDs for storage. The board has an onboard LSI SAS 3008 controller that is supposed to be working with ESXI.

We are planning to use the server for accouting (WS 2012 R2), pfsense (vpn / routing) and about two linux VMs for our internal database applications, mail (zarafa), active directory (samba 4) and file and printer server.

Would I be better off using XenServer or KVM? On the plus side for XenServer is that it is completely free for me (same as KVM) but has a very good management interface which is kind of lacking for KVM. But on the negative side is the lack for good support for local storage. I wanted to offer raw SSD storage to my VMs for the database (accouting and internal tools - which are the most heavily used), but that seems to be unsupported with XenServer. KVM on the other side seems to support it, but I have bad memories regarding KVM and Windows Server having a really bad performance.

Points that are important for me

  • Performance
  • Ease of use (like a decent UI for basic tasks, manuals and a good community to ask questions)
  • Backup facilities (as there is only one server no migration at the moment, but snapshots and backups of the VMs to transfer them manually onto a new server are required)
  • Reliability
  • Free of charge

Source: (StackOverflow)

Considerations when chosing AMD processors over Intel

I work for a company with a lot of legacy LAMP web-applications, where we are trying to refresh our hardware from ~250 physical servers to ~40 new servers w/virtualization. We have received two quotes from vendors - one is suggesting Intel processors, the other AMD.

One thing I like about the high core-counts with AMD, is that we will be able to dedicate cores to VMs, which means we have a lower chance of applications interfering with each-other due to spikes, which to a certain extent is more important to me than peak performance.

The other considerations I have in mind are:

  • Power consumption may be different (not an issue in our case.)
  • CPU instructions like CRC32 (SSE 4.2) will not be supported (Edit: MySQL 5.6 appears to support SSE4.2. Not sure about Apache)
  • MySQL doesn't scale perfectly after ~16/~32 cores (I'm willing to accept this trade off.)

What other considerations am I missing?

(Note to moderators: I am aware of this thread - I consider the question slightly different.)


Edit: Assume that the tasks are exceptionally parallel (webservers), and that I do not care about the database servers not being so parallel.


Source: (StackOverflow)

Tough Choice: Xen or KVM

I'm building a fresh workstation and want to use Linux alongside Windows. This seems like a good opportunity to get acquainted with with either Xen or KVM.

So I face a choice. In favour of using Xen I see a type 1 hypervisor with very clear delineation between domains. KVM on the other hand seems to be ahead in terms of currency with the latest kernel(s).

I googled "xen vs kvm" and pulled apart the first page of results. I've also been through several Server Fault searches and now have a jumble of facts bouncing around my head, not all of which will be current.

In short I'm not really sure which way to jump. What really matters to me is:

  • stability, both in the hypervisor and in the guests
  • reasonable performance, particularly for the Windows guest
  • strong guest isolation
  • ease of management
  • USB pass-through to guests

With all that in mind, which do you think is the better option?


Update - several months later.

For the benefit of anyone with the same questions in the near future, this is how it all played out in the end:

  • I started with Xen on OpenSuse 11.2, several days before 11.3 was due. I found the suse update channels to be very slow (dunno if that was just an issue for me specifically or not). I got Xen up and running quickly but had a lot of grief with the guest's network adapters.
  • Ubuntu 9.10 was released as I was doing this so I decided to give that a try. The system itself was wonderful and KVM just plain worked out of the box. However I had the occasional stability issue that I felt might have been related to KVM (other suspects at the time were Compiz and NFS).
  • To see if the stability issue was tied to KVM I decided to try VirtualBox and found it to be even easier to use with a nice interface and surprisingly good performance.
  • The stability issue hasn't gone away yet so I guess KVM wasn't at fault but at the moment I'm staying with VirtualBox because it just feels nicer to use and has some good features combined with good performance.

This where I'm at today. Hope this is useful to someone.


Source: (StackOverflow)

free up not used space on a qcow2-image-file on kvm/qemu

we are using kvm/qemu with qcow2-images for our virtual machines.

qcow2 has this nice feature where the image file only allocates the actually needed space by the virtual-machine. but how do i shrink back the image file, if the virtual machine's allocated space gets smaller?

example:

1.) i create a new image with qcow2 format, size 100GB

2.) i use this image to install ubuntu. installation needs about 10 gb, the image-file grows up to about 10GB. nothing unexpected so far.

3.) i fill up the image with about 40 GB of additional data. the image-file grows up to 50GB. i am ok with that :-)

4.) this is where it gets strange: i delete all of the 40GB data on the image, but the image-size still eats up 50GB.

question: how do i free up that 40GB of data and shrink the image to the only needed 10 GB?

thanks in advance, berni


Source: (StackOverflow)

Improving IO with FlashCache

I have a server with 2 HDD's (2x 1 TB), running in RAID 1 (SW-RAID). I want to improve IO performance by using flashcache. There are running KVM virtual machines on it, using LVM.

Regarding this, I have the following questions:

  • Will this even work? flashcache works for block devices, however these are all virtual machines with their own setup.
  • How much would I expect to increase performance? Most virtual machines run websites and some host games.
  • How big does the SSD needs to be? Would having a bigger SSD increase performance since it's able to cache more files?
  • What happens if the SSD dies? Would flashcache retrieve files from the traditional HDD and I could simply replace the SSD?
  • How much faster would writeback be in comparison with writethrough and writearound?

I have no access to a test system unfortunately, so could I install flashcache on a live server without unmounting the the disks? I found a great tutorial here which I would be using.


Source: (StackOverflow)

recommendations for efficient offsite remote backup solution of vm's

I am looking for recommendations for backing up my current 6 vm's(and soon to grow to up to 20). Currently I am running a two node proxmox cluster(which is a debian base using kvm for virtualization with a custom web front end to administer). I have two nearly identical boxes with amd phenom II x4's and asus motherboards. Each has 4 500 GB sata2 hdd's, 1 for the os and other data for the proxmox install, and 3 using mdadm+drbd+lvm to share the 1.5 TB's of storage between the two machines. I mount lvm images to kvm for all of the virtual machines. I currently have the ability to do live transfer from one machine to the other, typically within seconds(it takes about 2 minutes on the largest vm running win2008 with m$ sql server). I am using proxmox's built-in vzdump utility to take snapshots of the vm's and store those on an external harddrive on the network. I then have jungledisk service (using rackspace) to sync the vzdump folder for remote offsite backup.

This is all fine and dandy, but it's not very scalable. For one, the backups themselves can take up to a few hours every night. With jungledisk's block level incremental transfers, the sync only transfers a small portion of the data offsite, but that still takes at least a half an hour.

The much better solution would of course be something that allows me to instantly take the difference of two time points (say what was written from 6am to 7am), zip it, then send that difference file to the backup server which would instantly transfer to the remote storage on rackspace. I have looked a little into zfs and it's ability to do send/receive. That coupled with a pipe of the data in bzip or something would seem perfect. However, it seems that implementing a nexenta server with zfs would essentially require at least one or two more dedicated storage servers to serve iSCSI block volumes (via zvol's???) to the proxmox servers. I would prefer to keep the setup as minimal as possible (i.e. NOT having separate storage servers) if at all possible.

I have also briefly read about zumastor. It looks like it could also do what I want, but it appears to have halted development in 2008.

So, zfs, zumastor or other?


Source: (StackOverflow)

Web based KVM management for Ubuntu

We've got a single Ubuntu 9.10 root server on which we want to run multiple KVM virtual machines. To administer these virtual machines I'd like a web based KVM management tool, but I don't know which one to choose from the list of tools mentioned on linux-kvm.org.

I've used virsh & virt-manager on my desktop, but would like a web interface for the server. I tested ConVirt on my desktop, but it failed to pickup KVM machines from virsh / virt-manager, and I could not get KVM virtual machine import to work (only Xen).

oVirt looks good, but I can't find out if and how I can install it on Ubuntu 9.10.. (And I'd really rather not waste another few days on testing stuff that might not work in the end.)

Can anyone recommend any good web based KVM management tools that are easy to install on Ubuntu 9.10?

I'm looking for something that will also allow me to run other services like apache and postgresql besides hosting virtual machines, so preferably fairly lightweight & no dedicated OS installs. We don't need any professional clustering / migration or anything, just something that will let us create, start, inspect, administer & stop virtual machines from a web page.

Best regards, Tim


Update:
Anyone have any suggestions? It's awfully quiet here..


Source: (StackOverflow)

understanding relationship between Qemu and KVM

What is the difference between KVM and Qemu? As I understand, latter is able to provide "user mode emulation" which means that one can run a single executable built for some other architecture like this:

# file busybox-sparc 
busybox-sparc: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), statically linked, stripped
# qemu-sparc busybox-sparc ls
Packages_arm     Packages_i386    arm              busybox-armv6l   busybox-i686     busybox-powerpc  busybox-sparc    busybox-x86_64   i386
# 

..and "computer emulation", which means that not only dynamic binary translation is performed, but whole virtual machine is emulated(video card, sound card, network cards, optical devices etc). For example:

# qemu-system-sparc64 -hda hda.img -cdrom debian-6.0.5-sparc-CD-1.iso -boot d

As I have understood, Qemu does not know how to take advantage of hardware virtualization(for example Intel VT-x or AMD-V solutions on x86 architecture) and this is the case where KVM can help- one can start Qemu with KVM support. However, does KVM provide any other functionality besides access for emulation programs to hardware-assisted virtualization on specific hardware architectures? Is it possible to create whole(CPU, video card, I/O devices etc) virtual machine using only KVM? If yes, then which programs should one use for creating and controlling this virtual machine?


Source: (StackOverflow)