Skip to content

Latest commit

 

History

History
1462 lines (710 loc) · 25.3 KB

REFERENCE.md

File metadata and controls

1462 lines (710 loc) · 25.3 KB

Reference

Table of Contents

Classes

  • lvm: == Class: lvm

Defined types

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

Classes

lvm

== Class: lvm

Parameters

The following parameters are available in the lvm class.

package_ensure

Data type: Enum['installed', 'present', 'latest', 'absent']

Default value: 'installed'

manage_pkg

Data type: Boolean

Default value: false

volume_groups

Data type: Hash

Default value: {}

Defined types

lvm::logical_volume

== Define: lvm::logical_volume

Parameters

The following parameters are available in the lvm::logical_volume defined type.

volume_group

Data type: Any

size

Data type: Any

Default value: undef

initial_size

Data type: Any

Default value: undef

ensure

Data type: Enum['absent', 'present']

Default value: present

options

Data type: Any

Default value: 'defaults'

pass

Data type: Any

Default value: '2'

dump

Data type: Any

Default value: '0'

fs_type

Data type: Any

Default value: 'ext4'

mkfs_options

Data type: Any

Default value: undef

mountpath

Data type: Stdlib::Absolutepath

Default value: "/${name}"

mountpath_require

Data type: Boolean

Default value: false

mounted

Data type: Boolean

Default value: true

createfs

Data type: Boolean

Default value: true

extents

Data type: Any

Default value: undef

stripes

Data type: Any

Default value: undef

stripesize

Data type: Any

Default value: undef

readahead

Data type: Any

Default value: undef

range

Data type: Any

Default value: undef

size_is_minsize

Data type: Any

Default value: undef

type

Data type: Any

Default value: undef

thinpool

Data type: Variant[Boolean, String]

Default value: false

poolmetadatasize

Data type: Any

Default value: undef

mirror

Data type: Any

Default value: undef

mirrorlog

Data type: Any

Default value: undef

no_sync

Data type: Any

Default value: undef

region_size

Data type: Any

Default value: undef

alloc

Data type: Any

Default value: undef

lvm::physical_volume

== Define: lvm::physical_volume

Parameters

The following parameters are available in the lvm::physical_volume defined type.

ensure

Data type: Any

Default value: present

force

Data type: Any

Default value: false

unless_vg

Data type: Any

Default value: undef

lvm::volume

== 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/.

Parameters

The following parameters are available in the lvm::volume defined type.

ensure

Data type: Any

pv

Data type: Any

vg

Data type: Any

fstype

Data type: Any

Default value: undef

size

Data type: Any

Default value: undef

extents

Data type: Any

Default value: undef

initial_size

Data type: Any

Default value: undef

lvm::volume_group

== Define: lvm::volume_group

Parameters

The following parameters are available in the lvm::volume_group defined type.

physical_volumes

Data type: Variant[Hash, Array, String]

createonly

Data type: Boolean

Default value: false

ensure

Data type: Enum['present', 'absent']

Default value: present

logical_volumes

Data type: Hash

Default value: {}

followsymlinks

Data type: Boolean

Default value: false

Resource types

filesystem

The filesystem type

Properties

The following properties are available in the filesystem type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

size

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.

Parameters

The following parameters are available in the filesystem type.

fs_type

The file system type. eg. ext3.

name

namevar

mkfs_cmd

Command to use to create the file system. Defaults to mkswap for fs_type=swap, otherwise mkfs.{{fs_type}}

options

Params for the mkfs command. eg. -l internal,agcount=x

initial_size

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.

ag_size

Valid values: %r{\d+}

Specify the allocation group size in megabytes, AIX only.

large_files

Valid values: true, false

Large file enabled file system. AIX only

compress

Valid values: LG, no

Data compression, LZ or no. AIX only

frag

Valid values: %r{\d+}

JFS fragment size in bytes. AIX only

nbpi

Valid values: %r{\d+}

Bytes per inode. AIX only

logname

Configure the log logical volume. AIX only

logsize

Valid values: %r{\d+}

Size for an inline log in MB, AIX only

maxext

Valid values: %r{\d+}

Size of a file extent in file system blocks, AIX only

mountguard

Valid values: true, false

Enable the mountguard. AIX only

agblksize

Valid values: %r{\d+}

JFS2 block size in bytes, AIX only.

extended_attributes

Valid values: v1, v2

Format to be used to store extended attributes. AIX only

encrypted

Valid values: true, false

Specify and encrypted filesystem. AIX only

isnapshot

Valid values: true, false

Specify whether the filesystem supports internal snapshots, AIX only

mount_options

Specify the options to be passed to the mount command. AIX only

vix

Valid values: true, false

Specify that the file system can allocate inode extents smaller than the default, AIX only

log_partitions

Specify the size of the log logical volume as number of logical partitions, AIX only

