суббота, 18 октября 2014 г.

OpenStack Horizon good catch

TL;DR

Wanna share my joy, i always want to finish _debugging_ with awesome oneline fix...this is it.

We'r doing multi-regional OpenStack across at least 7 datacenters. PKI tokens are really good for such kind of deployments.

- No token storage required. (except non-critical token hashes)
- Token verification without keystone

Unfortunately cons of this approach that token are pretty big ~8Kbytes. At least full catalog packed into token. Finally we'r using PKIZ (compressed PKI) to decrease the size (Backported to Icehouse from Juno).

All works like a charm...before today after adding one more region. We've noticed that Horizon stopped to show "Project" tab nor any additional tenants for user. From CLI all works perfectly.

Error:  Request attribute token must be less than or equal to 8192.

Finally found that we'r affected by this bugHorizon while getting project list tries to send _full_ token instead of id (md5 hash) that's why token not fits into 8K.

The simplest workaround (not the solution) was to increase keystone "max_token_size". My challenge was to not finish on this easy workaround and continue to dig deeper.

P.S.: My uncompressed token was 8.5K (88 endpoints)
P.S.S.: Large OpenStack community has it's benefits: in 80% cases someone already plunged into your issue and filled a bug .




понедельник, 6 октября 2014 г.

Updating BIOS with USB stick on Thinkpad (Linux)

Basically Lenovo supports two ways of upgrading BIOS: Windows upgrade utility or burning ISO to CD.
I don't have nor Windows nor CD-ROM on my laptop.

Idea is to prepare bootable USB stick from the ISO.

1) Get the BIOS Update Bootable CD from http://support.lenovo.com (In my case for T530)
2) Convert ISO to img. This is most important step because. Based on manual from thinkwiki.org i'd used
"geteltorito" script for convertation. This script supports special harddisk emulation (BootMediaType=4) ISO format.

wget http://userpages.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito
chmod +x geteltorito
./geteltorito -o bios.img ~/Downloads/g4uj25us.iso

3) dd image onto USB stick. ( CAREFUL: Use real path to USB instead of /dev/sdX )

sudo dd if=bios.img of=/dev/sdX bs=512K

4) Boot from USB and follow the instructions. Also please read official readme before doing any flashing. (i.e. for T530)

NOTES:
- Make sure USB booting enabled in BIOS. "Config --> USB --> USB UEFI BIOS support" should be "Enabled"
- After updating firmware i've plunged into issue with not workable "brightness control" keys. Solution: add kernel paramenter acpi_osi="!Windows 2012"