salt.modules.mdadm

Salt module to manage RAID arrays with mdadm

salt.modules.mdadm.create(*args)

Create a RAID device.

WARNING!! Use with CAUTION, as this function can be very destructive if not used properly!

Use it just as a regular mdadm command.

For more info, read 'man mdadm'

NOTE: It takes time to create a RAID array. You can check the progress in "resync_status:" field of command:

salt '*' raid.detail /dev/md0

CLI Examples:

Test mode: if you add a test_mode=True as an argument - it will print out the command to double check.

    salt '*' raid.create /dev/md0 level=1 chunk=256 raid-devices=2 /dev/xvdd /dev/xvde test_mode=True

NON-Testing mode:

    salt '*' raid.create /dev/md0 level=1 chunk=256 raid-devices=2 /dev/xvdd /dev/xvde
Parameters:
  • args -- The arguments u pass to this function.
  • arguments -- arguments['new_array']: The name of the new RAID array that will be created. arguments['opt_val']: Option with Value. Example: raid-devices=2 arguments['opt_raw']: Option without Value. Example: force arguments['disks_to_array']: The disks that will be added to the new raid.
Returns:

test_mode=True:

Prints out the full command.

test_mode=False (Default):

Executes command on remote the host(s) and Prints out the mdadm output.

salt.modules.mdadm.destroy(device)

Destroy a RAID device.

WARNING This will zero the superblock of all members of the RAID array..

CLI Example:

salt '*' raid.destroy /dev/md0
salt.modules.mdadm.detail(device='/dev/md0')

Show detail for a specified RAID device

CLI Example:

salt '*' raid.detail '/dev/md0'
salt.modules.mdadm.list()

List the RAID devices.

CLI Example:

salt '*' raid.list

Previous topic

salt.modules.match

Next topic

salt.modules.mine