LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 11-01-2011, 02:55 PM   #1
bjl
LQ Newbie
 
Registered: Nov 2011
Distribution: CentOS
Posts: 4

Rep: Reputation: Disabled
CentOS 6 libvirt KVM Live Snapshot is Slow


Hello Everyone,

I am currently evaluating KVM running on CentOS 6 (we are primarily a CentOS shop here so I figured I would keep the number of distributions we need to support down). I VT turned on in the BIOS (required for KVM) and installed CentOS with the Virtual Host option. I then imported the CentOS 6 Continuous Release repository to get the latest updates (snapshotting wasn't working at all before I did this, the error was "unable to execute QEMU command savevm").

I am using the virsh command line "virsh snapshot-create <domain>" to create the snapshot. The issue is that the snapshot is taking 10-20 minutes to create (the VM is suspended and unavailable for use during the time the snapshot is being taken), however the snapshot appears to be working. My question really is, is this normal behavior? Coming from a VMware background where snapshots are fast this seems very odd that it would take this long to generate a live snapshot. I just have a feeling I am missing something, but not sure what as I am using mostly defaults.

Here are my host specs:
* Dell PowerEdge R310
* 12 GB of RAM
* 250 GB hard drive RAID 1 (this is not yet designed for production)
* One 2.6 GHz Intel Xeon Quad Core Processor

Here are my guest specs (note there is only one guest running for now)
* Used Virtual Machine Manager GUI to create the VM
* CentOS 5.6 base install (from ISO)
* Disk Cache = none
* Hard Drive Size 20GB qcow2 preallocated format (using the qemu-img command, Virt-Manager appears to only create RAW images, not capable of snapshotting)
* 1024 MB of RAM
* Defined the VM as RHEL 5.4 or Greater

Here is the time it took for a snapshot today:

[root@server1 ~]# time virsh snapshot-create test-vm
Domain snapshot 1320175789 created


real 18m59.456s
user 0m0.004s
sys 0m0.010s

Here are my versions:
[root@server1 ~]# libvirtd --version
libvirtd (libvirt) 0.8.7

virsh # version
Compiled against library: libvir 0.8.7
Using library: libvir 0.8.7
Using API: QEMU 0.8.7
Running hypervisor: QEMU 0.12.1

[root@server1 ~]# uname -a
Linux server1 2.6.32-131.17.1.el6.x86_64 #1 SMP Thu Oct 6 19:24:09 BST 2011 x86_64 x86_64 x86_64 GNU/Linux

[root@server1 ~]# cat /etc/redhat-release
CentOS Linux release 6.0 (Final)

I will be happy to provide any other information you feel is needed and I am continuing my testing and research on this issue.

Thanks
 
Old 11-02-2011, 03:32 PM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 827

Rep: Reputation: 91
first of all, have you tested how long it takes to snapshot a VM that isn't running? savevm does two things - suspend the VM (miggrate to file essentially) and then takes the snapshot, replaces the image used by the VM with the new snapshot, and resumes the VM.

If you try to make a snapshot when the VM is down, you eliminate the first part, and if that is still slow, you can see that the snapshot itself is slow. If it's fast, then you have something going on int he migration to file process, and not in the snapshot creation. Either way, it's a step in the right direction
 
Old 11-02-2011, 03:56 PM   #3
bjl
LQ Newbie
 
Registered: Nov 2011
Distribution: CentOS
Posts: 4

Original Poster
Rep: Reputation: Disabled
The snapshot time while the VM is off is very fast, faster than I would expect the online snapshot to be.

[root@server1 ~]# time virsh snapshot-create test-vm
Domain snapshot 1320267158 created


real 0m1.162s
user 0m0.001s
sys 0m0.003s

The VM has 1024 MB of RAM I would assume since it is freezing the VM that it is dumping that memory to a file?
 
Old 11-02-2011, 04:54 PM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 827

Rep: Reputation: 91
yes it is. is the VM busy when you run savevm?
 
Old 11-02-2011, 05:18 PM   #5
bjl
LQ Newbie
 
Registered: Nov 2011
Distribution: CentOS
Posts: 4

Original Poster
Rep: Reputation: Disabled
No the system is idle, the guest is a test CentOS 5.6 i386 machine. It is just started up.
 
Old 11-03-2011, 07:24 AM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 827

Rep: Reputation: 91
definitely something wrong with the migration... what is your /var mounted on?
 
Old 11-03-2011, 12:06 PM   #7
bjl
LQ Newbie
 
Registered: Nov 2011
Distribution: CentOS
Posts: 4

Original Poster
Rep: Reputation: Disabled
/var is mounted root (I don't have a specific mount point for it), meaning it's on the RAID 1. I also have an R410 with 12 GB of RAM and 4 x 500 GB hard drives in a RAID 10 that is exhibiting the same problem with savevm.

I found this ticket online https://bugs.launchpad.net/qemu/+bug/741887 for QEMU, it appears to be my problem. However changing the cache to unsafe does not appear to have any effect (I changed it in the VM XML).

dyasny, are you using KVM with live snapshots working quickly using libvirt?
 
Old 11-03-2011, 01:43 PM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 827

Rep: Reputation: 91
after you updated the xml, did you make sure it worked? restart vm, get it's cmdline (ps -ef|grep qemu) and see if the drive is started with cache=writeback

I do not use live snapshots, since it is not a supported feature yet. I do however understand that your issue is not really with the snapshot part, but rather with the VM suspend flow.

At this point, I'd probably start asking questions at the kvm or qemu IRC channels on freeNode, or email the mailing lists for help, since debugging the way kvm manipulates VM memory can be a tricky task
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
libvirt/kvm: Enter passphrase during guest startup using virsh start <domain> druuna Linux - Virtualization and Cloud 0 09-29-2011 06:59 AM
Can't create new kvm using libvirt in freshly installed Centos 6 priyana Linux - Virtualization and Cloud 2 09-16-2011 01:13 AM
KVM administration through LibVirt from windows machine Mohan.Sundar Linux - Virtualization and Cloud 3 05-03-2011 11:31 AM
LXer: Set up Ubuntu 11.04 KVM to run is spice session on Fedora 14 KVM Server ( Libvirt Preview Env) LXer Syndicated Linux News 0 03-20-2011 12:00 AM
kvm-qemu snapshot mode. RaptorX Linux - Software 1 08-18-2009 05:00 AM


All times are GMT -5. The time now is 08:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration