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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ resources out yourself.
* mounted - If puppet should mount the volume. This only affects what puppet will do, and not what will be mounted at boot-time.
* no_sync (Parameter) - An optimization in lvcreate, at least on Linux.
* persistent (Parameter) - Set to true to make the block device persistent
* physical_volume (Parameter) - Create this logical volume on the specified physical volume
* poolmetadatasize (Parameter) - Set the initial size of the logical volume pool metadata on creation
* readahead (Parameter) - The readahead count to use for the new logical volume.
* region_size (Parameter) - A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions are in sync. CAN NOT BE CHANGED on already mirrored volume. Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument.
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/provider/logical_volume/lvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def create
else
args << @resource[:volume_group]
end

if @resource[:physical_volume]
args << @resource[:physical_volume]
end
lvcreate(*args)
end

Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/type/logical_volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
volume_group resource type."
end

newparam(:physical_volume) do
desc "The physical volume name this logical volume will be created on."
end

newparam(:initial_size) do
desc "The initial size of the logical volume. This will only apply to newly-created volumes"
validate do |value|
Expand Down
2 changes: 2 additions & 0 deletions manifests/logical_volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$no_sync = undef,
$region_size = undef,
$alloc = undef,
$physical_volume = undef,
) {

$lvm_device_path = "/dev/${volume_group}/${name}"
Expand Down Expand Up @@ -90,6 +91,7 @@
no_sync => $no_sync,
region_size => $region_size,
alloc => $alloc,
physical_volume => $physical_volume,
}

if $createfs {
Expand Down