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

Physical volumes for logical volumes #212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

langesven
Copy link

This change allows the use of physical_volume as argument to logical_volume so that the new lv will be created on a specific physical volume even if the volume group consists of several physical volumes.

Example:
Volume Group vg00 consists of 4 physical volumes:

  PV         VG   Fmt  Attr PSize PFree
  /dev/sda   vg00 lvm2 a--  1.09t    0 
  /dev/sdb   vg00 lvm2 a--  1.09t    0 
  /dev/sdc   vg00 lvm2 a--  1.09t    0 
  /dev/sdd   vg00 lvm2 a--  1.09t    0 

Some lvs can span all 4 pvs in a raid1/mirror setup for example:

  --- Logical volume ---
  LV Path                /dev/vg00/home
  LV Name                home
  VG Name                vg00
[...]
  Mirrored volumes       4
[...]
  --- Segments ---
  Logical extents 0 to 2559:
    Type                raid1

And other volumes can be created on one specific pv of the four that are part of vg00:

  --- Logical volume ---
  LV Path                /dev/vg00/data01
  LV Name                data01
  VG Name                vg00
[...]
  --- Segments ---
  Logical extents 0 to 270793:
    Type                linear
    Physical volume     /dev/sda

Example hiera code:

lvm::volume_groups:
  vg00:
    physical_volumes:
      - '/dev/sda'
      - '/dev/sdb'
      - '/dev/sdc'
      - '/dev/sdd'
    logical_volumes:
      home:
        size: 10GB
        fs_type: xfs
        mirror: 3
        type: raid1
      data01:
        size: ~
        mountpath: '/srv/data01'
        fs_type: xfs
        physical_volume: '/dev/sda'

This change allows the use of physical_volume as argument to
logical_volume so that the new lv will be created on a specific physical
volume even if the volume group consists of several physical volumes.

Signed-off-by: Sven Lange <[email protected]>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants