LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-10-2012, 12:02 PM   #1
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Rep: Reputation: Disabled
Snapshots in Linux VM host?


Is there any way of taking VM snapshots in KVM/QEmu. I know that there is no snapshot tool built into KVM or anything like that but I seem to recall once reading that there is a way of doing this using Logical Volume Groups or something.
 
Old 07-10-2012, 12:13 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
If your VM is running on an LVM volume then you should be able to... (Shutdown your VM so you get a quiescent snapshot)

Code:
lvcreate --snapshot vg0/lv_vm --name lv_vm_snapshot --size 512M
Then you can mount that snapshot

Code:
mkdir -m 777 /mnt/lv_vm_snapshot
mount -o ro /dev/vg0/lv_vm_snapshot /mnt/lv_vm_snapshot
Then you can do whatever you want to the /mnt/lv_vm_snapshot dir. Knowing that this is a COW snapshot and you should probably remove it as soon as you're doing doing whatever it is you need to do. Note that the "--size 512M" is the maxsize the snapshot will grow.

-C
 
Old 07-11-2012, 02:02 AM   #3
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
if you're not using LVM, you can use qemu-img to take snapshots
 
1 members found this post helpful.
Old 07-23-2012, 11:42 AM   #4
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dyasny View Post
if you're not using LVM, you can use qemu-img to take snapshots
Thanks dyasny I didn't know that qemu-img supported snapshots, will try that out.
 
  


Reply



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
Does linux offer filesystem snapshots? RedNeck-LQ Linux - General 10 10-09-2011 02:27 AM
How to get the ip address of host in linux with using of host and nslookup command hussain.s Linux - General 4 10-23-2010 09:12 PM
LXer: Consistent backup with Linux Logical Volume Manager (LVM) snapshots LXer Syndicated Linux News 0 06-02-2006 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration