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
lxc-clone on top of LVM thin provisioning + XFS doesn't quite work #807
Comments
Hi, STR:
Actual results:
sudo lvchange -kn -ay lxdata/config+log allows me to boot the clonned container and seems it is ok. |
Sorry for bother you, but could some one check this issue? It is quite inconvenient to suppress 'lxc-clone' exit code and add direct lvm manipulations in build scripts. |
Situation getting worth in lxc 2.0.0, now 'lxc-copy' fails to determine fs on cloned LV and removes it, so 'lvchange' can't help anymore. STR:
|
Obviously, bdev/bdev.c::do_lvm_create() should be patched to do the -ay -kn dance right after successful creation in the thinpool case. https://github.com/lxc/lxc/blame/master/src/lxc/bdev/lxclvm.c#L111 Should be trivial. This will not help with the duplicate UUID problem though. It may not prevent operation in the ext4 case, but most certainly will in the xfs one. It is also quite untidy to have multiple differing filesystems with the same UUID. So a call to xfs_admin -U generate / tune2fs -U random / whatever it is for other filesystems should be inserted somewhere between snapshot/clone and attempts to mount. I have no idea where this point would be in the codebase. Will also mean dependencies on e2fsprogs/xfsprogs/whatever. Ah, and yes, one can get rid of UUIDs completely ( xfs_admin -U nil / tune2fs -U clear). This should be mentioned in the documentation though. Some advocacy in the mailing lists might help attacting someone wiser to this issue. |
A workaround for the activation issue: #968 (comment) set 'auto_set_activation_skip = 0' in '/etc/lvm/lvm.conf' (thanks to @vbaskoff ) So the complete workaround is:
I still think this should be fixed in lxc code. |
The storage drivers have been reworked substantially if this is still reproducible on master, please re-open. |
debian8(jessie) lxc 1.0.6-6+deb8u2
In fact the cloned container is fine. However, to start it I need to:
lvchange -kn /dev/data/cloname
-- because thin provisioned LVs are skip-autostart by defaultlvchange -ay /dev/data/cloname
-- because the LV doesn't get activated due to skip-autostartand then
xfs_admin -U generate /dev/data/d8template
this changes filesystem UUID (doesn't matter which one - template or clone) and is needed because othewise xfs.ko refuses to mount it (duplicate UUIDs) thus lxc-start fails.
The text was updated successfully, but these errors were encountered: