1. RAID Related:
# Delete existing RAID configurations
Megacli64-cfglddel-lall-aall
# Get Device ID and slot number
Megacli64-pdlist-aall|egrep ' Enclosure Device id| Slot number ' |awk ' Nr%2==0{print $; Nr%2!=0{print $4;} '
# Create RAID5, $sdaslots the disk ID and slot number used to create the raid to be constructed to match the parameter requirements, size 500G
Megacli64-cfgldadd-r5 "$sdaslots" WB RA Direct cachedbadbbu-sz500gb-a0
2. Remote management card operation, using sshpass do not need to enter the password manually, $user and $ip are the Idrac device user name and password, respectively:
# Turn on system power
Sshpass-p $password ssh-o connecttimeout=90-o stricthostkeychecking=no-o Userknownhostsfile=/dev/null-o LogLevel=qui ET [email protected] $ip Racadm serveraction powerup
# Turn on system power from PXE boot, primarily to install the system over the network
Sshpass-p $password ssh-o connecttimeout=90-o stricthostkeychecking=no-o Userknownhostsfile=/dev/null-o LogLevel=qui ET [email protected] $ip racadm config-g cfgserverinfo-o cfgserverbootonce
Sshpass-p $password ssh-o connecttimeout=90-o stricthostkeychecking=no-o Userknownhostsfile=/dev/null-o LogLevel=qui ET [email protected] $ip racadm config-g cfgserverinfo-o cfgserverfirstbootdevice PXE
Sshpass-p $password ssh-o connecttimeout=90-o stricthostkeychecking=no-o Userknownhostsfile=/dev/null-o LogLevel=qui ET [email protected] $ip Racadm serveraction powercycle
# Get System power Status
Sshpass-p $password ssh-o connecttimeout=90-o stricthostkeychecking=no-o Userknownhostsfile=/dev/null-o LogLevel=qui ET [email protected] $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=qui ET [email protected] $ip Racadm serveraction powerdown
Dell Server-related operations