Skip to content

openbmc_support

xuweibj edited this page May 30, 2018 · 3 revisions

Mini-design for OpenBMC support

Background

To support OpenBMC management. Interface is openbmc.

Node definition

mgt=openbmc

OpenBMC table

When send request bmc ip, username, password are needed. Create a new table ‘openbmc’, “#node,bmc,username,password,comments,disable”.

Plugin file

/opt/xcat/lib/perl/xCAT_plugin/openbmc.pm /opt/xcat/lib/perl/xCAT/OPENBMC.pm

The implementation details(take rpower on as example)

Hash variable

%node_info = (
    $node => {
        bmc        => "x.x.x.x",
        username   => "username",
        password   => "password",
        cur_url    => “”,   
        method     => “”,      
        back_urls  => (),   
        cur_status => "LOGIN_REQUEST",
    },
);

%status_info = {
    LOGIN_REQUEST => {
        method => "POST",
        init_url   => "/login",
    },
    LOGIN_RESPONSE => {
        process => \&login_response,
    },
    RPOWER_ON_REQUEST => {
        method => "POST",
        init_url   => "/power/on”,
    },
    RPOWER_ON_RESPONSE => {
        process => \&rpower_response,
    },
};

%next_status = {
    LOGIN_REQUEST => ”LOGIN_RESPONSE",
    LOGIN_RESPONSE => "RPOWER_ON_REQUEST", 
    RPOWER_ON_REQUEST => “RPOWER_ON_RESPONSE”,
};

The main code logic

Parse argument

  • Check errors.
  • Get parameters and fill into %node_info hash, set cur_status as LOGIN_REQUEST
  • Get subcommands fill into %next_status array.

Login

  • OPENBMC (xCAT::OPENBMC->new)

    • Generate request use HTTP::Request
    • Create cookies use HTTP::Cookies
    • Send request use add_with_opts (HTTP::Async)
    • Return handle ID
  • openbmc

    • Start Async
    • Start while loop
    • Get handle ID and cookies use xCAT::OPENBMC->new
    • Change cur_status to LOGIN_RESPONSE
  • The code logic for main loop:

      generate and send login request of each node
      while (1)
          if (the node array that stores nodes which hadn’t been dealt with is empty) and (pending response counter equal 0)   # It means all nodes have been dealt, and no more response is expected, the loop will end 
              break;
     	    endif
    
          while (wait_for_next_response)
              deal_with_response
          end while (wait_for_next_response)
      end while (1)
    

Wait for response

  • Get response in while loop
  • Compare ID to get node name
  • Deal with response. If status is ‘OK’, go to next step, cur_status = RPOWER_ON_REQUEST. Or, return with error message.

Send subcommand request

  • Check cur_status
  • Get cur_url and pop first sub_url, generate url to send. If there is no cur_url, use url in %status_info.
  • Send request use xCAT::OPENBMC->send_request
  • Change cur_status to xxxx_RESPONSE
  • Wait for response

Deal with response

  • Check if there is info want to get
  • If get, go next step. If not, check @sub_url whether empty.
  • If empty, return error. If not, set cur_status as xxx_REQUEST. Send request.

News

History

  • Oct 22, 2010: xCAT 2.5 released.
  • Apr 30, 2010: xCAT 2.4 is released.
  • Oct 31, 2009: xCAT 2.3 released. xCAT's 10 year anniversary!
  • Apr 16, 2009: xCAT 2.2 released.
  • Oct 31, 2008: xCAT 2.1 released.
  • Sep 12, 2008: Support for xCAT 2 can now be purchased!
  • June 9, 2008: xCAT breaths life into (at the time) the fastest supercomputer on the planet
  • May 30, 2008: xCAT 2.0 for Linux officially released!
  • Oct 31, 2007: IBM open sources xCAT 2.0 to allow collaboration among all of the xCAT users.
  • Oct 31, 1999: xCAT 1.0 is born!
    xCAT started out as a project in IBM developed by Egan Ford. It was quickly adopted by customers and IBM manufacturing sites to rapidly deploy clusters.
Clone this wiki locally