{"id":4512,"date":"2015-12-22T10:57:49","date_gmt":"2015-12-22T15:57:49","guid":{"rendered":"http:\/\/cdnhost.net\/?p=4512"},"modified":"2022-09-23T04:23:35","modified_gmt":"2022-09-23T09:23:35","slug":"managing-your-dell-or-lsi-logic-raid-card-on-vmware-esxi-5-x","status":"publish","type":"post","link":"https:\/\/cdnhost.net\/content\/managing-your-dell-or-lsi-logic-raid-card-on-vmware-esxi-5-x\/","title":{"rendered":"Managing your Dell or LSI logic RAID card on vmware ESXi 5.x"},"content":{"rendered":"<p>Many of you have likely had the same issue as I ran into, you have a remote server \u00a0in a remote datacenter with only DRAC6 access and no way to access the RAID card without a reboot. Well, those days are gone! I have discovered \u00a0the path to get into the RAID card and do pretty much any function you could do from the BIOS gui and more.<\/p>\n<p>First, \u00a0you need to get the software installed, there&#8217;s this awesome article I found for that.<\/p>\n<p>http:\/\/de.community.dell.com\/techcenter\/support-services\/w\/wiki\/909.how-to-install-megacli-on-esxi-5-x<\/p>\n<p>This includes the commands to view the log which is important&#8230; but doesn&#8217;t help you do much.<\/p>\n<p>View system logs:<\/p>\n<p>Switch with cd \/opt\/lsi\/MegaCLI\/ to the MegaCLI Folder and use this command to get your controllerlog:<\/p>\n<p><code>.\/MegaCli -FwTermLog -Dsply \u2013aALL<\/code><\/p>\n<p>To Merge it in A .txt File use this:<\/p>\n<p><code>.\/MegaCli -FwTermLog -Dsply \u2013aALL &gt; lsi.txt<\/code><\/p>\n<p>The Logfile is now located in \/opt\/lsi\/MegaCLI\/<\/p>\n<p>Here&#8217;s the \u00a0list of other commands I have compiled from \u00a0all over the net:<\/p>\n<p><strong>View information about the RAID adapter<\/strong><\/p>\n<p>For checking the firmware version, battery back-up unit presence, installed cache memory and the capabilities of the adapter:<\/p>\n<p># MegaCli -AdpAllInfo -aAll<\/p>\n<p><strong>View information about the battery backup-up unit state<\/strong><\/p>\n<p># MegaCli -AdpBbuCmd -aAll<\/p>\n<p><strong>View information about virtual disks<\/strong><\/p>\n<p>Useful for checking RAID level, stripe size, cache policy and RAID state:<\/p>\n<p># MegaCli -LDInfo -Lall -aALL<\/p>\n<p><strong>View information about physical drives<\/strong><\/p>\n<p># MegaCli -PDList -aALL<\/p>\n<p><strong>Patrol read<\/strong><\/p>\n<p>Patrol read is a feature which tries to discover disk error before it is too late and data is lost. By default it is done automatically (with a delay of 168 hours between different patrol reads) and will take up to 30% of IO resources.<\/p>\n<p>To see information about the patrol read state and the delay between patrol read runs:<br \/>\n# MegaCli -AdpPR -Info -aALL<\/p>\n<p>To find out the current patrol read rate, execute<br \/>\n# MegaCli -AdpGetProp PatrolReadRate -aALL<\/p>\n<p>To reduce patrol read resource usage to 2% in order to minimize the performance impact:<br \/>\n# MegaCli -AdpSetProp PatrolReadRate 2 -aALL<\/p>\n<p>To disable automatic patrol read:<br \/>\n# MegaCli -AdpPR -Dsbl -aALL<\/p>\n<p>To start a manual patrol read scan:<br \/>\n# MegaCli -AdpPR -Start -aALL<\/p>\n<p>To stop a patrol read scan:<br \/>\n# MegaCli -AdpPR -Stop -aALL<\/p>\n<p>You could use the above commands to run patrol read in off-peak times.<\/p>\n<p><strong>Migrate from one RAID level to another<\/strong><\/p>\n<p>In this example, I migrate the virtual disk 0 from RAID level 6 to RAID 5, so that the disk space of one additional disk becomes available. The second command is used to make Linux detect the new size of the RAID disk.<\/p>\n<p># \/usr\/local\/sbin\/MegaCli -LDRecon -Start -r5 -L0 -a0<br \/>\n# echo 1 &gt; \/sys\/block\/sda\/device\/rescan<\/p>\n<p><strong>Extending an existing RAID array with a new disk<\/strong><\/p>\n<p>.\/MegaCli -LDRecon -Start -r5 -Add -PhysDrv[32:3] -L0 -a0<\/p>\n<p><strong>Create a new RAID 5 virtual disk from a set of new hard drives<\/strong><\/p>\n<p>First we need to now the enclosure and slot number of the hard drives we want to use for the new RAID disk. You can find them out by the first command. Then I add a virtual disk using RAID level 5, followed by the list of drives I want to use, specified by enclosure:slot syntax.<\/p>\n<p># MegaCli -PDList -aALL | egrep &#8216;Adapter|Enclosure|Slot|Inquiry&#8217;<br \/>\n# MegaCli -CfgLdAdd -r5&#8242;[252:5,252:6,252:7]&#8217; -a0<\/p>\n<p><strong>Extending an existing RAID array with a new disk<\/strong><\/p>\n<p>First check the enclosure device ID and the slot number of the newly added disk with the command above. Then we reconstruct the logical drive, adding the new drive. For a RAID 5 array this command is used:<\/p>\n<p># MegaCli -LDRecon -Start -r5 -Add -PhysDrv[32:3] -L0 -a0<\/p>\n<p><strong>View reconstruction progress<\/strong><\/p>\n<p>When reconstructing a RAID array, you can check its progress with this command.<br \/>\n# MegaCli -LDRecon ShowProg L0 -a0<\/p>\n<p>(replace L0 by L1 for the second virtual disk, and so on)<\/p>\n<p><strong>Configure write-cache to be disabled when battery is broken<\/strong><\/p>\n<p># MegaCli -LDSetProp NoCachedBadBBU -LALL -aALL<\/p>\n<p><strong>Change physical disk cache policy<\/strong><\/p>\n<p>If your system is not connected to a UPS, you should disable the physical disk cache in order to prevent data loss.<\/p>\n<p># MegaCli -LDGetProp -DskCache -LAll -aALL<\/p>\n<p>To enable it (only do this if you have a UPS and redundant power supplies):<\/p>\n<p># MegaCli -LDGetProp -DskCache -LAll -aALL<\/p>\n<p>&nbsp;<\/p>\n<h2>General Parameters<\/h2>\n<ul>\n<li>Adapter parameter -aN<\/li>\n<\/ul>\n<p>The parameter -aN (where N is a number starting with zero or the string ALL) specifies the adapter ID. If you have only one controller it\u2019s safe to use ALL instead of a specific ID, but you\u2019re encouraged to use the ID for everything that makes changes to your RAID configuration.<\/p>\n<ul>\n<li>Physical drive parameter\u00a0\u00a0\u00a0\u00a0\u00a0 -PhysDrv [E:S]<\/li>\n<\/ul>\n<p>For commands that operate on one or more pysical drives, the -PhysDrv [E:S] parameter is used, where E is the enclosure device ID in which the drive resides and S the slot number (starting with zero). You can get the enclosure device ID using <strong>MegaCli -EncInfo -aALL<\/strong>. The E:S syntax is also used for specifying the physical drives when creating a new RAID virtual drive (see 5).<\/p>\n<ul>\n<li>Virtual drive parameter -Lx<\/li>\n<\/ul>\n<p>The parameter -Lx is used for specifying the virtual drive (where x is a number starting with zero or the string all).<\/p>\n<p>Running the executable can be accomplished by:<\/p>\n<pre>shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli &lt;cmd&gt;<\/pre>\n<p>or<\/p>\n<pre>shell&gt; cd \/opt\/MegaRAID\/MegaCli<\/pre>\n<pre>shell&gt; .\/MegaCli &lt;cmd&gt;<\/pre>\n<h2>Gather information<\/h2>\n<ul>\n<li>Controller information<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpAllInfo -aALL<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -CfgDsply -aALL<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -adpeventlog -getevents -f lsi-events.log -a0 -nolog<\/pre>\n<ul>\n<li>Enclosure information<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -EncInfo -aALL<\/pre>\n<ul>\n<li>Virtual drive information<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -LDInfo -Lall -aALL<\/pre>\n<ul>\n<li>Physical drive information<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDList -aALL<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDInfo -PhysDrv [E:S] -aALL<\/pre>\n<ul>\n<li>Battery backup information\u00a0\u00a0\u00a0\u00a0\u00a0 (Cisco MSPs do not have the battery backup unit installed, but in case yours has one)<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpBbuCmd -aALL \n\n<\/pre>\n<ul>\n<li>Check Battery backup warning on boot.\u00a0 If this is enabled on an MSP, it will require manual intervention every time the system boots<\/li>\n<\/ul>\n<pre>\n\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpGetProp BatWarnDsbl -a0 \n<\/pre>\n<h2>Controller management<\/h2>\n<ul>\n<li>Silence active alarm<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpSetProp AlarmSilence -aALL<\/pre>\n<ul>\n<li>Disable alarm<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpSetProp AlarmDsbl -aALL<\/pre>\n<ul>\n<li>Enable alarm<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpSetProp AlarmEnbl -aALL<\/pre>\n<ul>\n<li>Disable battery backup warning on system boot<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -AdpSetProp BatWarnDsbl -a0<\/pre>\n<ul>\n<li>Change the adapter rebuild rate to 60%:<\/li>\n<\/ul>\n<p>MegaCli -AdpSetProp {RebuildRate -60} -aALL<\/p>\n<h2>Virtual drive management<\/h2>\n<ul>\n<li>Create RAID 0, 1, 5 drive<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -CfgLdAdd -r(0|1|5) [E:S, E:S, ...] -aN<\/pre>\n<ul>\n<li>Create RAID 10 drive<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -CfgSpanAdd -r10 -Array0[E:S,E:S] -Array1[E:S,E:S] -aN<\/pre>\n<ul>\n<li>Remove drive<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -CfgLdDel -Lx -aN<\/pre>\n<h2>Physical drive management<\/h2>\n<ul>\n<li>Set state to offline<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDOffline -PhysDrv [E:S] -aN<\/pre>\n<ul>\n<li>Set state to online<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDOnline -PhysDrv [E:S] -aN<\/pre>\n<ul>\n<li>Mark as missing<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDMarkMissing -PhysDrv [E:S] -aN<\/pre>\n<ul>\n<li>Prepare for removal<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PdPrpRmv -PhysDrv [E:S] -aN<\/pre>\n<ul>\n<li>Replace missing drive<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN<\/pre>\n<pre><\/pre>\n<p>The number N of the array parameter is the Span Reference you get using <strong>MegaCli -CfgDsply -aALL<\/strong> and the number N of the row parameter is the Physical Disk in that span or array starting with zero (it\u2019s not the physical disk\u2019s slot!).<\/p>\n<ul>\n<li>Rebuild drive &#8211; Drive status should be &#8220;Firmware state: Rebuild&#8221;<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDRbld -Start -PhysDrv [E:S] -aN<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDRbld -Stop -PhysDrv [E:S] -aN<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDRbld -ShowProg -PhysDrv [E:S] -aN\u00a0\u00a0\u00a0\u00a0 \n\u00a0\u00a0\u00a0\u00a0 MegaCli -PDRbld -ProgDsply -physdrv [E:S] -aN<\/pre>\n<ul>\n<li>Clear drive<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDClear -Start -PhysDrv [E:S] -aN<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDClear -Stop -PhysDrv [E:S] -aN<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDClear -ShowProg -PhysDrv [E:S] -aN<\/pre>\n<ul>\n<li>Bad to good<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDMakeGood -PhysDrv[E:S] -aN<\/pre>\n<p>Changes drive in state Unconfigured-Bad to Unconfigured-Good.<\/p>\n<h2>Hot spare management<\/h2>\n<ul>\n<li>Set global hot spare<\/li>\n<\/ul>\n<pre>\u00a0 \u00a0\u00a0 MegaCli -PDHSP -Set -PhysDrv [E:S] -aN<\/pre>\n<pre><\/pre>\n<ul>\n<li>Remove hot spare<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDHSP -Rmv -PhysDrv [E:S] -aN<\/pre>\n<pre><\/pre>\n<ul>\n<li>Set dedicated hot spare<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDHSP -Set -Dedicated -ArrayN,M,... -PhysDrv [E:S] -aN<\/pre>\n<h2>Walkthrough: Rebuild a Drive that is marked &#8216;Foreign&#8217; when Inserted:<\/h2>\n<pre><\/pre>\n<ul>\n<li>Bad to good<\/li>\n<\/ul>\n<pre>\n\u00a0\u00a0\u00a0 MegaCli -PDMakeGood -PhysDrv [E:S]\u00a0 -aALL<\/pre>\n<ul>\n<li>Clear the foreign setting<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -CfgForeign -Clear -aALL<\/pre>\n<pre><\/pre>\n<ul>\n<li>Set global hot spare<\/li>\n<\/ul>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDHSP -Set -PhysDrv [E:S] -aN<\/pre>\n<h2>Walkthrough: Change\/replace a drive<\/h2>\n<p>1. Set the drive offline, if it is not already offline due to an error<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDOffline -PhysDrv [E:S] -aN<\/pre>\n<p>2. Mark the drive as missing<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDMarkMissing -PhysDrv [E:S] -aN<\/pre>\n<pre><\/pre>\n<p>3. Prepare drive for removal<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDPrpRmv -PhysDrv [E:S] -aN<\/pre>\n<pre><\/pre>\n<p>4. Change\/replace the drive<\/p>\n<p>5. If you\u2019re using hot spares then the replaced drive should become your new hot spare drive<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDHSP -Set -PhysDrv [E:S] -aN<\/pre>\n<pre><\/pre>\n<p>6. In case you\u2019re not working with hot spares, you must re-add the new drive to your RAID virtual drive and start the rebuilding<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0 MegaCli -PDRbld -Start -PhysDrv [E:S] -aN<\/pre>\n<h2>Gathering Standard logs<\/h2>\n<p>On every instance of a hard drive problem with an MSP server, we need to run the following commands to have any information about the problem:<\/p>\n<pre>\u00a0\u00a0 shell&gt; rm \u2013f MegaSAS.log<\/pre>\n<pre>\u00a0\u00a0 shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli -adpallinfo -a0<\/pre>\n<pre>\u00a0\u00a0 shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli -encinfo -a0<\/pre>\n<pre>\u00a0\u00a0 shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli -ldinfo -lall -a0<\/pre>\n<pre>\u00a0\u00a0 shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli -pdlist -a0<\/pre>\n<pre>\u00a0\u00a0 shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli -adpeventlog -getevents -f lsi-events.log -a0 -nolog<\/pre>\n<pre>\u00a0\u00a0 shell&gt; \/opt\/MegaRAID\/MegaCli\/MegaCli -fwtermlog -dsply -a0 -nolog &gt; lsi-fwterm.log<\/pre>\n<p>Collect the MegaSAS.log, lsi-events.log, and the lsi-fwterm.log files from the directory where the commands are run (they can be run from any directory on the MSP server) and attach the logs to the service request. You may use a program such as WinSCP (freeware) to pull the files off of the server.<\/p>\n<p>&nbsp;<\/p>\n<p>I hope this info is useful to you all in one place, it took me a day to figure it all \u00a0out.<\/p>\n<p>&nbsp;<\/p>\n<p>Mike<\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-4512\" data-postid=\"4512\" class=\"themify_builder_content themify_builder_content-4512 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>Many of you have likely had the same issue as I ran into, you have a remote server \u00a0in a remote datacenter with only DRAC6 access and no way to access the RAID card without a reboot. Well, those days are gone! I have discovered \u00a0the path to get into the RAID card and do [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4512","post","type-post","status-publish","format-standard","hentry","category-blog","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"builder_content":"","_links":{"self":[{"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/posts\/4512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/comments?post=4512"}],"version-history":[{"count":0,"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/posts\/4512\/revisions"}],"wp:attachment":[{"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/media?parent=4512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/categories?post=4512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cdnhost.net\/content\/wp-json\/wp\/v2\/tags?post=4512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}