It turns out that the right way to do this is use what Dell call
"CMC"- a device that manages all the blades, not just one (just like
the DRAC/MC). This is like a mix of the Dell DRAC/MC and DRAC 5 in
fence_drac.

I've written a patch that adds support for the CMC to fence_drac. This
is my first patch ever using git, so hopefully it's good for you.

This has been tested on a CMC, but it also changes the code for a Dell
1950. I'm going to get a 1950 and test it tomorrow.

Feedback welcomed!

David

---
 fence/agents/drac/fence_drac.pl |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index f199814..f96ef22 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -38,6 +38,7 @@ my $DRAC_VERSION_MC                   = 'DRAC/MC';
 my $DRAC_VERSION_4I                    = 'DRAC 4/I';
 my $DRAC_VERSION_4P                    = 'DRAC 4/P';
 my $DRAC_VERSION_5                     = 'DRAC 5';
+my $DRAC_VERSION_CMC                           = 'CMC';

 my $PWR_CMD_SUCCESS                    = "/^OK/";
 my $PWR_CMD_SUCCESS_DRAC5      = "/^Server power operation successful$/";
@@ -192,10 +193,15 @@ sub login
        # DRAC5 prints version controller version info
        # only after you've logged in.
        if ($drac_version eq $DRAC_VERSION_UNKNOWN) {
-               if ($t->waitfor(Match => "/.*\($DRAC_VERSION_5\)/m")) {
+       
+               if (my ($prematch,$match)=$t->waitfor(Match =>
"/.*(\($DRAC_VERSION_5\)|$DRAC_VERSION_CMC)/m")) {
+                   if ($match=~/$DRAC_VERSION_CMC/) {
+                       $drac_version =  $DRAC_VERSION_CMC;
+                   } else {
                        $drac_version = $DRAC_VERSION_5;
+                   }
                        $cmd_prompt = "/\\\$ /";
-                       $PWR_CMD_SUCCESS = $PWR_CMD_SUCCESS_DRAC5;
+                   $PWR_CMD_SUCCESS = $PWR_CMD_SUCCESS_DRAC5;
                } else {
                        print "WARNING: unable to detect DRAC version '$_'\n";
                }
@@ -228,8 +234,10 @@ sub set_power_status
        }
        elsif ($drac_version eq $DRAC_VERSION_5) {
                $cmd = "racadm serveraction $svr_action";
-       } else
-       {
+       }
+       elsif ($drac_version eq $DRAC_VERSION_CMC) {
+               $cmd = "racadm serveraction -m $modulename $svr_action";
+       } else {
                $cmd = "serveraction -d 0 $svr_action";
        }

@@ -271,6 +279,11 @@ sub set_power_status
                }
        }
        fail "failed: unexpected response: '$err'" if defined $err;
+
+       # on M600 blade systems, after power on or power off, status takes a
couple of seconds to report correctly. Wait here before checking
status again
+       sleep 5;
+
+
 }


@@ -285,6 +298,8 @@ sub get_power_status

        if ($drac_version eq $DRAC_VERSION_5) {
                $cmd = "racadm serveraction powerstatus";
+       } elsif ($drac_version eq $DRAC_VERSION_CMC) {
+           $cmd = "racadm serveraction powerstatus -m $modulename";
        } else {
                $cmd = "getmodinfo";
        }
@@ -306,7 +321,7 @@ sub get_power_status

        fail "failed: unkown dialog exception: '$_'" unless (/^$cmd$/);

-       if ($drac_version ne $DRAC_VERSION_5) {
+       if ($drac_version ne $DRAC_VERSION_5 && $drac_version ne 
$DRAC_VERSION_CMC) {
                #Expect:
                #  #<group>     <module>    <presence>  <pwrState>  <health>  
<svcTag>
                #   1  ---->     chassis    Present         ON      Normal    
CQXYV61
@@ -335,6 +350,11 @@ sub get_power_status
                        if(m/^Server power status: (\w+)/) {
                                $status = lc($1);
                        }
+               }
+               elsif ($drac_version eq $DRAC_VERSION_CMC) {
+                       if(m/^(\w+)/) {
+                           $status = lc($1);
+                       }
                } else {
                        my ($group,$arrow,$module,$presence,$pwrstate,$health,
                                $svctag,$junk) = split /\s+/;
@@ -364,7 +384,8 @@ sub get_power_status
        }

        $_=$status;
-       if(/^(on|off)$/i)
+       
+       if (/^(on|off)$/i)
        {
                # valid power states
        }
@@ -440,6 +461,7 @@ sub do_action
                }
                        
                set_power_status on;
+               
                fail "failed: $_" unless wait_power_status on;

                msg "success: powered on";
@@ -641,7 +663,7 @@ if ($drac_version eq $DRAC_VERSION_III_XT)
        fail "failed: option 'modulename' not compatilble with DRAC version
'$drac_version'"
                if defined $modulename;
 }
-elsif ($drac_version eq $DRAC_VERSION_MC)
+elsif ($drac_version eq $DRAC_VERSION_MC || $drac_version eq $DRAC_VERSION_CMC)
 {
        fail "failed: option 'modulename' required for DRAC version 
'$drac_version'"
                unless  defined $modulename;
-- 
1.5.5.1


>From 2899ae4468a69b89346cafba13022a9b214404f2 Mon Sep 17 00:00:00 2001
From: David J Craigon <[EMAIL PROTECTED]>
Date: Wed, 30 Jul 2008 16:34:24 +0100
Subject: Add a comment to state the CMC version this script works on

---
 fence/agents/drac/fence_drac.pl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index f96ef22..11cc771 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -13,6 +13,7 @@
 #  PowerEdge 1850      DRAC 4/I        1.35 (Build 09.27)
 #  PowerEdge 1850      DRAC 4/I        1.40 (Build 08.24)
 #  PowerEdge 1950      DRAC 5          1.0  (Build 06.05.12)
+#  PowerEdge M600      CMC             1.01.A05.200803072107
 #

 use Getopt::Std;
-- 
1.5.5.1



2008/7/30 Marek 'marx' Grac <[EMAIL PROTECTED]>:
> David J Craigon wrote:
>>
>> Hello,
>>
>> I've been given the job of getting a box of Dell blades (an M600)
>> fencing correctly using the onboard DRACs (which Dell call an iDRAC).
>> As far as I can tell, no one has done this- none of the existing
>> fence_ scripts appear to do the trick. The command line interface is
>> very different from a traditional Dell DRAC.
>>
>> Has anyone already done this? I'm going to write a fence script to do
>> this, but I thought I'd check before I wasted my time.
>>
>>
>
> If it  is possible please use an exisiting infrastructure for fencing agents
> (branch MASTER). You can just modify get/set status in one of the existing
> (close enough) agents. If you can give me an access to this device for few
> hours, I have no problem to write it. If you will have any questing about
> writing fencing agents don't bother and ask for help.
>
> marx,
> Fence Master :)
>
> --
> Marek Grac
> Red Hat Czech s.r.o.
>
> --
> Linux-cluster mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/linux-cluster
>

--
Linux-cluster mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-cluster

Reply via email to