Classes
lvm
: == Class: lvm
Defined types
lvm::logical_volume
: == Define: lvm::logical_volumelvm::physical_volume
: == Define: lvm::physical_volumelvm::volume
: == Define: lvm::volume This defined type will create alogical_volume
with the name of the define and ensure aphysical_v
lvm::volume_group
: == Define: lvm::volume_group
Resource types
filesystem
: The filesystem type
logical_volume
: The name of the logical volume. This is the unqualified name and will be automatically added to the volume group's device path (e.g., '/dev/
physical_volume
: Do not do anything if the VG already exists. The value should be the name of the volume group to check for.
volume_group
: The name of the volume group.
Functions
Tasks
ensure_fs
: Ensures settings on a filesystem using the type & provider
ensure_lv
: Ensures settings on a logical volume using the type & provider
ensure_pv
: Ensures settings on a physical volumes using the type & provider
ensure_vg
: Ensures settings on a volume group using the type & provider
extend_lv
: Extends a logical volume
extend_vg
: Adds physical volumes to a volume group
mount_lv
: Mounts a logical volume
Plans
lvm::expand
: lvm::expand This plan implements an opinionated method for expanding storage on servers that use LVM. If this doesn't fit your needs, simply
== Class: lvm
The following parameters are available in the lvm
class.
Data type: Enum['installed', 'present', 'latest', 'absent']
Default value: 'installed'
Data type: Boolean
Default value: false
Data type: Hash
Default value: {}
== Define: lvm::logical_volume
The following parameters are available in the lvm::logical_volume
defined type.
Data type: Any
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Enum['absent', 'present']
Default value: present
Data type: Any
Default value: 'defaults'
Data type: Any
Default value: '2'
Data type: Any
Default value: '0'
Data type: Any
Default value: 'ext4'
Data type: Any
Default value: undef
Data type: Stdlib::Absolutepath
Default value: "/${name}"
Data type: Boolean
Default value: false
Data type: Boolean
Default value: true
Data type: Boolean
Default value: true
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Variant[Boolean, String]
Default value: false
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
== Define: lvm::physical_volume
The following parameters are available in the lvm::physical_volume
defined type.
Data type: Any
Default value: present
Data type: Any
Default value: false
Data type: Any
Default value: undef
== Define: lvm::volume
This defined type will create a logical_volume
with the name of
the define and ensure a physical_volume
,
volume_group
, and filesystem
resource have been
created on the block device supplied.
=== Parameters
[ensure] Can only be set to cleaned
, absent
or
present
. A value of present
will ensure that the
physical_volume
, volume_group
,
logical_volume
, and filesystem
resources are
present for the volume. A value of cleaned
will ensure that all
of the resources are absent
Warning this has a high potential
for unexpected harm use it with caution. A value of absent
will remove only the logical_volume
resource from the system.
[pv] The block device to ensure a physical_volume
has been
created on. [vg] The volume_group
to ensure is created on the
physical_volume
provided by the pv
parameter.
[fstype] The type of filesystem
to create on the logical
volume. [size] The size the logical_voluem
should be.
=== Examples
Provide some examples on how to use this type:
lvm::volume { 'lv_example0':
vg => 'vg_example0',
pv => '/dev/sdd1',
fstype => 'ext4',
size => '100GB',
}
=== Copyright
See README.markdown for the module author information.
=== License
This file is part of the puppetlabs/lvm puppet module.
puppetlabs/lvm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation, version 2 of the License.
puppetlabs/lvm is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along
with puppetlabs/lvm. If not, see http://www.gnu.org/licenses/.
The following parameters are available in the lvm::volume
defined type.
Data type: Any
Data type: Any
Data type: Any
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
== Define: lvm::volume_group
The following parameters are available in the lvm::volume_group
defined type.
Data type: Variant[Hash, Array, String]
Data type: Boolean
Default value: false
Data type: Enum['present', 'absent']
Default value: present
Data type: Hash
Default value: {}
Data type: Boolean
Default value: false
The filesystem type
The following properties are available in the filesystem
type.
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
Configures the size of the filesystem. Supports filesystem resizing. The size will be rounded up to the nearest multiple of the partition size. AIX only.
The following parameters are available in the filesystem
type.
The file system type. eg. ext3.
namevar
Command to use to create the file system. Defaults to mkswap for fs_type=swap, otherwise mkfs.{{fs_type}}
Params for the mkfs command. eg. -l internal,agcount=x
Initial size of the filesystem, Used only for resource creation, when using this option Puppet will not manage or maintain the size. To resize filesystems see the size property. AIX only.
Valid values: %r{\d+}
Specify the allocation group size in megabytes, AIX only.
Valid values: true
, false
Large file enabled file system. AIX only
Valid values: LG, no
Data compression, LZ or no. AIX only
Valid values: %r{\d+}
JFS fragment size in bytes. AIX only
Valid values: %r{\d+}
Bytes per inode. AIX only
Configure the log logical volume. AIX only
Valid values: %r{\d+}
Size for an inline log in MB, AIX only
Valid values: %r{\d+}
Size of a file extent in file system blocks, AIX only
Valid values: true
, false
Enable the mountguard. AIX only
Valid values: %r{\d+}
JFS2 block size in bytes, AIX only.
Valid values: v1, v2
Format to be used to store extended attributes. AIX only
Valid values: true
, false
Specify and encrypted filesystem. AIX only
Valid values: true
, false
Specify whether the filesystem supports internal snapshots, AIX only
Specify the options to be passed to the mount command. AIX only
Valid values: true
, false
Specify that the file system can allocate inode extents smaller than the default, AIX only
Specify the size of the log logical volume as number of logical partitions, AIX only
Specify the remote host where the filesystem resides. AIX only
Valid values: true
, false
Specify accounting subsystem support, AIX only
Mount group for the filesystem, AIX only
Valid values: true
, false
Specify whether the file system is mounted at boot time, AIX only
Valid values: ro, rw
Permissions for the filesystem, AIX only
Device to create the filesystem on, this can be a device or a logical volume. AIX only
Volume group that the file system should be greated on. AIX only.
The name of the logical volume. This is the unqualified name and will be
automatically added to the volume group's device path (e.g., '/dev/$vg/$lv').
The following properties are available in the logical_volume
type.
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
The volume group name associated with this logical volume. This will automatically
set this volume group as a dependency, but it must be defined elsewhere using the
volume_group resource type.
The size of the logical volume. Set to undef to use all available space
The number of mirrors of the volume.
Valid values: core, disk, mirrored
How to store the mirror log (core, disk, mirrored).
The following parameters are available in the logical_volume
type.
namevar
The name of the logical volume. This is the unqualified name and will be
automatically added to the volume group's device path (e.g., '/dev/$vg/$lv').
The initial size of the logical volume. This will only apply to newly-created volumes
The number of logical extents to allocate for the new logical volume. Set to undef to use all available space
Set to true to make the block device persistent
Set to true to create a thin pool or to pool name to create thin volume
Default value: false
Change the size of logical volume pool metadata
Set the minor number
Configures the logical volume type.
Sets the inter-physical volume allocation policy. AIX only
The number of stripes to allocate for the new logical volume.
The stripesize to use for the new logical volume.
The readahead count to use for the new logical volume.
Set to true if the 'size' parameter specified, is just the
minimum size you need (if the LV found is larger then the size requests
this is just logged not causing a FAIL)
Default value: false
Whether or not to resize the underlying filesystem when resizing the logical volume.
Default value: true
Valid values: anywhere, contiguous, cling, inherit, normal
Selects the allocation policy when a command needs to allocate Physical Extents from the Volume Group.
An optimization in lvcreate, at least on Linux.
Do not do anything if the VG already exists. The value should be the
name of the volume group to check for.
The following properties are available in the physical_volume
type.
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
The following parameters are available in the physical_volume
type.
namevar
Do not do anything if the VG already exists. The value should be the
name of the volume group to check for.
Valid values: true
, false
Force the creation without any confirmation.
Default value: false
The name of the volume group.
The following properties are available in the volume_group
type.
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
The list of physical volumes to be included in the volume group; this
will automatically set these as dependencies, but they must be defined elsewhere
using the physical_volume resource type.
The following parameters are available in the volume_group
type.
namevar
The name of the volume group.
Valid values: true
, false
, yes, no
Aliases: "yes"=>"true", "no"=>"false"
If set to true all current and wanted values of the physical_volumes property
will be followed to their real files on disk if they are in fact symlinks. This is
useful to have Puppet determine what the actual PV device is if the property value
is a symlink, like '/dev/disk/by-path/xxxx -> ../../sda'. Defaults to False
.
Default value: false
Valid values: true
, false
, yes, no
Aliases: "yes"=>"true", "no"=>"false"
If set to true the volume group will be created if it does not exist. If the
volume group does exist no action will be taken. Defaults to false
.
Default value: false
Type: Puppet Language
The lvm::bytes_to_size function.
The lvm::bytes_to_size function.
Returns: Any
Data type: Numeric
Type: Puppet Language
The lvm::size_to_bytes function.
The lvm::size_to_bytes function.
Returns: Any
Data type: String
Ensures settings on a filesystem using the type & provider
Supports noop? false
Data type: String
The file system type. eg. ext3.
Data type: String
Fully qualified name
Data type: Optional[String]
Command to use to create the file system. Defaults to mkswap for fs_type=swap, otherwise mkfs.{{fs_type}}
Data type: Optional[String]
Params for the mkfs command. eg. -l internal,agcount=x
Data type: Optional[String]
Initial size of the filesystem, Used only for resource creation, when using this option Puppet will not manage or maintain the size. To resize filesystems see the size property. AIX only.
Data type: Optional[String]
Configures the size of the filesystem. Supports filesystem resizing. The size will be rounded up to the nearest multiple of the partition size. AIX only.
Data type: Optional[Integer]
Specify the allocation group size in megabytes, AIX only.
Data type: Optional[Boolean]
Large file enabled file system. AIX only
Data type: Optional[Enum[LG,no]]
Data compression, LZ or no. AIX only
Data type: Optional[Integer]
JFS fragment size in bytes. AIX only
Data type: Optional[Integer]
Bytes per inode. AIX only
Data type: Optional[String]
Configure the log logical volume. AIX only
Data type: Optional[Integer]
Size for an inline log in MB, AIX only
Data type: Optional[Integer]
Size of a file extent in file system blocks, AIX only
Data type: Optional[Boolean]
Enable the mountguard. AIX only
Data type: Optional[Integer]
JFS2 block size in bytes, AIX only
Data type: Optional[Enum[v1,v2]]
Format to be used to store extended attributes. AIX only
Data type: Optional[Boolean]
Specify and encrypted filesystem. AIX only
Data type: Optional[Boolean]
Specify whether the filesystem supports internal snapshots, AIX only
Data type: Optional[String]
Specify the options to be passed to the mount command. AIX only
Data type: Optional[Boolean]
Specify that the file system can allocate inode extents smaller than the default, AIX only
Data type: Optional[String]
Specify the size of the log logical volume as number of logical partitions, AIX only
Data type: Optional[String]
Specify the remote host where the filesystem resides. AIX only
Data type: Optional[Boolean]
Specify accounting subsystem support, AIX only
Data type: Optional[String]
Mount group for the filesystem, AIX only
Data type: Optional[Boolean]
Specify whether the file system is mounted at boot time, AIX only
Data type: Optional[Enum[ro,rw]]
Permissions for the filesystem, AIX only
Data type: Optional[String]
Device to create the filesystem on, this can be a device or a logical volume. AIX only
Data type: Optional[String]
Volume group that the file system should be greated on. AIX only.
Ensures settings on a logical volume using the type & provider
Supports noop? false
Data type: Enum[present,absent]
Present or absent
Data type: String[1]
The name of the logical volume. This is the unqualified name and will be automatically added to the volume group's device path (e.g., '/dev/$vg/$lv').
Data type: Optional[String[1]]
The volume group name associated with this logical volume
Data type: Optional[Pattern[/^[0-9]+(\.[0-9]+)?[KMGTPEkmgtpe]/]]
The size of the logical volume. Set to undef to use all available space
Data type: Optional[Pattern[/^\d+(%(?:vg|pvs|free|origin)?)?$/]]
The number of logical extents to allocate for the new logical volume. Set to undef to use all available space
Data type: Optional[Boolean]
Set to true to make the block device persistent
Data type: Optional[Boolean]
Set to true to create a thin pool or to pool name to create thin volume
Data type: Optional[Pattern[/^[0-9]+(\.[0-9]+)?[KMGTPEkmgtpe]/]]
Change the size of logical volume pool metadata
Data type: Optional[Integer[0,255]]
Set the minor number
Data type: Optional[String[1]]
Configures the logical volume type
Data type: Optional[Enum[maximum,minimum]]
Sets the inter-physical volume allocation policy. AIX only
Data type: Optional[Integer]
The number of stripes to allocate for the new logical volume
Data type: Optional[Integer]
The stripesize to use for the new logical volume
Data type: Optional[String]
The readahead count to use for the new logical volume
Data type: Optional[Boolean]
Whether or not to resize the underlying filesystem when resizing the logical volume
Data type: Optional[Integer[0,4]]
The number of mirrors of the volume
Data type: Optional[Enum[core,disk,mirrored]]
How to store the mirror log
Data type: Optional[Enum[anywhere,contiguous,cling,inherit,normal]]
Selects the allocation policy when a command needs to allocate Physical Extents from the Volume Group
Data type: ``
An optimization in lvcreate, at least on Linux
Data type: Optional[Integer]
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.
Ensures settings on a physical volumes using the type & provider
Supports noop? false
Data type: String[1]
The name of the physical volume
Data type: Enum[present,absent]
Present or absent
Data type: Optional[String]
Do not do anything if the VG already exists. The value should be the name of the volume group to check for.
Data type: Optional[Boolean]
Force the creation without any confirmation
Ensures settings on a volume group using the type & provider
Supports noop? false
Data type: String[1]
The name of the volume group
Data type: Enum[present,absent]
Present or absent
Data type: Optional[Boolean]
If set to true the volume group will be created if it does not exist. If the volume group does exist no action will be taken
Data type: Optional[Boolean]
If set to true all current and wanted values of the physical_volumes property will be followed to their real files on disk if they are in fact symlinks. This is useful to have Puppet determine what the actual PV device is if the property value is a symlink, like '/dev/disk/by-path/xxxx -> ../../sda'
Data type: Array[String]
The list of physical volumes to be included in the volume group
Extends a logical volume
Supports noop? false
Data type: String[1]
Intended size or 'full'
Data type: String[1]
Name of the logical volume to extend
Data type: String[1]
Name of the volume group on which the logical volume resides
Adds physical volumes to a volume group
Supports noop? false
Data type: String[1]
The name of the volume group
Data type: Array[String]
The list of physical volumes to be included in the volume group
Mounts a logical volume
Supports noop? false
Data type: String[1]
The name of the volume group
Data type: String[1]
The name of the logical_volume to mount
Data type: String[1]
Where to mount the logical volume
Data type: String
The mount type. Valid values depend on the operating system. This is a required option.
Data type: Optional[String]
A single string containing options for the mount, as they would appear in fstab on Linux. For many platforms this is a comma-delimited string
Data type: Optional[Boolean]
Whether to mount the mount at boot. Not all platforms support this.
Data type: Optional[String]
Owner for the mountpoint
Data type: Optional[String]
Group for the mountpoint
Data type: Optional[String]
Permissions for the mountpoint
lvm::expand
This plan implements an opinionated method for expanding storage on servers
that use LVM. If this doesn't fit your needs, simply tie the tasks together
in some way that does.
The following parameters are available in the lvm::expand
plan.
Data type: String
The target for the plan
Data type: String
The volume group to which the logical volume belongs
Data type: String
The logical volume which is to be expanded
Data type: String
How much size to add to the LV. This should be
specified in LVM format i.e. "200m" or "2.5g"
Data type: Array[String]
Any physical disks that should be added to the volume group as
part of the expand process
Default value: []
Data type: Boolean
Wheather or not to resize the filesystem
Default value: true