Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-8365

RFE: automatically generate system.devices in first boot

    • sst_logical_storage
    • ssg_filesystems_storage_and_HA
    • 3
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:

      A system run from an OS image does not have a way to automatically use system.devices. When an image is first run, steps need to be introduced to run vgimportdevices or lvmdevices --adddev, but image builders/users have not managed to do this (and images are being configured with use_devicesfile=0 to work around it.) This RFE is to make lvm automatically generate a system.devices file for the root VG when the system is first booted. Two similar methods to do this are:

      create_devicesfile_cmdline
      --------------------------
      Generate /etc/lvm/devices/system.devices from the first devices seen by the system that contain metadata matching the VG/LV in /proc/cmdline.

      . lvm.conf use_devicesfile = 1
      . lvm.conf create_devicesfile_cmdline = 1 (Or the existence of the empty file /etc/lvm/create_devicesfile_cmdline if it's simpler for image preparation to inject an empty file into an image rather than edit lvm.conf)
      . create_devicesfile_cmdline is only used if system.devices does not exist, so it only has an effect on the first boot (and the setting does not need to be disabled after it's run.)
      . When devices appear during system startup, pvscan is run on them by the lvm udev rule.
      . If system.devices exists, pvscan ignores the device if it's not included in system.devices.
      . If system.devices does not exist, pvscan uses the PV if it contains metadata matching /proc/cmdline VG/LV (i.e. rd.lvm.lv=vg/lv)
      . vgchange -aay <vgname> is run by the udev rule to activate the root VG. This command recognizes create_devicesfile_cmdline and creates a system.devices file containing devices in the root VG.

      create_devicesfile_vg
      ---------------------
      Generate /etc/lvm/devices/system.devices from the first devices seen by the system that contain metadata matching a specified VG name. This would cover cases where the kernel command line doesn't contain VG/LV info.

      . lvm.conf use_devicesfile = 1
      . lvm.conf create_devicesfile_vg=<vgname> (Or the existence of a file /etc/lvm/create_devicesfile_vg containing a VG name, since it may be simpler to inject this file into an image vs editing lvm.conf.)
      . create_devicesfile_vg is only used if system.devices does not exist, so it only has an effect on the first boot (and the setting does not need to be disabled after it's run.)
      . When devices appear during system startup, pvscan is run on them by the lvm udev rule.
      . If system.devices exists, pvscan ignores the device if it's not included in system.devices.
      . If system.devices does not exist, pvscan uses the PV if it contains metadata matching the specified VG name.
      . vgchange -aay <vgname> is run by the udev rule to activate the root VG. This command recognizes create_devicesfile_vg and creates a system.devices file containing devices in the root VG.

      Version-Release number of selected component (if applicable):

      How reproducible:

      Steps to Reproduce:
      1.
      2.
      3.

      Actual results:

      Expected results:

      Additional info:

            teigland@redhat.com David Teigland
            teigland@redhat.com David Teigland
            David Teigland David Teigland
            Cluster QE Cluster QE
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: