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

Update disk resize to work with lvms-storage-operator/topolvm #4114

Closed
wants to merge 8 commits into from

Commits on Jul 31, 2024

  1. use label to find the root partition in ocp preset

    after using topolvm as storage provisioner there's
    two partitions of type xfs and its ambiguos  which
    is the root partition but the root partition  also
    has a label 'root' in case of the ocp bundle
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    d21c532 View commit details
    Browse the repository at this point in the history
  2. config: make persistent-volume-size applicable for ocp preset

    this allows users to also configure the persistent volume's partition
    size for the ocp preset, in case of ocp preset the default size of the
    persistent volume partition (topolvm partition) is 3G
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    7b5c5c0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d0f939f View commit details
    Browse the repository at this point in the history
  4. update disk resize to work with new disk layout

    to be able to use topolvm we need a separate parition this new
    partition is added at the end of the disk and used by  topolvm
    so the new disk layout is |efi|boot|root|pv|
    
    earlier the root parition could be easily extended after  increasing
    the disk size as there was no patition after it, with the new layout
    after increasing the disk size we have to move the "pv" partition to
    create free space after the "root" partition to increase its size
    
    this adds code to move topolvm partition and restart the VM which is
    needed to re-read the changed partition table, after moving the part
    the root partition can be grown
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    4be7f76 View commit details
    Browse the repository at this point in the history
  5. refactor: move function related to paritions into separate file

    this makes it a bit easier to navigate the start.go file by moving
    some of the disk size and partition modification functions into  a
    separate disks.go file in the same machine package
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    4b63967 View commit details
    Browse the repository at this point in the history
  6. remove hardcoded topolvm partition name

    this uses `blkid -t PARTLABEL=topolvm` to get the topolvm
    partition name and introduces a helper 'runBlkidQuery' to
    run different forms of the `blkid` command
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    7155747 View commit details
    Browse the repository at this point in the history
  7. refactor: rename growRootFileSystem to growFileSystem

    since it does more than growing only the root file system
    it additionally grows the partition used by  topolvm/lvms
    operator
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    2f814b3 View commit details
    Browse the repository at this point in the history
  8. disk-resize: use actual partition sizes to calculate pv shift size

    instead of relying on the config values and the constants for default
    disk-size and pv partition size, this fetches the size of disk,  root
    and pv partition using `lsblk` and uses these values to calculate the
    size by which the pv partition needs to be shifted to apply requested
    new values for 'disk-size' and 'persistent-volume-size' configs
    
    it uses the 'strongunits' package from containers/common for bytes to
    GiB conversions and its types to deal with storage sizes
    anjannath committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    d129b86 View commit details
    Browse the repository at this point in the history