Is this a good KVM with LVM and snapshot setup? Wondering if future issues.
Linux - Virtualization and CloudThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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 ?.
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?
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.