mpalmer / lvmsync

Synchronise LVM LVs across a network by sending only snapshotted changes
http://theshed.hezmatt.org/lvmsync
GNU General Public License v3.0
380 stars 60 forks source link

lvmsync from thin lv results in error #45

Closed opnoack closed 9 years ago

opnoack commented 9 years ago

I just tried to lvmsync from a thin lv to a rados block device. Running "lvmsync /dev/mapper/lvm-mysnap /dev/rbd/vms/testvm" results in the following error:

/var/lib/gems/1.9.1/gems/lvmsync-3.3.2/lib/lvm/thin_snapshot.rb:161:in ``': No such file or directory - thin_dump /dev/mapper/lvm-thin_pool_tmeta (Errno::ENOENT)
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/lib/lvm/thin_snapshot.rb:161:in `vg_block_dump'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/lib/lvm/thin_snapshot.rb:111:in `origin_blocklist'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/lib/lvm/thin_snapshot.rb:103:in `flat_origin_blocklist'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/lib/lvm/thin_snapshot.rb:69:in `differences'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/lib/lvm/logical_volume.rb:77:in `changes'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/bin/lvmsync:279:in `dump_changes'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/bin/lvmsync:231:in `block in run_client'
        from /usr/lib/ruby/1.9.1/open3.rb:208:in `popen_run'
        from /usr/lib/ruby/1.9.1/open3.rb:90:in `popen3'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/bin/lvmsync:228:in `run_client'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/bin/lvmsync:124:in `main'
        from /var/lib/gems/1.9.1/gems/lvmsync-3.3.2/bin/lvmsync:357:in `<top (required)>'
        from /usr/local/bin/lvmsync:23:in `load'
        from /usr/local/bin/lvmsync:23:in `<main>'

Am I doing something wrong?

opnoack commented 9 years ago

Well I overlooked the requirements.

apt-get install thin-provisioning-tools

solved the problem.

mpalmer commented 9 years ago

Hi @opnoack, glad you figured it out. I've modified the code so that in the future, instead of getting that ugly exception, you'll get a friendly error message indicating the need to install thin-provisioning-tools. Thanks for opening this issue and giving me a chance to fix it, because if you had problems, chances are other people probably are too, but not taking the time to tell me about it, so you've made life easier for everyone. Thanks again!