For ovirt-node we plan to boot of writeable snapshots of thin-volumes.
For this it would be good if anaconda supported this use case.
Basically this means that a logical volume needs to be prepared by one of the ways, after the population a writeable snapshot is created, which is then used on the kernel cmdline and fstab.
This is something that blivet needs to implement, if it doesn't already.
Blivet has support (on master branch) for creating LVM snapshots. Most of the logic requested by this RFE is going to live in anaconda and possibly pykickstart as I see it -- especially since there is no UI (existing or planned) in anaconda for creating snapshots.
That sounds amazing.
And the lack of UI is likely not a problem for us, as we (a) would add custom spokes and (b) wouldn't expose this functionality in the UI anyway.
Solving this in anaconda would really help us.
The plan is to roll out the rootfs in a thin LV using a liveimg, once that is rolled out a thin ansphot of that thin LV is taken and used as the rootfs.
That way we preserve the original root tree
Let's see if I have this straight:
1. use liveimg payload to install to a thin root lv
2. create a writeable snapshot of root lv
3. put the snapshot into /etc/fstab, &c instead of the original root lv
Is that the whole thing? If so, that could quite easily be implemented using a %post that creates a snapshot, runs sed on the freshly installed system's /etc/fstab, then runs dracut to update initrd(s).
(In reply to David Lehman from comment #6)
> Let's see if I have this straight:
> 1. use liveimg payload to install to a thin root lv
> 2. create a writeable snapshot of root lv
> 3. put the snapshot into /etc/fstab, &c instead of the original root lv
> Is that the whole thing?
Yes. That is the whole thing.
> If so, that could quite easily be implemented using
> a %post that creates a snapshot, runs sed on the freshly installed system's
> /etc/fstab, then runs dracut to update initrd(s).
That is our current approach which we use (but it's not yet working correctly) for testing and developing all of the tooling.
But to make the consumption of this usage pattern easier, we'd like to get this included into anaconda.
Maybe as an option to liveimg or to the thinp related storage configuration.
Moving it to anaconda, because according to comment 3 the support in blivet is there, it just needs support in pykickstart and anconda itself.
Prototyping is in progress.
Could you please describe step-by-step instructions how to retest this bug, or could you retest this bug once it's fixed?
Yes, I can re-test this this bug and here are also the steps to reproduce this:
1. Install RHEL on a thinp layout with this snapshot feature enabled (possibly by setting a ks directive flag)
2. Boot into the installed OS
3. Run lsblk and look for a layout similar to this:
Tho I am not sure what the names of the LVs will look like (Original and Layer-01 in the example above).
Is there any progress on this?
There was a POC ... but it's developemnt have stalled.
It's worth noting that this will change the bootloader configuration in /boot.
Removing the LP for now, because we are now taking a snapshot in the %post part of a ks.
For reference: We are doing this now in the %post part of a kickstart with the following code:
This is creatign the following layout:
centos/our-nvr-based-scheme-1.0-0 <-- Snap of centos/root
centos/our-nvr-based-scheme-1.0-0+1 <-- Snap of centos/our-nvr-based-scheme-1.0-0
We'll then create a boot entry pointing to centos/our-nvr-based-scheme-1.0-0+1
I think we can add kickstart command for snapshot creation. About using writable snapshot as /, it seems easier to me and better to use / and create the snapshot after the installation when everything is set.
It has two advantages, it's less aggressive change on the Anaconda side but also from my understanding (I'm no LVM expert) it's more support way of doing snapshots from the LVM side.
Is this usable solution for your use-case?
The methology suggested in comment 24 is also valuable, but does not align with what we are now using in RHEV-H.
I am not sure if we could migrate our current mechanism to the method described in comment 24.
In the end making the suggested change in comment 24 would not help us specifically, but when it is around, then we might consider to move to that mechanism.
Anaconda PR: https://github.com/rhinstaller/pykickstart/pull/152
Pykickstart PR: https://github.com/rhinstaller/pykickstart/pull/152
Oops bad link, this is the good one:
Anaconda PR: https://github.com/rhinstaller/anaconda/pull/1002
In process of backporting this feature to master, I found myself a bug.
The UUID generator for an XFS snapshots worked only for a post-installation snapshots, it didn't change UUID for a pre-installation snapshots.
Issue is fixed by PR:
For this fix to work properly this Blivet's PR is required to be merged:
Hi Jirka, can you please take a look at the Doc Text (for Release Notes) and let me know if it's fine? Thanks!
It looks fine I just have two ideas for an improvement.
* Move the '--name' as the first parameter because it is lets say more significant.
* The '--when=[pre-install|post-install]' parameter is slightly confusing to me. I would need to think if it is mandatory to specify 'pre-install|post-install' (it is mandatory) or I can use it as '--when' and it will default to something.
Otherwise it looks great to me!
I was not able to verify this bug due to a bug 1463198.
This as actually not blocked by bug 1463198 after all.
I was able to verify the current solution on RHEL-7.4-20170616.3 with anaconda-184.108.40.206-1.el7.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.