欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

玩欧卡就用莱仕达V10方向盘欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 13566|回复: 2
收起左侧

使用 racadm 管理远程卡

[复制链接]
oppo 发表于 2015-3-3 14:00 | 显示全部楼层 |阅读模式

使用 racadm 管理远程卡
Posted on May 15, 2013
对于远程卡的管理,有很多中方式,除了常规的通过 web 的方式,还有通过 OMSA,或者 IPMI 等方式,DELL 官方提供了一个叫 racadm 的工具同样可以比较方便的管理,这个套件包含在 OMSA 里面。
最常见的就是需要修改远程可的 IP 等相关信息。首先是获取远程卡的 IP 信息:
# racadm getniccfg
# racadm getconfig -g cfgLanNetworking

修改 IP:
# racadm setniccfg -s 192.168.1.2 255.255.255.0 192.168.1.1

或者像这样分开设置:
# racadm config -g cfgLanNetworking -o cfgNicEnable 1
# racadm config -g cfgLanNetworking -o cfgNicIpAddress 192.168.1.2
# racadm config -g cfgLanNetworking -o cfgNicNetmask 255.255.255.0
# racadm config -g cfgLanNetworking -o cfgNicGateway 192.168.1.1
# racadm config -g cfgLanNetworking -o cfgNicUseDhcp 0

或者先获取关于 RAC 的所有信息:
# racadm getconfig -f rac.cfg

修改相关段落之后再更新:
# cat rac.cfg

[cfgLanNetworking]
cfgNicEnable=1
cfgNicIPv4Enable=1
cfgNicIpAddress=192.168.1.2
cfgNicNetmask=255.255.255.0
cfgNicGateway=192.168.1.1

# racadm config -f rac.cfg

其他的一些比较有用的命令,分别是 reset idrac 卡、开关机重启、查看 event log、清除 event log、获取服务代码:
# racadm racresetcfg
# racadm serveraction [powerdown|powerup|powercycle]
# racadm getsel
# racadm clear
# racadm getsvctag

如果要修改远程机器的 idrac 的信息,加 -r 参数指定 ip:https_port:
# racadm -r ip:https_port -u root -p calvin config -g cfgLanNetworking -o cfgNicGateway 192.168.1.1


比如由于之前的网络升级(1, 2, 3, 4)出现了一点小故障,此处省略 1000 字,导致的结果是我们的服务器完全无法 ssh。这只能修改 idrac 的 net,而 idrac 的 net 同样存在 gw 设置的问题,这时候只能从同一网段的某台机器进去,批量指定一下 gw:
# for i in {1..100};do racadm -r 192.168.1.${i}:1111 -u root -p calvin config -g cfgLanNetworking -o cfgNicGateway 192.168.1.1;done

再比如需要修改 idrac 的端口(http, https)的:
# racadm -r ip  -u root  -p calvin config -g cfgRacTuning -o cfgRacTuneHttpPort 81
# racadm -r ip:443  -u root  -p calvin config -g cfgRacTuning -o cfgRacTuneHttpsPort 444
# racadm -r ip:444  -u root  -p calvin config -g cfgRacTuning -o cfgRacTuneSshPort 1000

之前记录过可以通过 ipmi 来完成 user/passwd 的修改,通过 racadm 同样可以完成,racadm 应该是封装了 ipmitool 等工具的:
# racadm -r ip -u root -p calvin config -g cfgUserAdmin -o cfgUserAdminUserName jaseywang -i 2
# racadm -r ip -u jaseywang -p calvin  config -g cfgUserAdmin -o cfgUserAdminPassword jaseywang  -i 2

还有个常用的就是通过 racadm 来 pxe 启动安装机器:
# racadm config -g cfgServerInfo -o cfgServerBootOnce 1
# racadm config -g cfgServerInfo -o cfgServerFirstBootDevice PXE
# racadm serveraction powercycle

# racadm config -g cfgServerInfo -o cfgSErverFirstBootDevice "HDD"
# racadm serveraction powerup
# racadm config -g cfgServerInfo -o cfgServerBootOnce 0

最后一个,要获取到机器的快速服务代码:
# racadm getsysinfo | grep "Service Tag"

要找到这些选项很简单,按照上面的那个 config -f rac.cfg,将所有的选项都 dump 出来就好了。-g 的对应的 [] 里面的内容,-o 则对应下面的一个个选项。

ref:
https://cs.uwaterloo.ca/~brecht/ ... Racadm/racadmc1.htm

http://stuff.mit.edu/afs/athena/ ... /en/idrac1/appa.htm

http://jaseywang.me/2013/05/15/% ... %E7%A8%8B%E5%8D%A1/
 楼主| oppo 发表于 2015-3-3 14:01 | 显示全部楼层
以Dell R720xd服务器为例,主要介绍一下idrac7下racadm的使用,补充介绍ipmitool中delloem模块的使用。

一、racadm

racadm是一块直接操作dell自带的idrac的工具,ipmitool可以实现的操作通过它都可以执行,包括idrac、bios、nic、raid。用处最多的地方还是修改bios设置。

可以通过telnet、ssh或者直接client端调用的方式执行。推荐采用第三种方法,方便批量对多台服务器执行。

1、racadm查看service tag编号:

sudo racadm -r $iplist -u root -p ucloud.cn getsvctag

2、racadm查看bios里CPU的设置

sudo racadm -r $iplist -u root -p ucloud.cn get bios.sysprofilesettings

3、racadm查看网卡引导模式设置

sudo racadm -r $iplist -u root -p ucloud.cn get nic.nicconfig.1

例子:通过bios修改bios中网卡引导模式的设置

#!/bin/bash
while read iplist
do
echo $iplist
sudo racadm -r $iplist -u root -p ucloud.cn set nic.nicconfig.1.legacybootproto NONE
sudo racadm -r $iplist -u root -p ucloud.cn set nic.nicconfig.3.legacybootproto PXE
sudo racadm -r $iplist -u root -p ucloud.cn jobqueue create NIC.Integrated.1-1-1
sudo racadm -r $iplist -u root -p ucloud.cn jobqueue create NIC.Integrated.1-3-1
ipmitool -I lanplus -H $iplist -U root -P ucloud.cn chassis power reset
sleep 3s
脚本读取一个写有ipmi管理ip的文件,逐一修改这些服务器的设置。机器重启之后会进入lifecycle controller执行job。

4、racadm下载配置,本地修改,修改完提交上去

sudo racadm -r $iplist -u root -p ucloud.cn get –t xml –f bios.xml
sudo racadm -r $iplist -u root -p ucloud.cn set –t xml –f bios.xml
二、ipmitool中delloem模块的用处

delloem       OEM Commands for Dell systems
获取服务器板载网卡的mac(PCIE的网卡获取不到):

ipmitool -I lan -H $iplist -U root -P ucloud.cn delloem mac list
还有很多其他的用途,可以根据需要了解使用。

http://blog.segmentfault.com/jfe ... ?utm_source=tuicool
 楼主| oppo 发表于 2015-3-3 14:25 | 显示全部楼层
http://en.community.dell.com/tec ... -interface-for-drac

RACADM Command Line Interface for DRAC
SYSTEMS MANAGEMENT - WIKI



Overview

The Dell RACADM (Remote Access Controller Admin) utility is a command line tool that allows for remote or local management of Dell Servers via the iDRAC or DRAC. RACADM provides similar functionality to the iDRAC/DRAC Graphical User Interface (GUI). The Dell Chassis Management Controller (CMC) can also be managed remotely with RACADM.

RACADM commands can be run remotely from a management station and/or locally on the managed system.

RACADM commands allow you to view managed system information, perform power operations on the managed system, perform firmware updates, configure settings and more. Because RACADM is run from a command line interface (CLI), system administrators can create scripts that control and update Dell systems in a one-to-many fashion. See the links to the RACADM documentation at the end of this article for a complete listing of features for your product version.

Terminology

Managed System - The Dell PowerEdge Server containing the iDRAC or DRAC, or the Dell Blade Chassis containing the Chassis Management Controller (CMC).

Management Station - A computer used for accessing the iDRAC, DRAC, or CMC remotely.

iDRAC - Integrated Dell Remote Access Controller. Available on newer and current generations of Dell PowerEdge Servers (11G and 12G).

DRAC - Dell Remote Access Controller. Available on older generations of Dell PowerEdge Servers.

The Different RACADM Utilities

The following RACADM utilities are available:

Remote RACADM - utility is installed on a management station.
Local RACADM - utility is installed on the managed system.
SSH/Telnet/Serial RACADM (also known as Firmware RACADM) - utility is built into the iDRAC, DRAC, and CMC firmware.
NOTES: Local RACADM is not required if you will be managing your server from a management station via Remote RACADM. Remote RACADM and Local RACADM cannot be installed at the same time on the same system.

Locating and Installing RACADM Utilities

Remote RACADM

Remote RACADM supports executing RACADM commands from a remote management station such as a laptop or desktop computer. It is available on the Dell OpenManage Systems Management Tools and Documentation DVD or at support.dell.com.

To download Remote RACADM:

Go to http://support.dell.com
If prompted, select Start Here under Small Businesses or Enterprise IT.
Enter the Service Tag of the managed system and Submit, or use one of the Choose options to locate your managed system model.
Select Drivers and Downloads > select the Operating System of your Management Station from the drop-down menu. Note: The drop-down menu only contains supported server operating systems. If you are running a supported Windows management station OS (Windows 7 for example), choose a Windows Server version from the drop-down menu instead.
Expand Systems Management
For Windows Operating Systems, locate the DRAC Tools application.
For Linux operating systems, locate the Linux Remote Access Utilities application.
Click Download File.

Desc

Remote RACADM Download - Windows Operating System



Remote RACADM Download - Linux Operating System

Remote RACADM Installation - Windows Management Station

If downloaded, extract the downloaded file and run the .msi file provided. Depending on the version downloaded, the file will be named DRAC.msi, RACTools.msi, or RACTools64Bit.msi.

-OR-

