-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
could not open existing file, error getting backing file #12
Comments
confirmed. The problem is in this for: for block_device in "$block_devices"; do quotes around |
Thanks, Davide! I checked, and it appears that the quotes are already there: [root@dualix images-backup-gear]# grep -n block_devices fi-backup.sh [root@dualix images-backup-gear]# grep -n block_devices fi-backup.sh | grep for However, I now remember (I am using CentOS 7; maybe this is the problem?), I added the following to your code (after # Add this (SV)): ExecutablesQEMU_IMG="/usr/bin/qemu-img" Add this! (SV, for CentOS7)if [ -x "/usr/libexec/qemu-kvm" ]; then because: [root@dualix /]# find / -type f -name "kvm" [root@dualix /]# grep -i centos /etc/* |
You are welcome. |
sorry, maybe I just misunderstood; I just wanted to say that the quotes are already in my version of the fi-backup.sh script: [root@dualix images-backup-gear]# grep -n block_devices fi-backup.sh | grep for |
Yep, they shouldn't :) |
Davide, do you mean that just removing the double quotes in two occurrences above will fix the script? |
@svorobyov, before I merge into master, can you please check this PR out? |
last night I removed double quotes in the two following lines of the old script [root@dualix images-backup-gear]# grep -n block_devices fi-backup.sh | grep for and everything went well: ===== 2015-05-26 03:27:05, backing up getafix.intertex.se ===== I will test your new script as soon as possible |
Just checked your latest/newest script in the production environment, and everything went well: ===== 2015-05-26 08:59:06, backing up getafix.intertex.se ===== I will check consolidation later today. Many thanks, Davide! |
Davide, about consolidation:
This should be specified in the README.md |
Split/Consolidation are designed to be performed on live systems. :) |
What is the disaster recovery procedure for domain A, with images in directory B, backup directory C? Is it:
|
Yes, that is the recovery procedure. |
@svorobyov https://gist.github.com/dguerri/70efcfe0c3ae0fac8bd7 what do you think? |
@svorobyov I updated this PR with improved doc and tests. |
Two single-disk VMs seem to successfully consolidate (I will now proceed to testing consolidating for a third, two-disk VM). Here's the second, quite long consolidation chain: [DEB] libVirt version '1.2.8' is supported |
Consolidation for a two-disk VM was also completely successful: [DEB] libVirt version '1.2.8' is supported |
Many thanks, Davide! I think you can now merge the development branch into master. |
👍 Waiting for Travis-CI :) |
So, removing quotes will work only if there are no spaces in image file names. |
what is Travis-CI? I do not have anything related in my clone of LibVirtKvm-scripts/ |
https://travis-ci.org/dguerri/LibVirtKvm-scripts/builds You should have a file named .travis.yml |
I will need to study it carefully before adapting to CentOS, since apt-get won't work (it's yum based) |
Unfortunately you can't run it locally :( |
Issue fixed. Fix merged in master. |
It's a nice script operating flawlessly for other single-disk VMs on the same host.
However, something goes wrong for a two-disk VM I just added.
All other disk images are owned by root:root, as the images in question, so it's not a permission issue.
The fi-backup.sh script seems to erroneously report "error getting backing file",
although all the files exist and are OK, and the VM continues to operate fine.
There are two .qcow2 disks in the domain:
getafix-hda.*
getafix-hdb.*
which the script finds and snapshots correctly. But there is a (spurious) error message
and the he previous day's backing files are not transferred to the backup directory,
as they should and moved for my other single-disk VMs.
The command I use is:
./fi-backup.sh -b /var/lib/libvirt/images-backups -d $name
where $name cycles through all the machines' domain names I want to backup.
Again: it works smoothly for all single-disk VMs, but errs on the only two-disk VM.
===== 2015-05-25 03:27:02, backing up getafix.intertex.se =====
[DEB] libVirt version '1.2.8' is supported
[DEB] /usr/bin/qemu-img version '1.5.3' is supported
[DEB] KVM version '1.5.3' is supported
[DEB] Snapshot for domain 'getafix.intertex.se' requested
[DEB] Using timestamp '20150525-032702'
[DEB] Snapshotting block devices for 'getafix.intertex.se' using suffix 'bimg-20150525-032702'
[VER] Snapshot for block devices of 'getafix.intertex.se' successful
qemu-img: Could not open '/var/lib/libvirt/images/getafix-hda.bimg-20150525-032702
/var/lib/libvirt/images/getafix-hdb.bimg-20150525-032702': Could not open file: No such file or directory
[ERR] Error getting backing file for '/var/lib/libvirt/images/getafix-hda.bimg-20150525-032702
/var/lib/libvirt/images/getafix-hdb.bimg-20150525-032702'.
However:
[root@dualix images]# ll getafix-hda.*
-rw-------. 1 root root 4333371392 24 maj 03.27 getafix-hda.bimg-20150523-032706
-rw-------. 1 root root 3972202496 25 maj 03.27 getafix-hda.bimg-20150524-032708
-rw-------. 1 root root 5911937024 25 maj 11.34 getafix-hda.bimg-20150525-032702
-rw-r--r--. 1 root root 427588321280 23 maj 03.27 getafix-hda.qcow2
[root@dualix images]# qemu-img info getafix-hda.qcow2
image: getafix-hda.qcow2
file format: qcow2
virtual size: 767G (823023108096 bytes)
disk size: 398G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# qemu-img info getafix-hda.bimg-20150523-032706
image: getafix-hda.bimg-20150523-032706
file format: qcow2
virtual size: 767G (823023108096 bytes)
disk size: 4.0G
cluster_size: 65536
backing file: /var/lib/libvirt/images/getafix-hda.qcow2
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# qemu-img info getafix-hda.bimg-20150524-032708
image: getafix-hda.bimg-20150524-032708
file format: qcow2
virtual size: 767G (823023108096 bytes)
disk size: 3.7G
cluster_size: 65536
backing file: /var/lib/libvirt/images/getafix-hda.bimg-20150523-032706
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# qemu-img info getafix-hda.bimg-20150525-032702
image: getafix-hda.bimg-20150525-032702
file format: qcow2
virtual size: 767G (823023108096 bytes)
disk size: 5.5G
cluster_size: 65536
backing file: /var/lib/libvirt/images/getafix-hda.bimg-20150524-032708
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# ll getafix-hdb*
-rw-------. 1 root root 198144 23 maj 03.27 getafix-hdb.bimg-20150523-032706
-rw-------. 1 root root 458752 25 maj 03.27 getafix-hdb.bimg-20150524-032708
-rw-------. 1 root root 198144 25 maj 03.27 getafix-hdb.bimg-20150525-032702
-rw-r--r--. 1 root root 11324817408 22 maj 19.46 getafix-hdb.qcow2
[root@dualix images]# qemu-img info getafix-hdb.qcow2
image: getafix-hdb.qcow2
file format: qcow2
virtual size: 69G (74100654080 bytes)
disk size: 11G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# qemu-img info getafix-hdb.bimg-20150523-032706
image: getafix-hdb.bimg-20150523-032706
file format: qcow2
virtual size: 69G (74100654080 bytes)
disk size: 196K
cluster_size: 65536
backing file: /var/lib/libvirt/images/getafix-hdb.qcow2
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# qemu-img info getafix-hdb.bimg-20150524-032708
image: getafix-hdb.bimg-20150524-032708
file format: qcow2
virtual size: 69G (74100654080 bytes)
disk size: 388K
cluster_size: 65536
backing file: /var/lib/libvirt/images/getafix-hdb.bimg-20150523-032706
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
[root@dualix images]# qemu-img info getafix-hdb.bimg-20150525-032702
image: getafix-hdb.bimg-20150525-032702
file format: qcow2
virtual size: 69G (74100654080 bytes)
disk size: 196K
cluster_size: 65536
backing file: /var/lib/libvirt/images/getafix-hdb.bimg-20150524-032708
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
Thanks for any suggestions!
The text was updated successfully, but these errors were encountered: