/etc/lvm/devices/system.devices is created by vdsm-tool config-lvm-filter
when vgimportdevices is run. Once created, it does a sanity check with
lvmdevices --check, but this is too weak, as it only checks that the format and
the contents, but it does not check that it matches the system state.
The contents should look similar the result of running: pvs -o pv_device_id_type,pv_device_id,name,uuid,
but only for the relevant devices.
In lvmdevices we receive the VGs that we want to configure in the devicesfile,
so we can run something like pvdisplay -C -o vg_name,pv_name and see which
pvs are expected, and ensure they appear in the devicesfile.
If it does not match, print an error with the missing devices. Note that printing needs
to be done from the tool side, internal logging is hidden.
We may also want to raise or exit with error code from the tool.
So in fact we should return a boolean in the lvmdevices.configure,
in case the configuration check fails, the tool does not end with a
Configuration completed successfully! message.
/etc/lvm/devices/system.devices
is created byvdsm-tool config-lvm-filter
whenvgimportdevices
is run. Once created, it does a sanity check withlvmdevices --check
, but this is too weak, as it only checks that the format and the contents, but it does not check that it matches the system state.The contents should look similar the result of running:
pvs -o pv_device_id_type,pv_device_id,name,uuid
, but only for the relevant devices.In
lvmdevices
we receive the VGs that we want to configure in the devicesfile, so we can run something likepvdisplay -C -o vg_name,pv_name
and see which pvs are expected, and ensure they appear in the devicesfile.If it does not match, print an error with the missing devices. Note that printing needs to be done from the
tool
side, internal logging is hidden.We may also want to raise or exit with error code from the tool. So in fact we should return a boolean in the
lvmdevices.configure
, in case the configuration check fails, the tool does not end with aConfiguration completed successfully!
message.Related bug: