diff --git a/lib/puppet/provider/volume_group/lvm.rb b/lib/puppet/provider/volume_group/lvm.rb index 44ac190f..e51d3792 100644 --- a/lib/puppet/provider/volume_group/lvm.rb +++ b/lib/puppet/provider/volume_group/lvm.rb @@ -44,7 +44,7 @@ def self.get_logical_volume_properties(volume_groups_line) end def create - vgcreate(@resource[:name], *@resource.should(:physical_volumes)) + vgcreate(@resource[:name], *@resource.should(:physical_volumes), '-s', @resource[:extents_size]) end def destroy diff --git a/lib/puppet/type/volume_group.rb b/lib/puppet/type/volume_group.rb index b98de0f1..bd25405a 100644 --- a/lib/puppet/type/volume_group.rb +++ b/lib/puppet/type/volume_group.rb @@ -64,4 +64,12 @@ def insync?(is) aliasvalue(:no, :false) defaultto :false end + + newparam(:extents_size) do + desc 'The physical extents size. Defaults to 4(M).' + validate do |value| + raise ArgumentError, "#{value} is not a valid extents size" unless %r{^[0-9]+(\.[0-9]+)?}i.match?(value) + end + defaultto 4 + end end