LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-20-2019, 04:09 PM   #1
nicedreams
Member
 
Registered: Jun 2003
Location: Phoenix, AZ
Posts: 93

Rep: Reputation: 15
Is this a good KVM with LVM and snapshot setup? Wondering if future issues.


I started using LVM to take advantage of snapshots and want to make sure I have my setup proper and what can I improve? It's working so far. I use *.raw format since easier to backup, restore and move around. Looked online and tons of good help but no straight tutorial on using *.raw files and LVM with snapshots so hoping this should work well.

KVM has worked very well for me with raw files on just ext4 partitions without LVM for few years. Want some live backups going forward on the weekdays and offline still on the weekends.


1) 3 servers (*.raw file) running from 3 nvme drives (1 drive per raw for I/O performance).
2) Created 1 GPT partition per nvme drive per Redhat recommendations and made sure aligned.
3) Ran pvcreate /dev/sdX 3 times on each drive.
4) Created 1 VG and LV per nvme drive using 75% of the drive partition (rest for snapshot)
4a) I made the LV 10GB larger than the *.raw file. (this my main question if okay or not? Don't know if there's some kind of overhead.)
5) Formatted each LV ext4 with defaults
6) Created 3 directories in /mnt for each raw file an modified fstab with UUID of each LV.
7) Copied working server1.raw file to each drive (1 per drive).
8) Modified (swappiness = 10) since have 64GB ram (that was fun to figure out).
9) I wrote a small script to take a snapshot every night with 20G snapshot (in case Windows Updates, already screwed me during copy using 1G).
10) I remove the snapshot after the *.raw file is copied to external drive since I know there is a performance hit per snapshot.

Does this look okay to where I shouldn't have any weird issues in the future?

Other Questions:

A) Is there a certain sector/cluster size I should use since only 1 raw file per LV for performance?
B) Does running pvcreate 3 times keep them separate or adds them to a pool if I did pvcreate /dev/sdX /dev/sdY /dev/sdZ? So I know in the future.
C) Even though I set swappiness to 10 in sysctl and rebooted it still uses swap file even though I have 16GB of ram free with all VMs booted and linux system. I'm assuming this is normal, but used to not seeing swap file touched. Verified it's still at 10.

Thanks!

Last edited by nicedreams; 04-20-2019 at 04:15 PM.
 
Old 04-22-2019, 01:17 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,767

Rep: Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817
A day and a half, a couple of hundred views - may everyone else had the same reaction as me; hmmmm ...

It looks like, from that description, you are mounting all the guests in the host and doing nightly LVM snaps of the guests. From the host.
Is that correct ?.
 
Old 04-22-2019, 02:48 PM   #3
nicedreams
Member
 
Registered: Jun 2003
Location: Phoenix, AZ
Posts: 93

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
A day and a half, a couple of hundred views - may everyone else had the same reaction as me; hmmmm ...

It looks like, from that description, you are mounting all the guests in the host and doing nightly LVM snaps of the guests. From the host.
Is that correct ?.

Yes this is correct. Want to make sure this is a good process or is there something I should improve? Also the questions about cluster sizes in the LV since only storing a single RAW file. I understand basics of clusters, but never messed with them before so don't know what I can set to try to increase performance. Or does that bring in it's own level of complexities?
 
Old 04-29-2019, 03:41 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,767

Rep: Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817Reputation: 2817
I cannot imagine any situation where this will provide valid (current) backups.
ext4 is not cluster aware, nor is LVM without the CLVM extension.

Without having tested this, I would expect the cache for the lv to be instantly out of date on the host, and there is no way for it to know of updates to the filesystem. Even if you remounted the filesystem on the host immediately before snap it would always be missing the data in the guest cache and (ext4) journal.
I repeat, I can never see this as being a valid backup procedure. Do your snaps and subsequent backup from the guest(s).

Note the use of "verified"in my sigline.
 
  


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
How to take a Snapshot of a KVM at Location A and Restore that Snapshot at Location B LinuxRSA Linux - Virtualization and Cloud 4 06-22-2016 11:59 AM
Hello I was wondering which Linux tools I would need to use to test my wifi password security. I'm also wondering how to do it. thanks. Anonymous465336 Linux - Newbie 5 04-24-2016 08:06 AM
[SOLVED] "No KVM, No qemu-kvm" Available error while trying to install KVM on CentOS 6.3 sriramdas Linux - Virtualization and Cloud 5 01-01-2013 10:46 AM
KVM on Redhat 5.7: KVM can ping outside network, outside network can't ping KVM svandyk Linux - Networking 1 09-23-2011 06:45 AM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM

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

All times are GMT -5. The time now is 10:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration