redhat-cop / infra.leapp

Collection of Ansible roles for automating RHEL in-place upgrades using Leapp.
MIT License
48 stars 40 forks source link

PV headers not updated after RHEL7 -> RHEL8 upgrade #189

Closed rev138 closed 4 months ago

rev138 commented 4 months ago

After updating from RHEL7 -> RHEL8 running lvm commands (eg: lvs, vgs) prints a warning about old PV headers. The issue seems to be described by this KB article: https://access.redhat.com/solutions/5906681

I was able to fix this easily with the following task:

 - name: Update LVM metadata
  loop: "{{ ansible_lvm['vgs'] | list }}"
  ansible.builtin.command: "/usr/sbin/vgck --updatemetadata {{ item }}"

I'd be happy to submit a PR if you can tell me which role you'd prefer it to go in.

swapdisk commented 4 months ago

Interesting. One thing we need to be careful about is to make sure this doesn't potentially being able to rollback LVM snapshots.

rev138 commented 4 months ago

I'm using vmware snaps at the moment so that's not a personal concern, but I can do some testing on it and report back.

@swapdisk I sat in for a couple of your sessions @ RH Summit last week which is what turned me on to this project. Great stuff. Thanks!

rev138 commented 4 months ago

I rolled back my vmware snapshot, added a new LV and created a snapshot, then did the upgrade again, and the headers warning was not present. I rolled back one more time and upgraded without touching LVM and the warning is back.

Perhaps the act of creating a new LV/snapshot updates the metadata intrinsically?

swapdisk commented 4 months ago

Perhaps the act of creating a new LV/snapshot updates the metadata intrinsically?

Right, I think any LVM command that writes metadata will update the metadata version.

Looking at the KB article you cited, I see it says these warning happen when:

So I am guessing that the PVs where you observed warnings were somehow created back in the Mesozoic Era? Is it possible the devices in your environment date back that far?

I'll bet this could also be fixed by updating the metadata version under RHEL 7 prior to creating snapshots and upgrading. If so, that would probably be the best way to solve this.

rev138 commented 4 months ago

We spin all of our VMs from vmware templates. The original RHEL7 install that the template uses probably dates back to about 2015 or so, but it was definitely a fresh install, not an upgrade from a prior version. I suppose my situation only matched the KB in that the warning message and remediation steps are the same. In any case, if it's not something you're interested in incorporating into this repo that's fine. It's simple enough to fix on our end. Thanks.