iLO - IPMI on HP servers

Download Latest firmware
http://pingtool.org/latest-hp-ilo-firmwares/
https://support.hpe.com/hpesc/public/home/driverHome?sp4ts.oid=1009143853
# download "RECOMMENDED * Online ROM Flash Component for Linux - HPE Integrated Lights-Out"

Extract firmware
chmod +x /tmp/CP0*.scexe
/tmp/CP0*.scexe --unpack=/tmp

# flash iLo firmware (local)
yes | ./CP036949.scexe

# ipmitool -I lanplus -H www1-ipmi -U Administrator -P pass1234 hpm upgrade ilo4_261.bin

Flash iLo with SSH (not tested)

Nginx (proxy) Docker container

Create required directories
mkdir -p /etc/docker/nginx/{conf.d,html}

Configure nginx as webserver
cat < /etc/docker/nginx/conf.d/default.conf
server {
listen 80;
server_name _;

root /usr/share/nginx/html;
index index.html index.htm;
}
EOF

Configure nginx as proxy
cat < /etc/docker/nginx/conf.d/proxy.conf
server {
listen 80;
server_name foo.example.com;

location / {
proxy_pass http://localhost:8080/;
}
}
EOF

Create container

netdata

Docker
docker run -d --name=netdata \
-p 8080:19999 \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdata

# URL
http://SERVER_IP:8080

Links
https://github.com/netdata/netdata

OpenStack: Cleanup project objects

# Delete VM
openstack server list --project=test-project --os-cloud=dev
openstack server delete test-project-vm

# Delete floating IP
openstack floating ip list --project=test-project --os-cloud=dev
openstack floating ip delete 1.2.3.4

# Delete router
openstack router list --project=test-project --os-cloud=dev
openstack subnet list --project=test-project --os-cloud=dev
openstack router remove subnet test-project-router test-project-subnet
openstack router delete test-project-router

# Delete subnet
openstack subnet list --project=test-project --os-cloud=dev

OpenStack: Cloud management with Ansible

Ansible OpenStack modules
https://docs.ansible.com/ansible/latest/search.html?q=os_

Ansible OpenStack module repository
https://github.com/ansible/ansible/tree/devel/lib/ansible/modules/cloud/openstack

# Fix; To utilize this module, the installed version ofthe shade library MUST be >=1.8.0
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python-shade/python-shade_1.30.0-2_all.deb -O /tmp/python-shade_1.30.0-2_all.deb
sudo dpkg -i /tmp/python-shade_1.30.0-2_all.deb

OpenStack multi cloud / user configurattion

Configure connections
# ~/.config/openstack/clouds.yaml
clouds:
admin-dev:
auth:
auth_url: http://keystone-admin.dev.example.com:35357/v3
project_name: admin
username: admin
user_domain_name: Default
project_domain_name: Default
interface: internal
foo-stage:
auth:
auth_url: http://api.stage.example.com:35357
project_name: fooproject
username: foo
user_domain_name: foodom
project_domain_name: foodom

Configure passwords
# ~/.config/openstack/secure.yaml
clouds:

OpenStack: Install OpenStack CLI client (OSC)

release notes for openstack client tools
# installed
pip list | grep python-openstackclient
python-openstackclient 3.16.2

# available (for rocky release)
https://docs.openstack.org/releasenotes/python-openstackclient/rocky.html
https://github.com/openstack/python-magnumclient/releases

# install rocky client versions
pip install -U \
gnocchiclient \
"pankoclient<0.6.0" \
"python-barbicanclient<4.8.0" \
"python-cinderclient<4.0.1" \
python-cloudkittyclient \
"python-glanceclient<2.14.0" \
"python-heatclient<1.17.0" \

OpenStack: Regenerate kolla password file

OS_ENV=dev

rm /etc/kolla/passwords.yml
cp /etc/kolla/config/passwords-${OS_ENV}.yml /etc/kolla/passwords.yml

# marge new password / reorder passwords
# kolla-genpwd -p /etc/kolla/passwords.yml
# cp /etc/kolla/passwords.yml /etc/kolla/config/passwords-${OS_ENV}.yml

cat /etc/kolla/config/passwords-${OS_ENV}.yml | cut -d" " -f1 > /etc/kolla/passwords.yml
kolla-genpwd -p /etc/kolla/passwords.yml
mv /etc/kolla/passwords.yml /etc/kolla/config/passwords-${OS_ENV}.yml
ln -s /etc/kolla/config/passwords-${OS_ENV}.yml /etc/kolla/passwords.yml

Links

ipmitool

Install
sudo apt-add-repository universe
sudo apt install -y freeipmi-tools ipmitool

Install ipmitool (IPMI command line client)
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.ipmitool.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Configure BMC to DHCP
# show BMC interface informations
ipmitool lan print

# set dhcp IP
ipmitool lan set 1 ipsrc dhcp

# set static IP
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.0.1.11
ipmitool lan set 1 netmask_address 255.255.255.0
ipmitool lan set 1 defgw ipaddr 10.0.1.252

Commands
# Reset chassis intrusion
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x03

# enable UID light
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x0d

# disable UID light
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x0e

configure bmc user
NEW_BMC_USER=devops
NEW_BMC_PASS=pass1234
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} user set name 2 ${NEW_BMC_USER}
ipmitool -H ${BMC_IP} -U ${NEW_BMC_USER} -P ${BMC_PASS} user set password 2 ${NEW_BMC_PASS}

view sensors readings
ipmitool sdr

# howto
# reset BMC
ipmitool -I lan -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} mc reset cold

# reset factory defaults
ipmitool -I lan -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} raw 0x3c 0x40

# reset server
ipmitool power reset -I lan -H ${IP} -U ADMIN -P ADMIN

# power on / off
ipmitool -I lanplus -H SERVER_IP -U ADMIN -P ADMIN power on
ipmitool -I lanplus -H SERVER_IP -U ADMIN -P ADMIN power off
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} power reset

# get IPMI IP
IPMI_IP=$(ipmitool lan print | grep "IP Address" | grep -v Source | cut -d":" -f2)

FRU
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} fru

Configure User
https://docs.oracle.com/en/database/oracle/oracle-database/18/cwlin/example-of-bmc-configuration-using-ipmitool.html#GUID-11E563E0-3688-4FE9-8440-81402A7AC23A
https://www.thomas-krenn.com/de/wiki/IPMI_Konfiguration_unter_Linux_mittels_ipmitool
https://www.thomas-krenn.com/de/wiki/IPMI_Konfiguration_unter_Linux_mittels_ipmitool

# test
ipmitool -I lanplus -H 192.168.1.100 -U ADMIN -P ADMIN sdr
ipmitool -I lan -H 192.168.1.100 -U ADMIN -P ADMIN sdr

Configure temporary boot device
https://www.thomas-krenn.com/de/wiki/Bootdevice_mit_ipmitool_setzen

# boot to bios
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} chassis bootdev bios
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} power reset

# boot to pxe (UEFI)
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} chassis bootdev pxe options=efiboot
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} power reset