Resource Type: mdadm

Defined in:
lib/puppet/type/mdadm.rb
Providers:
mdadm

Overview

A resource type for managing md raid arrays.

Example:

mdadm { '/dev/md0' :
  ensure => 'create',
  devices => ['/dev/sdb', '/dev/sdc'],
  level => 0,
}

mdadm { '/dev/md1' :
  ensure => 'assemble',
  devices => ['/dev/sdd', '/dev/sde'],
  level => 0,
}

mdadm { '/dev/md2' :
  ensure => 'stop',
  devices => ['/dev/sdf', '/dev/sdg'],
  level => 0,
}

Properties

  • ensure (defaults to: created)

    The basic property that the resource should be in.

    Supported values:
    • created
    • assembled
    • absent
    • stopped (alias for: absent)

Parameters

  • active_devices

    An optional value used to specify the number of devices that are active. Cannot be more than the number of devices. Defaults to all devices.

  • bitmap

    Create a bitmap for the array with the given filename

  • chunk

    Optionally specify the chunksize in kibibytes.

  • devices

    An array of underlying devices for the raid

  • force (defaults to: false)

    Whether to force the action. Useful for when the underlying devices had previously been created on an array. Can be destructive if the underlying devices were part of different arrays. Use with caution.

    Supported values:
    • true
    • false
  • generate_conf (defaults to: true)

    Whether to generate the mdadm.conf file

    Supported values:
    • true
    • false
  • level

    The raid level, 0,1,4,5,6 linear, multipath and synonyms.

  • metadata (defaults to: 0.9)

    Default style of RAID metadata (superblock) to be used. The default is 0.9. There seems to be an issue with the 1.2 on newer mdadm/kernels with the –name parameter getting set.

    See ubuntuforums.org/showthread.php?t=1764861 for more info

    Supported values:
    • 0.9
    • 1.0
    • 1.1
    • 1.2
  • name (namevar)

    The raid device used as the identity of the resource.

  • parity

    The raid parity. Only applicable to raid5/6

    Supported values:
    • left-symmetric
    • right-symmetric
    • left-asymmetric
    • right-asymmetric
  • provider

    The specific backend to use for this ‘mdadm` resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.

  • spare_devices

    An optional value used to specify the number of spare devices.

  • update_initramfs (defaults to: true)

    Whether to update the ram filesystem with the md device. Only makes sense if you are also generating the mdadm.conf.

    This can work around a problem with updated kernels not seeing the md device and assigning a random device number.

    See ubuntuforums.org/showthread.php?t=1764861 for more info

    Supported values:
    • true
    • false