Dell server related operations
1. Raid problems:
# Deleting existing Raid configurations
MegaCli64-CfgLdDel-LALL-aALL
# Obtain the device ID and Slot Number
MegaCli64-PDList-aALL | egrep 'enclosure Device ID | Slot Number '| awk 'nr % 2 = 0 {print $3}; NR % 2! = 0 {print $4 ;}'
# Create Raid5, $ sdaslots is the disk ID and slot number used to create Raid that meet the parameter requirements. The size is 500 GB.
MegaCli64-CfgLdAdd-r5 "$ sdaslots" wb ra Direct CachedBadBBU-sz500GB-a0
2. Remote Management card operation. You do not need to manually enter the password when using sshpass. $ user and $ ip are the iDRAC device user name and password respectively:
# Power on the System
Sshpass-p $ password ssh-o ConnectTimeout = 90-o StrictHostKeyChecking = no-o UserKnownHostsFile =/dev/null-o LogLevel = quiet $ user @ $ ip racadm serveraction powerup
# Turn on the system power to start from PXE, mainly to install the system through the network
Sshpass-p $ password ssh-o ConnectTimeout = 90-o StrictHostKeyChecking = no-o UserKnownHostsFile =/dev/null-o LogLevel = quiet $ user @ $ ip racadm config-g login serverinfo- o cfgServerBootOnce
Sshpass-p $ password ssh-o ConnectTimeout = 90-o StrictHostKeyChecking = no-o UserKnownHostsFile =/dev/null-o LogLevel = quiet $ user @ $ ip racadm config-g login serverinfo- o cfgServerFirstBootDevice PXE
Sshpass-p $ password ssh-o ConnectTimeout = 90-o StrictHostKeyChecking = no-o UserKnownHostsFile =/dev/null-o LogLevel = quiet $ user @ $ ip racadm serveraction powercycle
# Obtain system power status
Sshpass-p $ password ssh-o ConnectTimeout = 90-o StrictHostKeyChecking = no-o UserKnownHostsFile =/dev/null-o LogLevel = quiet $ user @ $ ip racadm serveraction powerstatus 2>/ dev/null | awk '{print $4 }'
# Power off the system
Sshpass-p $ password ssh-o ConnectTimeout = 90-o StrictHostKeyChecking = no-o UserKnownHostsFile =/dev/null-o LogLevel = quiet $ user @ $ ip racadm serveraction powerdown