Seguimos repasando algunas de las posibilidades que nos ofrece hponcfg, utilidad que permite cambiar desde el sistema operativo GNU/Linux la configuración de la iLO (Integrated Lights-Out) de servidores HP Proliant.
En este caso vamos a ver como modificar los parámetros de red (IP, máscara, puerta de enlace, etc) que se utilizan para posteriormente acceder a la web de gestión iLO.
Seguimos utilizando los ejemplos en formato XML de HP Lights-Out XML PERL Scripting Sample for Linux. A continuación el utilizado para realizar modificaciones en los parámetros de red:
<!-- RIBCL Sample Script for HP Lights-Out Products --> <!--Copyright (c) 2003,2010 Hewlett-Packard Development Company, L.P.--> <!-- Description: This is a sample XML script to configure the --> <!-- network settings for following devices: --> <!-- Integrated Lights-Out 3 (iLO 3) --> <!-- Integrated Lights-Out 2 (iLO 2) --> <!-- Integrated Lights-Out (iLO) --> <!-- Remote Insight Lights-Out Edition II (RILOE II) --> <!-- NOTE: You will need to replace the USER_LOGIN and PASSWORD --> <!-- and other values inside the quotation marks with values --> <!-- that are appropriate for your environment. --> <!-- Double check all values before executing this script. --> <!-- Incorrect or mismatched network settings may cause you --> <!-- to lose the ability to connect to your Lights-Out device.--> <!-- Use CPQLOCFG.EXE ver 2.26 or greater with this script. --> <!-- This script was written for iLO 3 firmware version 1.00 --> <!-- release. --> <!-- See "HP Integrated Lights-Out Management Processor --> <!-- Scripting and Command Line Resource Guide" for more --> <!-- information on scripting and the syntax of the RIBCL --> <!-- XML. --> <!-- Firmware support infomation for this script: --> <!-- iLO 3 - All versions. --> <!-- iLO 2 - All versions. --> <!-- iLO - All versions. --> <!-- RILOE II - All versions. --> <RIBCL VERSION="2.0"> <LOGIN USER_LOGIN="adminname" PASSWORD="password"> <RIB_INFO MODE="write"> <MOD_NETWORK_SETTINGS> <!-- Firmware support infomation for next 4 tags : --> <!-- iLO 3 - All versions. --> <!-- iLO 2 - All versions. --> <!-- iLO - All versions. --> <!-- RILOE II - None. --> <ENABLE_NIC value="Yes"/> <REG_DDNS_SERVER value="Yes"/> <PING_GATEWAY value="No"/> <DHCP_DOMAIN_NAME value="Yes"/> <!-- Firmware support infomation for next 22 tags : --> <!-- iLO 3 - All versions. --> <!-- iLO 2 - All versions. --> <!-- iLO - All versions. --> <!-- RILOE II - All versions. --> <SPEED_AUTOSELECT value="YES"/> <NIC_SPEED value="100"/> <FULL_DUPLEX value="Yes"/> <DHCP_ENABLE value="No"/> <IP_ADDRESS value="172.20.60.152"/> <SUBNET_MASK value="255.255.255.0"/> <GATEWAY_IP_ADDRESS value="172.20.60.1"/> <DNS_NAME value="demoilo"/> <DOMAIN_NAME value="internal.com"/> <DHCP_GATEWAY value="Yes"/> <DHCP_DNS_SERVER value="Yes"/> <DHCP_WINS_SERVER value="Yes"/> <DHCP_STATIC_ROUTE value="Yes"/> <REG_WINS_SERVER value="Yes"/> <PRIM_DNS_SERVER value="0.0.0.0"/> <SEC_DNS_SERVER value="0.0.0.0"/> <TER_DNS_SERVER value="0.0.0.0"/> <PRIM_WINS_SERVER value="0.0.0.0"/> <SEC_WINS_SERVER value="0.0.0.0"/> <STATIC_ROUTE_1 DEST="0.0.0.0" GATEWAY="0.0.0.0"/> <STATIC_ROUTE_2 DEST="0.0.0.0" GATEWAY="0.0.0.0"/> <STATIC_ROUTE_3 DEST="0.0.0.0" GATEWAY="0.0.0.0"/> <!-- Firmware support infomation for next 4 tags : --> <!-- iLO 3 - All versions. --> <!-- iLO 2 - None. --> <!-- iLO - None. --> <!-- RILOE II - None. --> <DHCP_SNTP_SETTINGS value="Yes"/> <SNTP_SERVER1 value="0.0.0.0"/> <SNTP_SERVER2 value="0.0.0.0"/> <TIMEZONE value="America/Anchorage"/> <!-- This tag can be used on an iLO blade server to force iLO --> <!-- to attempt to get an IP address from the signal backplane --> <!-- in a server enclosure. The IP address must be set prior --> <!-- with Mod_Enc_Bay_IP_Settings.xml --> <!-- Firmware support infomation for next tag: --> <!-- iLO 3 - All versions. --> <!-- iLO 2 - All versions. --> <!-- iLO - All versions. --> <!-- RILOE II - None. --> <!-- <ENCLOSURE_IP_ENABLE VALUE="Yes"/> --> <!-- Firmware support infomation for next tag: --> <!-- iLO 3 - None. --> <!-- iLO 2 - None. --> <!-- iLO - None. --> <!-- RILOE II - All versions. --> <!-- <WEB_AGENT_IP_ADDRESS value="192.168.0.1"/> --> </MOD_NETWORK_SETTINGS> </RIB_INFO> </LOGIN> </RIBCL>
En este XML tenemos que modificar primero los datos de conexión como administrador USER_LOGIN y PASSWORD y posteriormente a los parámetros que cada uno necesitemos modificar (IP_ADDRESS, SUBNET_MASK, GATEWAY_IP_ADDRESS…).
Si únicamente necesitáis cambiar los valores básicos, ahí va un script reducido y más fácil de entender:
<RIBCL VERSION="2.0"> <LOGIN USER_LOGIN="xxxxxxxx" PASSWORD="xxxxxxx"> <RIB_INFO MODE="WRITE" > <MOD_NETWORK_SETTINGS> <IP_ADDRESS VALUE = "192.168.0.100"/> <SUBNET_MASK VALUE = "255.255.255.0"/> <GATEWAY_IP_ADDRESS VALUE = "192.168.0.1"/> <PRIM_DNS_SERVER value = "192.168.0.222"/> <DHCP_ENABLE VALUE = "N"/> </MOD_NETWORK_SETTINGS> </RIB_INFO> </LOGIN> </RIBCL>
Una vez modificado todo el script a conveniencia lo ejecutamos contra la aplicación:
# hponcfg -f cambio-red.xml
Si en la salida de ejecución del comando recibimos “Script succeeded” el cambio debería haber funcionado y ya podríamos acceder con los nuevos datos.