Cluster Tools - IPMItool
See:
IpmiTool for general information
ipmitool usage and scripts for controlling IPMI enabled devices
ipmitool scripts
- Notes:
- scripts not ending in _nodes require an IPMI/lom address as the first argument
- localhost causing the script to talk directly to the lom via the kernel on the host you are logged into
- The scripts below use ipmitool to manage common tasks for ipmi devices
- setup or change user accounts and passwords
- list users
- add users, modify users
- reset
- power on/off
- pxe boot
- bios setup
- normal boot
- Scripts with the suffix _nodes are for operations on all nodes in a cluster
ipmitool - usage examples and options
- This tool is used by ALL scripts in this document
- *apt-get install
- You may add a remote host to the ipmitool command by adding
- -I lanplus -H lom_address
- You may provide the user and password
- Local Examples:
- *Update IPMI/BMC default port
-
- To get LAN mode: ipmitool raw 0x30 0x70 0x0c 0
- To set LAN mode dedicated: ipmitool raw 0x30 0x70 0x0c 1 0
- To set LAN mode onboard/shared: ipmitool raw 0x30 0x70 0x0c 1 1
- To set LAN mode failover: ipmitool raw 0x30 0x70 0x0c 1 2
These raw values will also work with ipmicfg (just remember to use -raw instead of raw).
IPMI scripts - Documentation notes
- Note: Documentation for all of the *ipmi commands below were automatically generated using the sh2twiki command*
- ssh cscf-adm@asimov
- cd /cscf-adm/src
- sudo bash
- * make docs - invokes sh2wtiki to create both HTML adn TWIKI documents
- All of the generated TWIKI files will be found under /cscf-adm/src/twiki
Support files
- see cscf@asimov.uwaterloo.ca:/cscf-adm/ipmi
- * ipmifunctions: ipmifunctions - ipmi shell functions
- ipmi bash functions used by all ipmi scripts documented here
- * common_functions: common functions - shell functions common to all scripts
- includes common_vars and common_host
- * common_vars: common variables - global variables to control all scripts
- Global / Institutional default settings defined as shell variables
- * common_host: common variables - m160 host specific variables to control all scripts
- Host specific variables dettings - defined as shell variables - can override any common_vars settings
- * NODES: NODES file contains definitions for all nodes and ILOMs in a cluster
ipmi_account_setup
- Updated: Fri Oct 28 15:20:53 2016
Add all admin users to ILOM/BMC using ipmiusermod_nodes
- ipmi_account_setup - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./impi_account_setup
- We can set accounts here, or in common_host prior to calling ipmiusermod_nodes
- ADMIN - Name of default ADMIN user
- ADMINPASS - Password of Admin user
- CSCFADM - CSCF Admin user - default is: cscf-adm
- CSCFADMPASS - CSCF Amdin password
- OTHERUSER - Cluster Admin - if not set or empty the other user is NOT created
- OTHERPASS - Cluster Admiin password
ipmibios
- Updated: Thu Oct 27 16:44:42 2016
boot into BIOS after next reboot
- ipmibios - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmibios host-ilom
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- The node will boot into BIOS on next restart
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmibios_nodes
- Updated: Fri Oct 28 09:46:56 2016
Boot into BIOS after next restart
- ipmibios_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmibios_nodes
- - needs and AMDIN user and password to function
- Result:
- All nodes are set to boot to bios after next restart
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmibootnormal
- Updated: Tue Nov 1 11:38:20 2016
boot normally after next reboot
- ipmibootnormal - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmibootbormal host-ilom
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- The node will boot normally after next restart
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmibootnormal_nodes
- Updated: Tue Nov 1 11:39:04 2016
Boot normally after next reboot
- ipmibootnormal_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmibootnormal_nodes
- - needs and AMDIN user and password to function
- Result:
- All nodes are set to boot normally after after next restart
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmipoweroff
- Updated: Thu Oct 27 16:46:18 2016
Power off node
- ipmipoweroff - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmipoweroff ilom-host
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- The node will poweroff NOW
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmipoweroff_nodes
- Updated: Fri Oct 28 09:44:59 2016
Power off all nodes
- ipmipoweroff_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmipoweroff_nodes
- - needs and AMDIN user and password to function
- Result:
- ALl nodes are powered off
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmipoweron
- Updated: Thu Oct 27 16:46:08 2016
Power on node
- ipmipoweron - document source
- Author: Mike Gore
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmipoweron host-ilom
- - host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- The node will power on NOW
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmipoweron_nodes
- Updated: Fri Oct 28 09:45:40 2016
Power on all nodes
- ipmipoweron_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmipoweron_nodes
- - needs and AMDIN user and password to function
- Result:
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmipxeboot
- Updated: Tue Nov 1 11:51:07 2016
PXE boot setting takes effect after next reboot
- ipmipxeboot - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmipxeboot host-ilom
- - The node will PXE boot the next time it is restarted
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- node will PXE boot on next reboot only
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmipxeboot_nodes
- Updated: Tue Nov 1 11:51:14 2016
Boot into PXE after next restart
- ipmipxeboot_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmipxeboot_nodes
- - needs and AMDIN user and password to function
- Result:
- All nodes are set to boot to pxe after next restart
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmireset
- Updated: Thu Oct 27 16:45:38 2016
Reset node - right now no waiting
- ipmireset - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmireset host-ilom
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmireset_nodes
- Updated: Fri Oct 28 09:48:48 2016
Reset all nodes NOW
- ipmireset_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmireset_nodes
- - needs and AMDIN user and password to function
- Result:
- All nodes are reset right now
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmiuserdel
- Updated: Tue Nov 1 11:47:41 2016
Delete an ILOM/BMC user and permissions on a node
- ipmiuserdel - document source
- Author: Mike Gore
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiuserdel host-ilom usernumber
- - Where host-ilom is the node ILOM/BMC interface
- - Where usernumber is number entry for a given user
- - needs and AMDIN user and password to function
- Result:
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmiuserlist
- Updated: Fri Oct 28 09:34:50 2016
List ILOM/BMC users and permissions on a node
- ipmiuserlist - document source
- Author: Mike Gore
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiuserlist host-ilom
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- List ILOM/BMC users permissions on a node
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmiuserlist_nodes
- Updated: Fri Oct 28 09:40:51 2016
List users and permissions on ALL nodes
- ipmiuserlist_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiuserlist_nodes
- - needs and AMDIN user and password to function
- Result:
- List ILOM/BMC users permissions on ALL nodes
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmiusermod
- Updated: Thu Oct 27 16:40:41 2016
Update or add users on the ILOM/BMC
- ipmiusermod - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiusermod host-ilom
- - Where host-ilom is the node ILOM/BMC interface
- Result:
- Add / Update users on ILOM/BMC interface
- - Used for creating or updating users on ILOM/BMC
- - Can update AMDIN password
- - Creates or updates cscf-adm user name and password
- - Optionally Creates or updates cluster admin user and password
- Notes:
- The script will prompt for input user and passwords required
- Returns:
- ADMIN - Name of default ADMIN user
- ADMINPASS - Password of Admin user
- OLDADMINPASS - Original password of Admin user
- CSCFADM - CSCF Admin user - default is: cscf-adm
- CSCFADMPASS - CSCF Amdin password
- OTHERUSER - Cluster Admin - if not set or empty the other user is NOT created
- OTHERPASS - Cluster Admin password
ipmiusermod_manual
- Updated: Tue Nov 1 11:52:16 2016
Change an ILOM/BMC user user entry with manual user number,name and password values
- ipmiusermod_manual - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiusermod_manual host-ilom USERNUM USERNAME PASSWORD
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- List ILOM/BMC users permissions on a node
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
- 1:
- allback level, 2:User level, 3: Operator level, 4:Administrator level
- priv []
ipmiusermod_manual_nodes
- Updated: Tue Nov 1 11:52:29 2016
Change an ILOM/BMC user user entry with manual user number,name and password values
- ipmiusermod_manual_nodes - document source
- Author: Mike Gore
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiusermod_manual USERNUM USERNAME PASSWORD
- - Where host-ilom is the node ILOM/BMC interface
- - needs and AMDIN user and password to function
- Result:
- List ILOM/BMC users permissions on a node
- Notes:
- The script will prompt for ADMIN user and password unless the following environment variables are set:
- ADMIN - userid of ADMIN user
- ADMINPASS - Password of "ADMIN" user
ipmiusermod_nodes
- Updated: Fri Oct 28 15:20:34 2016
Add admin users to ILOM/BMC on ALL NODES in a cluster
- ipmiusermod_nodes - document source
- Author: Mike Gore
- Date:
- Depends:
- package:
- scripts:
- ipmifunctions, common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Example:
- ./ipmiusermod_nodes
- - needs and AMDIN user and password to function
- Result:
- Add or update users on ALL ILOM/BMC nodes
- - Used for creating initial users on ILOM/BMC
- - Updates AMDIN password for user ADMIN
- - Creates: cscf-adm user and password
- - Optionally Creates: cluster admin user and password
- - Add ILMOM/BMC users to all nodes in a cluster
- - needs and AMDIN user and password to function
- Notes:
- The script will prompt for input -
- unless the following environment variables are set prior to running the script
- ADMIN - Name of default ADMIN user
- ADMINPASS - Password of Admin user
- CSCFADM - CSCF Admin user - default is: cscf-adm
- CSCFADMPASS - CSCF Amdin password
- OTHERUSER - Cluster Admin - if not set or empty the other user is NOT created
- OTHERPASS - Cluster Admiin password
ipmifunctions
- Updated: Tue Nov 1 10:52:10 2016
IPMI functions - LPMI/LOM access and account maintanence functions used by all ipmi scripts
- ipmifunctions - document source
- Author: Mike Gore
- Date:
- Depends:
- package: openipmi, Scripts: common_host,common_vars,common_functions and NODES found in /usr/local/bin
- Scripts:
- see cscf-adm@asimov.uwaterloo.ca:/cscf-adm/ipmi
- common_functions
- common bash functions/tools
- includes common_vars and common_host
- common_vars
- Global / Institutional default settings defined as shell variables
- common_host
- Host specific variables dettings - defined as shell variables - can override any common_vars settings
- ipmifunctions
- ipmi bash functions used by all ipmi scripts documented here
- Example:
- update admin password and cscf-adm password - see ipmiusermod for a full example
- . ipmifunctions
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_default_accounts
- set_admin_password change
- set_user_passwords
- if [ -n "$OLDADMINPASS" ]
- then
- usermod "$ADMIN" "$OLDADMINPASS" "$ADMIN" "$ADMINPASS"
- else
- usermod "$ADMIN" "$ADMINPASS" "$ADMIN" "$ADMINPASS"
- fi
- updatepriv
- if [ -n "$CSCFADM" ]
- then
- usermod "$ADMIN" "$ADMINPASS" "$CSCFADM" "$CSCFADMPASS"
- fi
set_default_accounts()
- Function:
- Set default account names for CSCFAND and OTHER
- Arguments:
- Notes:
- common_host / common_vars should define these accounts
- This function is ONLY for STANDALONE use outside of a cluster context
- Vars:
- CSCFADM - Name of default CSCF ADMIN user
- OTHERUSER - Name of optional other userid or blank - typically a cluster user for cluster admins
- Depends:
- common_functions - optional common_vars and common_host
- Example:
- . ipmifunctions
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_default_accounts
lom_check()
- Function:
- check if LOM is up and set the ipmitool options for remote access
- Arguments:
- LOM IP address or name
- fatal error if LOM is not specified
- Returns:
- LOMHOST - used by ipmitool
- LOM - LOM hostname or IP address
- Depends:
- common_functions - optional common_vars and common_host
- Example:
- . ipmifunctions
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
updatepriv()
- Function:
- Update channel 1 access levels
- Arguments:
- none
- LOMHOST - set by lom_check
- ADMIN - admin user id - set by set_admin_password
- ADMINPASS - admin password - set by set_admin_password
- fatal error if passwords or ILOM is offline
- Depends:
- common_functions - optional common_vars and common_host
- set_admin_password, lom_check
- Example:
- Example:
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_admin_password
- updatepriv
listusers()
- Function:
- list ILOM users and access levels
- Arguments:
- Notes:
- used by usermod function to modify ILOM account
- Does NOT prompt for any variables that are already set
- LOMHOST - set by lom_check function
- ADMIN - admin user id - - set by set_admin_password
- ADMINPASS - admin password -- set by set_admin_password
- Depends:
- common_functions - optional common_vars and common_host
- set_admin_password, lom_check
- Example:
- Example:
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_admin_password
- listusers
usermod()
- Function:
- modify and existing, or create a new user and password
- Arguments:
- arg#1 - admin name
- arg#2 - admin password
- arg#3 - username
- arg#4 - user password
- Depends:
- set_admin_password, set_user_passwords
- Returns:
- USERNUM = numeric userid of user
- USERNEXT = numeric userid of next free unused user slot number
- USERNAME = username
- USERPASS = userpass
- Notes:
- admin name, admin password, username and user password must exist or fatal exit is raised
- Depends:
- common_functions - optional common_vars and common_host
- set_admin_password, lom_check
- Example:
- . ipmifunctions
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_default_accounts
- set_admin_password change
- set_user_passwords
- if [ -n "$OLDADMINPASS" ]
- then
- usermod "$ADMIN" "$OLDADMINPASS" "$ADMIN" "$ADMINPASS"
- else
- usermod "$ADMIN" "$ADMINPASS" "$ADMIN" "$ADMINPASS"
- fi
- updatepriv
set_admin_password()
- Function:
- *prompt for ADMIN account password *
- Arguments:
- [change] - optionally prompt for new and old password
- Notes:
- used by usermod function to modify ILOM accounts
- Does NOT prompt for any variables that are already set
- Vars:
- ADMIN - Name of default ADMIN user
- ADMINPASS - Password of Admin user
- OLDADMINPASS - Original password of Admin user if change option specified
- Returns
- ADMIN - Name of default ADMIN user
- ADMINPASS - Password of Admin user
- OLDADMINPASS - Original password of Admin user if change option specified
- Depends:
- common_functions - optional common_vars and common_host
- set_admin_password, lom_check
- Example:
- . ipmifunctions
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_admin_password
set_user_passwords()
- Function:
- prompt for CSCFADM and OTHER user
- Arguments:
- Notes:
- Used by usermod function to modify ILOM accounts
- Does NOT prompt if CSCFADM or OTHERUSER are empty
- Does NOT prompt for any variables that are already set
- Vars:
- CSCFADM - CSCF Admin user - default is: cscf-adm
- CSCFADMPASS - CSCF Amdin password
- OTHERUSER - Cluster Admin - if not set or empty the other user is NOT created
- OTHERPASS - Cluster Admin password
- Returns:
- CSCFADM - CSCF Admin user - default is: cscf-adm
- CSCFADMPASS - CSCF Amdin password
- OTHERUSER - Cluster Admin - if not set or empty the other user is NOT created
- OTHERPASS - Cluster Admin password
- Depends:
- common_functions - optional common_vars and common_host
- set_admin_password, lom_check
- Example:
- . ipmifunctions
- if ! lom_check "$1"
- then
- fatal "LOM $1 is not responding"
- fi
- set_admin_password
- set_user_passwords