If using the DVD, run <path>\SYSMGMT\ManagementStation\windows\DRAC\<.msi file name>

Accept the license agreement > Next > Select the folder to install to > Next > Install > Finish.

Open an administrative command prompt, type racadm and press Enter. If you get the RACADM help instructions it is installed correctly.

Remote RACADM Installation - Linux Management Station

If downloaded, extract the downloaded file and cd to the directory containing the rpm files:

<path>/linux/rac/<linux distribution name>/<i386 or x86_64>

-OR-

If using the DVD,  cd to the directory containing the rpm files:

<path>/SYSMGMT/ManagementStation/linux/rac/<linux_distribution_name>/<i386 or x86_64>

From the i386 or x86_64 directory, run:

rpm -ivh *.rpm

Open a shell prompt with root privileges, type racadm and press Enter. If you get the RACADM help instructions it is installed correctly.  

NOTE: The racadm executable is located under /opt/dell/srvadmin/sbin. You may need to log out and log back in to reset the PATH environment variable to include this location.

Local RACADM

Local RACADM supports executing RACADM commands from the managed system’s operating system. It is available on the Dell OpenManage Systems Management Tools and Documentation DVD or at support.dell.com.

To download Local RACADM:

Go to http://support.dell.com
If prompted, select Start Here under Small Businesses or Enterprise IT.
Enter the Service Tag of the managed system and Submit, or use one of the Choose options to locate your managed system model.
Select Drivers and Downloads > select the Operating System of your Managed System > expand Systems Management.
Locate the OpenManage Server Administrator Managed Node application and click Download File.
  

Local RACADM Download

Local RACADM Installation - Windows Managed System

If downloaded, extract the downloaded file and run <path>\windows\setup.exe

-OR-

If using the DVD, run <path>\SYSMGMT\srvadmin\windows\setup.exe

After the prerequisite checker runs, click Server Administrator.

Click Next > Accept the license agreement > Next > select Custom > Next.

At a minimum, make sure Remote Access Controller will be installed > Next > Install > Finish.

Open an administrative command prompt, type racadm and press Enter. If you get the RACADM help instructions it is installed correctly.

Local RACADM Installation - Linux Managed System

If downloaded, extract the downloaded file and run:

<path>/linux/supportscripts/srvadmin-install.sh

-OR-

If using the DVD, run:

<path>/SYSMGMT/srvadmin/linux/supportscripts/srvadmin-install.sh

Accept the license agreement and, at a minimum, select option 5 - Remote Access Core Component from the menu.

Open a shell prompt with root privileges, type racadm and press Enter. If you get the RACADM help instructions it is installed correctly.

NOTE: The racadm executable is located under /opt/dell/srvadmin/sbin. You may need to log out/log back in to reset the PATH environment variable to include this location.

SSH/Telnet/Serial RACADM (Firmware RACADM)

SSH/Telnet/Serial RACADM (Firmware RACADM) is built into the iDRAC, DRAC or CMC firmware and there is no separate download or installation required. See your user's guide for connecting via these methods.

Once connected via SSH, Telnet or Serial, type racadm help for the online help instructions.

NOTE: On some interfaces if you type racadm and press Enter, you will be taken to a racadm>> prompt. Commands can then be entered from this prompt without the "racadm" prefix. To exit the prompt, type quit or use Ctrl+C.

Syntax Usage

The following shows an example of a simple RACADM subcommand, getsysinfo, used with each RACADM utility. See the end of this article for links to documentation containing the full list of RACADM commands.

Remote RACADM

Remote RACADM commands must include the ip address or hostname of the idrac, and the idrac username and password.

racadm -r <ip address or hostname> -u <username> -p <password> <subcommand>

racadm -r 10.1.1.1 -u root -p calvin getsysinfo

NOTE: Remote racadm uses the web server SSL certificate of the iDRAC to authenticate the session. You will receive a warning message if certificates have not been configured or if the certificate is invalid. However, the command will execute normally following the message. If you wish to halt the command on certificate errors, use the -S option in the command. For information on configuring certificates on the iDRAC, see the user's guide for your iDRAC linked at the end of this article.

Local RACADM

You do not have to specify the ip address, username, or password in Local RACADM commands.

racadm <subcommand>

racadm getsysinfo

SSH/Telnet/Serial (Firmware) RACADM

You do not have to specify the ip address, username, or password in Firmware RACADM commands.

racadm <subcommand>

racadm getsysinfo

or

racadm <Enter> - takes you to a racadm>> prompt

racadm>>getsysinfo

RACADM Documentation

See the RACADM Command Line Reference Guide at the link below for detailed information on supported RACADM commands and features. This guide is available for iDRAC7, iDRAC6, and the CMC. For DRAC5, this information is combined with the DRAC5 User's Guide.

See the Readme or Release Notes file posted alongside the guide for a complete listing of supported operating systems.

To locate a particular document, go to http://www.dell.com/esmmanuals , select Remote Access Controller (or Chassis Management Controller for CMC), then select your product version.



Article revised by Jim Slaughter.

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-4-25 17:42 , Processed in 0.037341 second(s), 7 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表