nodename

Specify the remote host where the filesystem resides. AIX only

accounting

Valid values: true, false

Specify accounting subsystem support, AIX only

mountgroup

Mount group for the filesystem, AIX only

atboot

Valid values: true, false

Specify whether the file system is mounted at boot time, AIX only

perms

Valid values: ro, rw

Permissions for the filesystem, AIX only

device

Device to create the filesystem on, this can be a device or a logical volume. AIX only

volume_group

Volume group that the file system should be greated on. AIX only.

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/$vg/$lv').

Properties

The following properties are available in the logical_volume type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

volume_group

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.

size

The size of the logical volume. Set to undef to use all available space

mirror

The number of mirrors of the volume.

mirrorlog

Valid values: core, disk, mirrored

How to store the mirror log (core, disk, mirrored).

Parameters

The following parameters are available in the logical_volume type.

name

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').

initial_size

The initial size of the logical volume. This will only apply to newly-created volumes

extents

The number of logical extents to allocate for the new logical volume. Set to undef to use all available space

persistent

Set to true to make the block device persistent

thinpool

Set to true to create a thin pool or to pool name to create thin volume

Default value: false

poolmetadatasize

Change the size of logical volume pool metadata

minor

Set the minor number

type

Configures the logical volume type.

range

Sets the inter-physical volume allocation policy. AIX only

stripes

The number of stripes to allocate for the new logical volume.

stripesize

The stripesize to use for the new logical volume.

readahead

The readahead count to use for the new logical volume.

size_is_minsize

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

resize_fs

Whether or not to resize the underlying filesystem when resizing the logical volume.

Default value: true

alloc

Valid values: anywhere, contiguous, cling, inherit, normal

Selects the allocation policy when a command needs to allocate Physical Extents from the Volume Group.

no_sync

An optimization in lvcreate, at least on Linux.

region_size

physical_volume

Do not do anything if the VG already exists. The value should be the name of the volume group to check for.

Properties

The following properties are available in the physical_volume type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the physical_volume type.

name

namevar

unless_vg

Do not do anything if the VG already exists. The value should be the name of the volume group to check for.

force

Valid values: true, false

Force the creation without any confirmation.

Default value: false

volume_group

The name of the volume group.

Properties

The following properties are available in the volume_group type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

physical_volumes

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.

Parameters

The following parameters are available in the volume_group type.

name

namevar

The name of the volume group.

followsymlinks

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

createonly

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

Functions

lvm::bytes_to_size

Type: Puppet Language

The lvm::bytes_to_size function.

lvm::bytes_to_size(Numeric $size)

The lvm::bytes_to_size function.

Returns: Any

size

Data type: Numeric

lvm::size_to_bytes

Type: Puppet Language

The lvm::size_to_bytes function.

lvm::size_to_bytes(String $size)

The lvm::size_to_bytes function.

Returns: Any

size

Data type: String

Tasks

ensure_fs

Ensures settings on a filesystem using the type & provider

Supports noop? false

Parameters

fs_type

Data type: String

The file system type. eg. ext3.

name

Data type: String

Fully qualified name

mkfs_cmd

Data type: Optional[String]

Command to use to create the file system. Defaults to mkswap for fs_type=swap, otherwise mkfs.{{fs_type}}

options

Data type: Optional[String]

Params for the mkfs command. eg. -l internal,agcount=x

initial_size

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.

size

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.

ag_size

Data type: Optional[Integer]

Specify the allocation group size in megabytes, AIX only.

large_files

Data type: Optional[Boolean]

Large file enabled file system. AIX only

compress

Data type: Optional[Enum[LG,no]]

Data compression, LZ or no. AIX only

frag

Data type: Optional[Integer]

JFS fragment size in bytes. AIX only

nbpi

Data type: Optional[Integer]

Bytes per inode. AIX only

logname

Data type: Optional[String]

Configure the log logical volume. AIX only

logsize

Data type: Optional[Integer]

Size for an inline log in MB, AIX only

maxext

Data type: Optional[Integer]

Size of a file extent in file system blocks, AIX only

mountguard

Data type: Optional[Boolean]

Enable the mountguard. AIX only

agblksize

Data type: Optional[Integer]

JFS2 block size in bytes, AIX only

extended_attributes

Data type: Optional[Enum[v1,v2]]

Format to be used to store extended attributes. AIX only

encrypted

Data type: Optional[Boolean]

Specify and encrypted filesystem. AIX only

isnapshot

Data type: Optional[Boolean]

Specify whether the filesystem supports internal snapshots, AIX only

mount_options

Data type: Optional[String]

Specify the options to be passed to the mount command. AIX only

vix

Data type: Optional[Boolean]

Specify that the file system can allocate inode extents smaller than the default, AIX only

log_partitions

Data type: Optional[String]

Specify the size of the log logical volume as number of logical partitions, AIX only

nodename

Data type: Optional[String]

Specify the remote host where the filesystem resides. AIX only

accounting

Data type: Optional[Boolean]

Specify accounting subsystem support, AIX only

mountgroup

Data type: Optional[String]

Mount group for the filesystem, AIX only

atboot

Data type: Optional[Boolean]

Specify whether the file system is mounted at boot time, AIX only

perms

Data type: Optional[Enum[ro,rw]]

Permissions for the filesystem, AIX only

device

Data type: Optional[String]

Device to create the filesystem on, this can be a device or a logical volume. AIX only

volume_group

Data type: Optional[String]

Volume group that the file system should be greated on. AIX only.

ensure_lv

Ensures settings on a logical volume using the type & provider

Supports noop? false

Parameters

ensure

Data type: Enum[present,absent]

Present or absent

name

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').

volume_group

Data type: Optional[String[1]]

The volume group name associated with this logical volume

size

Data type: Optional[Pattern[/^[0-9]+(\.[0-9]+)?[KMGTPEkmgtpe]/]]

The size of the logical volume. Set to undef to use all available space

extents

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

persistent

Data type: Optional[Boolean]

Set to true to make the block device persistent

thinpool

Data type: Optional[Boolean]

Set to true to create a thin pool or to pool name to create thin volume

poolmetadatasize

Data type: Optional[Pattern[/^[0-9]+(\.[0-9]+)?[KMGTPEkmgtpe]/]]

Change the size of logical volume pool metadata

minor

Data type: Optional[Integer[0,255]]

Set the minor number

type

Data type: Optional[String[1]]

Configures the logical volume type

range

Data type: Optional[Enum[maximum,minimum]]

Sets the inter-physical volume allocation policy. AIX only

stripes

Data type: Optional[Integer]

The number of stripes to allocate for the new logical volume

stripesize

Data type: Optional[Integer]

The stripesize to use for the new logical volume

readahead

Data type: Optional[String]

The readahead count to use for the new logical volume

resize_fs

Data type: Optional[Boolean]

Whether or not to resize the underlying filesystem when resizing the logical volume

mirror

Data type: Optional[Integer[0,4]]

The number of mirrors of the volume

mirrorlog

Data type: Optional[Enum[core,disk,mirrored]]

How to store the mirror log

alloc

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

no_sync

Data type: ``

An optimization in lvcreate, at least on Linux

region_size

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.

ensure_pv

Ensures settings on a physical volumes using the type & provider

Supports noop? false

Parameters

name

Data type: String[1]

The name of the physical volume

ensure

Data type: Enum[present,absent]

Present or absent

unless_vg

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.

force

Data type: Optional[Boolean]

Force the creation without any confirmation

ensure_vg

Ensures settings on a volume group using the type & provider

Supports noop? false

Parameters

name

Data type: String[1]

The name of the volume group

ensure

Data type: Enum[present,absent]

Present or absent

createonly

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

followsymlinks

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'

physical_volumes

Data type: Array[String]

The list of physical volumes to be included in the volume group

extend_lv

Extends a logical volume

Supports noop? false

Parameters

size

Data type: String[1]

Intended size or 'full'

logical_volume

Data type: String[1]

Name of the logical volume to extend

volume_group

Data type: String[1]

Name of the volume group on which the logical volume resides

extend_vg

Adds physical volumes to a volume group

Supports noop? false

Parameters

volume_group

Data type: String[1]

The name of the volume group

physical_volumes

Data type: Array[String]

The list of physical volumes to be included in the volume group

mount_lv

Mounts a logical volume

Supports noop? false

Parameters

volume_group

Data type: String[1]

The name of the volume group

logical_volume

Data type: String[1]

The name of the logical_volume to mount

mountpoint

Data type: String[1]

Where to mount the logical volume

fstype

Data type: String

The mount type. Valid values depend on the operating system. This is a required option.

options

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

atboot

Data type: Optional[Boolean]

Whether to mount the mount at boot. Not all platforms support this.

owner

Data type: Optional[String]

Owner for the mountpoint

group

Data type: Optional[String]

Group for the mountpoint

mode

Data type: Optional[String]

Permissions for the mountpoint

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 tie the tasks together in some way that does.

Parameters

The following parameters are available in the lvm::expand plan.

server

Data type: String

The target for the plan

volume_group

Data type: String

The volume group to which the logical volume belongs

logical_volume

Data type: String

The logical volume which is to be expanded

additional_size

Data type: String

How much size to add to the LV. This should be specified in LVM format i.e. "200m" or "2.5g"

disks

Data type: Array[String]

Any physical disks that should be added to the volume group as part of the expand process

Default value: []

resize_fs

Data type: Boolean

Wheather or not to resize the filesystem

Default value: true