Salt module to manage RAID arrays with mdadm
salt.modules.mdadm.
assemble
(name, devices, test_mode=False, **kwargs)¶Assemble a RAID device.
CLI范例:
salt '*' raid.assemble /dev/md0 ['/dev/xvdd', '/dev/xvde']
注解
Adding test_mode=True
as an argument will print out the mdadm
command that would have been run.
For more info, read the mdadm
manpage.
salt.modules.mdadm.
create
(name, level, devices, metadata='default', test_mode=False, **kwargs)¶Create a RAID device.
在 2014.7.0 版更改.
警告
Use with CAUTION, as this function can be very destructive if not used properly!
CLI范例:
salt '*' raid.create /dev/md0 level=1 chunk=256 devices="['/dev/xvdd', '/dev/xvde']" test_mode=True
注解
Adding test_mode=True
as an argument will print out the mdadm
command that would have been run.
注解
It takes time to create a RAID array. You can check the progress in "resync_status:" field of the results from the following command:
salt '*' raid.detail /dev/md0
For more info, read the mdadm(8)
manpage
salt.modules.mdadm.
destroy
(device)¶Destroy a RAID device.
WARNING This will zero the superblock of all members of the RAID array..
CLI 范例:
salt '*' raid.destroy /dev/md0
salt.modules.mdadm.
detail
(device='/dev/md0')¶Show detail for a specified RAID device
CLI 范例:
salt '*' raid.detail '/dev/md0'
salt.modules.mdadm.
list
()¶List the RAID devices.
CLI 范例:
salt '*' raid.list
salt.modules.mdadm.
save_config
()¶Save RAID configuration to config file.
Same as: mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Fixes this issue with Ubuntu REF: http://askubuntu.com/questions/209702/why-is-my-raid-dev-md1-showing-up-as-dev-md126-is-mdadm-conf-being-ignored
CLI 范例:
salt '*' raid.save_config
salt.modules.mdadm.
stop
()¶Shut down all arrays that can be shut down (i.e. are not currently in use).
CLI 范例:
salt '*' raid.stop