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

Supermicro

BIOS & IPMI Downloads
https://www.supermicro.com/support/resources/bios_ipmi.php

sum (Supermicro Update Manager)
./sum -i ${BMC_IP} -u ${BMC_USER} -p ${BMC_PASS} -c UpdateBios --file /root/bin/bios/${BIOS_FW}

# load bios defaults
./sum -i ${BMC_IP} -u ${BMC_USER} -p ${BMC_PASS} -c LoadDefaultBiosCfg

# get sata info
./sum -i ${BMC_IP} -u ${BMC_USER} -p ${BMC_PASS} -c GetSataInfo

# get default BIOS settings
./sum -i ${BMC_IP} -u ${BMC_USER} -p ${BMC_PASS} -c GetDefaultBiosCfg --file supermicro_default.xml

# get current BIOS settings

consul

echo '["abcdef123458"]' /var/consul/serf/local.keyring
service consul restart

# config
cat /etc/consul/config.json

# log
/var/log/syslog

CLI
consul catalog datacenters
consul catalog nodes
consul catalog services

consul monitor
consul validate /etc/consul/config.json
consul operator raft list-peers

Redirect UI to localhost
ssh -L 8500:localhost:8500 root@node1.example.com -N

UI listen on external
https://stackoverflow.com/questions/35132687/how-to-access-externally-to-consul-ui

# cat /etc/consul/config.json

Enable UEFI / PXE boot on Mellanox ConnectX NIC

Boot GRML iso
https://grml.org/download/

Enable SSH daemon
service ssh start
passwd
ip a

# ssh root@GRML_IP

Install Mellanox CLI tools (MFT)
http://www.mellanox.com/page/management_tools
apt update
apt install -y gcc make dkms linux-headers-$(uname -r)

URL=http://www.mellanox.com/downloads/MFT/mft-4.12.0-105-x86_64-deb.tgz
wget -O- ${URL} | tar xvz -C /tmp
/tmp/mft-*-deb/install.sh
mst start

Show device state
mst status
flint -d /dev/mst/mt4119_pciconf0 q

GitLab: Backup to S3

Configure Git
# /etc/gitlab/gitlab.rb
gitlab_rails['backup_upload_connection'] = {
'provider' => 'AWS',
'region' => 'ew-west-1',
'aws_access_key_id' => 'KEY123',
'aws_secret_access_key' => 'PASS124',
'endpoint' => 'https://s3.example.com'
}
gitlab_rails['backup_upload_remote_directory'] = 'backups'
gitlab_rails['backup_keep_time'] = 604800

gitlab-ctl reconfigure

Test
gitlab-rake gitlab:backup:create

Configure periodic backup
# crontab -e
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

GitLab: LFS on S3

Configure GitLab
...
gitlab_rails['lfs_enabled'] = true
gitlab_rails['lfs_object_store_enabled'] = true
gitlab_rails['lfs_object_store_proxy_download'] = true
gitlab_rails['lfs_object_store_remote_directory'] = "lfs"
gitlab_rails['lfs_object_store_connection'] = {
'provider' => 'AWS',
'aws_access_key_id' => 'KEY123',
'aws_secret_access_key' => 'PASS1234',
'endpoint' => 'https://s3.example.com',
}

gitlab-ctl reconfigure

Install (on client)
apt-get install -y git git-lfs

# create LFS testfile