diff --git a/README.md b/README.md index cfb8dea2..703738dc 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/puppet/provider/logical_volume/lvm.rb b/lib/puppet/provider/logical_volume/lvm.rb index 4af6a2c8..84e7dc86 100644 --- a/lib/puppet/provider/logical_volume/lvm.rb +++ b/lib/puppet/provider/logical_volume/lvm.rb @@ -133,6 +133,10 @@ def create else args << @resource[:volume_group] end + + if @resource[:physical_volume] + args << @resource[:physical_volume] + end lvcreate(*args) end diff --git a/lib/puppet/type/logical_volume.rb b/lib/puppet/type/logical_volume.rb index 35479adc..d046b0bf 100644 --- a/lib/puppet/type/logical_volume.rb +++ b/lib/puppet/type/logical_volume.rb @@ -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| diff --git a/manifests/logical_volume.pp b/manifests/logical_volume.pp index bd50a3f8..cade5f9e 100644 --- a/manifests/logical_volume.pp +++ b/manifests/logical_volume.pp @@ -28,6 +28,7 @@ $no_sync = undef, $region_size = undef, $alloc = undef, + $physical_volume = undef, ) { $lvm_device_path = "/dev/${volume_group}/${name}" @@ -90,6 +91,7 @@ no_sync => $no_sync, region_size => $region_size, alloc => $alloc, + physical_volume => $physical_volume, } if $createfs {