Skip to content
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

Add VG and LV information on mounts #13

Open
jjperry opened this issue Dec 3, 2019 · 3 comments
Open

Add VG and LV information on mounts #13

jjperry opened this issue Dec 3, 2019 · 3 comments

Comments

@jjperry
Copy link

jjperry commented Dec 3, 2019

The details provided by the fact under mounts yields the /dev/mapper/- for the device details.

I happened to come across an issue where I needed to dynamically create a new filesystem across SUSE, RH, and CentOS where the VGs names vary drastically (system,rootvg,vgroot,centos) for the / partition.

Using the mountpoints fact, I extracted the / vg with
Facter.value(:mountpoints)['/']['device'].split(' ')[0].split('/')[3].split('-')[0]
and the LV with
Facter.value(:mountpoints)['/']['device'].split(' ')[0].split('/')[3].split('-')[1]

Would it make any sense to do this within the mountpoints to provide that detail for LVM operations using mountpoints?

@kwilczynski
Copy link
Owner

Hi @jjperry, thank you for taking the time to open an issue!

What if we add a dedicated fact for volume groups and logical volumes? Would that be something of interest?

@kwilczynski
Copy link
Owner

Hi @jjperry, after having a quick look, it seems that the puppetlabs-lvm provides facts around LVM (e.g., physical volumes, logical volumes, etc.).

I wonder, if this would be something that you could leverage?

@jjperry
Copy link
Author

jjperry commented Dec 6, 2019

I went that route first, but the bug https://tickets.puppetlabs.com/browse/MODULES-9779 prevents the facts from working on RHEL/CentOS 5, SUSE 10, and SUSE 11.1. Oddly, for SUSE 11.2 - 11.4, the facts do not generate any VG or LV data, returning instead {}.

Though I do see that it is does seem to pull lvm_vg_X, but no LVM data for the legacy OSes.

The LVM data provided by the facts don't give the Volume Group either.

logical_volumes => {
lvroot => {
uuid => "c058ah-dJ5O-jEhv-dNii-6chf-pzlC-i9CUYc",
full_name => "system/lvroot",
path => "/dev/system/lvroot",
dm_path => "/dev/mapper/system-lvroot",
attr => "-wi-ao----",
layout => "linear",
role => "public",
active => "active",
size => "2.78g",
permissions => "writeable"
},

Having dedicated facts to VGs and LVs, which work with Legacy OSes as well, would be very beneficial. Without the LVM module installed, you also can't access the Volume Groups and Logical Volumes in the facts section for a host in Foreman. It complains about .../parent_facts/<volume_groups|logical_volumes>not having data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants