chef-cookbooks / Lvm

Licence: apache-2.0
Development repository for lvm Chef cookbook

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Lvm

Yum
Development repository for yum cookbook
Stars: ✭ 96 (+88.24%)
Mutual labels:  hacktoberfest, chef, cookbook
Cookstyle
A linting tool that helps you to write better Chef Infra cookbooks by detecting and automatically correcting style, syntax, and logic mistakes in your code.
Stars: ✭ 95 (+86.27%)
Mutual labels:  hacktoberfest, chef, cookbook
Chef Vault
chef-vault cookbook
Stars: ✭ 63 (+23.53%)
Mutual labels:  hacktoberfest, chef, cookbook
Chef Client
Development repository for Chef Client cookbook
Stars: ✭ 183 (+258.82%)
Mutual labels:  hacktoberfest, chef, cookbook
Sudo
Development repository for sudo cookbook
Stars: ✭ 113 (+121.57%)
Mutual labels:  hacktoberfest, chef, cookbook
Iptables
Development repository for Chef Cookbook iptables
Stars: ✭ 96 (+88.24%)
Mutual labels:  hacktoberfest, chef, cookbook
Ssh known hosts
Development repository for Chef Cookbook ssh_known_hosts
Stars: ✭ 73 (+43.14%)
Mutual labels:  hacktoberfest, chef, cookbook
Runit
Development repository for the Chef Runit Cookbook
Stars: ✭ 101 (+98.04%)
Mutual labels:  hacktoberfest, chef, cookbook
Chef Server
Cookbook to install standalone Chef Server
Stars: ✭ 173 (+239.22%)
Mutual labels:  hacktoberfest, chef, cookbook
Windows
Development repository for Chef Cookbook windows
Stars: ✭ 251 (+392.16%)
Mutual labels:  hacktoberfest, chef, cookbook
Redisio
Development repository for the redisio cookbook
Stars: ✭ 296 (+480.39%)
Mutual labels:  hacktoberfest, chef
Apache2
Development repository for the apache2 cookbook
Stars: ✭ 262 (+413.73%)
Mutual labels:  hacktoberfest, chef
sudo
Development repository for sudo cookbook
Stars: ✭ 119 (+133.33%)
Mutual labels:  chef, cookbook
heartbeat
Development repository for Chef Cookbook heartbeat
Stars: ✭ 13 (-74.51%)
Mutual labels:  chef, cookbook
Mysql
Sous Chefs MySQL Cookbook
Stars: ✭ 325 (+537.25%)
Mutual labels:  hacktoberfest, chef
Postgresql
Development repository for the postgresql cookbook
Stars: ✭ 326 (+539.22%)
Mutual labels:  hacktoberfest, chef
Ruby rbenv
Development repository for the ruby_rbenv cookbook
Stars: ✭ 339 (+564.71%)
Mutual labels:  hacktoberfest, chef
Java
Development repository for the java cookbook
Stars: ✭ 365 (+615.69%)
Mutual labels:  hacktoberfest, chef
Jenkins
Development repository for the jenkins cookbook
Stars: ✭ 416 (+715.69%)
Mutual labels:  hacktoberfest, chef
audit
Audit Cookbook for Chef Compliance
Stars: ✭ 58 (+13.73%)
Mutual labels:  chef, cookbook

lvm Cookbook

delivery Cookbook Version

Installs lvm2 package and includes resources for managing LVM.

Note on LVM gems

This cookbook has used multiple variants of the ruby-lvm and ruby-lvm-attrib gems for interacting with LVM. Most recently we used di-ruby-lvm and di-ruby-lvm-attrib gems, which are no longer being maintained. As of the 4.0 release this cookbook uses new Chef maintained gems: chef-ruby-lvm and chef-ruby-lvm-attrib. Previous versions of this cookbook supported cleaning those gems up for approximetly 3 years. At this point you'll need to remove those gems yourself if they're still present as the namespaces will conflict. If you previously used attributes to control the version of the gems to install, you will need to update to the latest attribute names to maintain that functionality.

Requirements

Platforms

  • Debian/Ubuntu
  • RHEL/CentOS/Scientific/Amazon/Oracle
  • SLES

Chef

  • Chef 12.15+

Cookbooks

  • none

Resources/Providers

lvm_physical_volume

Manages LVM physical volumes.

Actions

Action Description
:create (default) Creates a new physical volume
:resize Resize an existing physical volume

Properties

Property Description Example Default
name (required) The device to create the new physical volume on /dev/sda
wipe_signatures Force the creation of the Logical Volume, even if lvm detects existing PV signatures true false
ignore_skipped_cluster Continue execution even if lvm detects skipped clustered volume groups true false

Examples

lvm_physical_volume '/dev/sda'

lvm_logical_volume

Manages LVM logical volumes.

Actions

Action Description
:create (default) Creates a new logical volume
:resize Resize an existing logical volume (resizing only handles extending existing, this action will not shrink volumes due to the 'lvextend' command being passed)
:remove Remove an existing logical volume (optionally clean up the mount location/directory)

Parameters

Attribute Description Example Default
name (name attribute) Name of the logical volume bacon
group (required) Volume group in which to create the new volume (not required if the volume is declared inside of an `lvm_volume_group` block) bits
size (required) Size of the volume.
  • It can be the size of the volume with units (k, K, m, M, g, G, t, T)
  • It can be specified as the percentage of the size of the volume group
  • 10G
  • 25%VG
filesystem The format for the file system 'ext4'
filesystem_params Optional parameters to use when formatting the file system '-j -L log -m 2 -i 10240 -J size=400 -b 4096'
mount_point Either a String containing the path to the mount point, or a Hash with the following keys:
  • driver: name: dokken privileged: true # because Docker and SystemD/Upstart chef_version: current - (required) the directory to mount the volume on
  • options - the mount options for the volume
  • dump - the dump field for the fstab entry
  • pass - the pass field for the fstab entry
'/var/my/mount'
physical_volumes Array of physical volumes that the volume will be restricted to ['/dev/sda', '/dev/sdb']
stripes Number of stripes for the volume 5
stripe_size Number of kilobytes per stripe segment (must be a power of 2 less than or equal to the physical extent size for the volume group) 24
mirrors Number of mirrors for the volume 5
contiguous Whether or not volume should use the contiguous allocation policy true false
readahead The readahead sector count for the volume (can be a value between 2 and 120, 'auto', or 'none') 'auto'
take_up_free_space whether to have the LV take up the remainder of free space on the VG. Only valid for resize action true false
wipe_signatures Force the creation of the Logical Volume, even if `lvm` detects existing LV signatures true false
ignore_skipped_cluster Continue execution even if `lvm` detects skipped clustered volume groups true false
lv_params Optional parameters to be passed to LVM '--nofsck'
remove_mount_point Optional parameter to be passed to LVM during a :remove event to clean up the directory true false

Examples

lvm_logical_volume 'home' do
  group       'vg00'
  size        '25%VG'
  filesystem  'ext4'
  mount_point '/home'
  stripes     3
  mirrors     2
end

lvm_logical_volume 'test' do
  group               'vg01'
  mount_point         '/mnt/test'
  remove_mount_point  true
  action              :remove
end

lvm_thin_pool

Manages LVM thin pools (which are simply logical volumes created with the --thinpool argument to lvcreate).

Actions

Action Description
:create (default) Create a new thin pool logical volume
:resize Resize an existing thin pool logical volume (resizing only handles extending existing, this action will not shrink volumes due to the 'lvextend' command being passed)

Parameters

Attribute Description Example Default
name (name attribute) Name of the logical volume bacon
group (required) Volume group in which to create the new volume (not required if the volume is declared inside of an `lvm_volume_group` block) bits
size (required) Size of the volume.
  • It can be the size of the volume with units (k, K, m, M, g, G, t, T)
  • It can be specified as the percentage of the size of the volume group
  • 10G
  • 25%VG
filesystem The format for the file system 'ext4'
filesystem_params Optional parameters to use when formatting the file system '-j -L log -m 2 -i 10240 -J size=400 -b 4096'
mount_point Either a String containing the path to the mount point, or a Hash with the following keys:
  • driver: name: dokken privileged: true # because Docker and SystemD/Upstart chef_version: current - (required) the directory to mount the volume on
  • options - the mount options for the volume
  • dump - the dump field for the fstab entry
  • pass - the pass field for the fstab entry
'/var/my/mount'
physical_volumes Array of physical volumes that the volume will be restricted to ['/dev/sda', '/dev/sdb']
stripes Number of stripes for the volume 5
stripe_size Number of kilobytes per stripe segment (must be a power of 2 less than or equal to the physical extent size for the volume group) 24
mirrors Number of mirrors for the volume 5
contiguous Whether or not volume should use the contiguous allocation policy true false
readahead The readahead sector count for the volume (can be a value between 2 and 120, 'auto', or 'none') 'auto'
take_up_free_space whether to have the LV take up the remainder of free space on the VG. Only valid for resize action true false
thin_volume Shortcut for creating a new `lvm_thin_volume` definition (the volumes will be created in the order they are declared)

lvm_thin_volume

Manages LVM thin volumes (which are simply logical volumes created with the --thin argument to lvcreate and are contained inside of other logical volumes that were created with the --thinpool option to lvcreate).

Actions

Action Description
:create (default) Create a new thin logical volume
:resize Resize an existing thin logical volume (resizing only handles extending existing, this action will not shrink volumes due to the 'lvextend' command being passed)

Parameters

Attribute Description Example Default
name (name attribute) Name of the logical volume bacon
group (required) Volume group in which to create the new volume (not required if the volume is declared inside of an `lvm_volume_group` block) bits
pool (required) Thin pool volume in which to create the new volume (not required if the volume is declared inside of an `lvm_thin_pool` block) bits
size (required) Size of the volume.
  • It can be the size of the volume with units (k, K, m, M, g, G, t, T)
  • 10G
filesystem The format for the file system 'ext4'
filesystem_params Optional parameters to use when formatting the file system '-j -L log -m 2 -i 10240 -J size=400 -b 4096'
mount_point Either a String containing the path to the mount point, or a Hash with the following keys:
  • driver: name: dokken privileged: true # because Docker and SystemD/Upstart chef_version: current - (required) the directory to mount the volume on
  • options - the mount options for the volume
  • dump - the dump field for the fstab entry
  • pass - the pass field for the fstab entry
'/var/my/mount'

Examples

lvm_thin_volume 'thin01' do
  group       'vg00'
  pool        'lv-thin-pool'
  size        '5G'
  filesystem  'ext4'
  mount_point location: '/var/thin01', options: 'noatime,nodiratime'
end

lvm_volume_group

Manages LVM volume groups.

Actions

Action Description
:create (default) Creates a new volume group
:extend Extend an existing volume group to include new physical volumes

Properties

Property Description Example Default
name (required) Name of the volume group 'bacon'
physical_volumes (required) The device or list of devices to use as physical volumes (if they haven't already been initialized as physical volumes, they will be initialized automatically) ['/dev/sda', '/dev/sdb']
physical_extent_size The physical extent size for the volume group
logical_volume Shortcut for creating a new lvm_logical_volume definition (the logical volumes will be created in the order they are declared)
wipe_signatures Force the creation of the Volume Group, even if lvm detects existing non-LVM data on disk true false
thin_pool Shortcut for creating a new lvm_thin_pool definition (the logical volumes will be created in the order they are declared)
ignore_skipped_cluster Continue execution even if lvm detects skipped clustered volume groups true false

Examples

lvm_volume_group 'vg00' do
  physical_volumes ['/dev/sda', '/dev/sdb', '/dev/sdc']
  wipe_signatures true

  logical_volume 'logs' do
    size        '1G'
    filesystem  'xfs'
    mount_point location: '/var/log', options: 'noatime,nodiratime'
    stripes     3
  end

  logical_volume 'home' do
    size        '25%VG'
    filesystem  'ext4'
    mount_point '/home'
    stripes     3
    mirrors     2
  end

  thin_pool "lv-thin-pool" do
    size '5G'
    stripes 2

    thin_volume "thin01" do
      size '10G'
      filesystem  'ext4'
      mount_point location: '/var/thin01', options: 'noatime,nodiratime'
    end
  end
end

lvm_thin_pool_meta_data

Manages LVM thin pool metadata size.

Actions

Action Description
:resize Resize an existing thin pool metadata volume (resizing only handles extending existing, this action will not shrink volumes due to the 'lvextend' command being passed)

Properties

Property Description Example Default
name (name attribute) Name of the thin pool metadata volume bacon
group (required) Name of volume group in which thin pool metadata volume exist. bits
pool (required) Name of thin pool volume in which thin pool metadata volume exist. bits
size (required) Size of the thin pool metadata volume. It can be the size of the volume with units (k, K, m, M, g, G, t, T) 2M

Examples

lvm_thin_pool_meta_data 'lv-thin-pool_tmeta' do
  group       'vg00'
  pool        'lv-thin-pool'q
  size        '2M'
  action      :resize
end

Usage

Include the default recipe in your run list on a node, in a role, or in another recipe:

run_list(
  'recipe[lvm::default]'
)

Depend on lvm in any cookbook that uses its Resources/Providers:

# other_cookbook/metadata.rb
depends 'lvm'

Caveats

This cookbook depends on the chef-ruby-lvm and chef-ruby-lvm-attrib gems. The chef-ruby-lvm-attrib gem in particular is a common cause of failures when using the providers. If you get a failure with an error message similar to

No such file or directory - /opt/chef/.../chef-ruby-lvm-attrib-0.0.3/lib/lvm/attributes/2.02.300(2)/lvs.yaml

then you are running a version of lvm that the gems do not support. However, getting support added is usually pretty easy. Just follow the instructions on "Adding Attributes" in the chef-ruby-lvm-attrib README.

License and Authors

Copyright:: 2011-2016, Chef Software, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].