after I had massive problems with LVM2 and caching and nobody could help with the problem, I switched from LVM vm devices to qemu qcow2.
But now, I've a problem with snaptshots and backup of running vm devices.
I try use virsh (libvirt) to make snapshots and backups of (running) vm devices. And this is, how is should be work...
Code: Select all
root@vmm:~# virsh domblklist bifroest
Target Source
------------------------------------------------
sda /opt/VMs/Storage/bifroest.qcow2
root@vmm:~# virsh snapshot-create-as bifroest --diskspec sda,file=/opt/VMs/Storage/SnapShot_bifroest.qcow2 --no-metadata --disk-only --quiesce --atomic
Domain snapshot 1530293277 created
root@vmm:~# virsh domblklist bifroest
Target Source
------------------------------------------------
sda /opt/VMs/Storage/SnapShot_bifroest.qcow2
root@vmm:~# rsync -avhPSW /opt/VMs/Storage/bifroest.qcow2 /opt/backup/VMs/bifroest/bifroest.qcow2
sending incremental file list
bifroest.qcow2
27.62G 100% 61.37MB/s 0:07:09 (xfr#1, to-chk=0/1)
sent 27.63G bytes received 35 bytes 64.33M bytes/sec
total size is 27.62G speedup is 1.00
Code: Select all
root@vmm:~# virsh domblklist bifroest && echo "Show me my snapshot..." && virsh snapshot-list bifroest
Target Source
------------------------------------------------
sda /opt/VMs/Storage/SnapShot_bifroest.qcow2
Show me my snapshot...
Name Creation Time State
------------------------------------------------------------
'virsh snapshot-list' is not working!
Code: Select all
root@vmm:~# virsh domblklist bifroest
Target Source
------------------------------------------------
sda /opt/VMs/Storage/SnapShot_bifroest.qcow2
root@vmm:~# virsh snapshot-info --domain bifroest --snapshotname /opt/VMs/Storage/SnapShot_bifroest.qcow2
error: Domain snapshot not found: no domain snapshot with matching name '/opt/VMs/Storage/SnapShot_bifroest.qcow2'
error: Domain snapshot not found: no domain snapshot with matching name '/opt/VMs/Storage/SnapShot_bifroest.qcow2'
root@vmm:~# virsh snapshot-info --domain bifroest --snapshotname SnapShot_bifroest.qcow2
error: Domain snapshot not found: no domain snapshot with matching name 'SnapShot_bifroest.qcow2'
error: Domain snapshot not found: no domain snapshot with matching name 'SnapShot_bifroest.qcow2'
root@vmm:~# virsh snapshot-info --domain bifroest --current
error: Domain snapshot not found: the domain does not have a current snapshot
error: Domain snapshot not found: the domain does not have a current snapshot
root@vmm:~# virsh snapshot-delete --domain bifroest --current --children
error: Domain snapshot not found: the domain does not have a current snapshot
error: Domain snapshot not found: the domain does not have a current snapshot
'virsh snapshot-subfunctions' are not working!
And another bug...
Code: Select all
root@vmm:~# virsh blockcommit bifroest sda --verbose --pivot --delete
error: unsupported flags (0x2) in function qemuDomainBlockCommit
root@vmm:~# virsh blockcommit bifroest sda --verbose --pivot
Block commit: [100 %]
Successfully pivoted
root@vmm:~# virsh domblklist bifroest
Target Source
------------------------------------------------
sda /opt/VMs/Storage/bifroest.qcow2
root@vmm:~# lf /opt/VMs/Storage/*bifroest*
26G -rw-r--r-- 1 root root 26G Jun 29 20:06 /opt/VMs/Storage/bifroest.qcow2
140M -rw------- 1 root root 140M Jun 29 19:51 /opt/VMs/Storage/SnapShot_bifroest.qcow2
root@vmm:~# virsh help blockcommit
NAME
blockcommit - Start a block commit operation.
SYNOPSIS
blockcommit <domain> <path> [--bandwidth <number>] [--base <string>] [--shallow] [--top <string>] [--active] [--delete] [--wait] [--verbose] [--timeout <number>] [--pivot] [--keep-overlay] [--async] [--keep-relative] [--bytes]
DESCRIPTION
Commit changes from a snapshot down to its backing image.
OPTIONS
[--domain] <string> domain name, id or uuid
[--path] <string> fully-qualified path of disk
--bandwidth <number> bandwidth limit in MiB/s
--base <string> path of base file to commit into (default bottom of chain)
--shallow use backing file of top as base
--top <string> path of top file to commit from (default top of chain)
--active trigger two-stage active commit of top file
--delete delete files that were successfully committed
--wait wait for job to complete (with --active, wait for job to sync)
--verbose with --wait, display the progress
--timeout <number> implies --wait, abort if copy exceeds timeout (in seconds)
--pivot implies --active --wait, pivot when commit is synced
--keep-overlay implies --active --wait, quit when commit is synced
--async with --wait, don't wait for cancel to finish
--keep-relative keep the backing chain relatively referenced
--bytes the bandwidth limit is in bytes/s rather than MiB/s
And yet another bug!
Code: Select all
root@vmm:~# virsh domblklist freya
Target Source
------------------------------------------------
sda /opt/VMs/Storage/freya.qcow2
sdb /dev/zvol/zfs0/smb
root@vmm:~# virsh snapshot-create-as freya --diskspec sda,file=/opt/VMs/Storage/SnapShot_freya.qcow2 --no-metadata --disk-only --quiesce --atomic
error: unsupported configuration: source for disk 'sdb' is not a regular file; refusing to generate external snapshot name
The whole snapshot in virsh is bugged!
So, back to LVM2 without caching. Snapshots and backups will work with it.
Since I use zfs4linux in the rest of the system, I tried it there with zfs volume in the vm, but with zfs the access is extremely slow with vm devices. Even with caching (SSD).
Every comment and help is very welcome!
Edit:
virsh version...
Code: Select all
Virsh command line tool of libvirt 4.0.0
See web site at https://libvirt.org/
Compiled with support for:
Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMware VirtualBox ESX Test
Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog Gluster ZFS
Miscellaneous: Daemon Nodedev AppArmor Secrets Debug DTrace Readline