[OpenBSD] Forcing CARP failover

To force a CARP failover from a master firewall/router to its slave, you can manually change the value of the demotion counter like this:

fw1:~# ifconfig -g carp carpdemote 50

This command will increase the advskew value of all CARP interface on the host by the demotion counter value. The interface with the lowest advskew value will be promoted ‘MASTER’. I use a base advskew value of 80 on the master host and 120 on the slave. The failover should be transparent to end users.

You can check the current interfaces states and their advskew values like this:

fw2:~# ifconfig carp | grep adv
        carp: MASTER carpdev em1 vhid 150 advbase 8 advskew 80
        carp: MASTER carpdev em1 vhid 151 advbase 8 advskew 80
        [...]

To switch back simply decrease the demotion counter in order to have a lower value on the master again:

fw1:~# ifconfig -g carp -carpdemote 50

Guru meditation

If you use the HTTP reverse-proxy Varnish or the VirtualBox hypervisor, you probably already encounter a funny Guru meditation error message.

But who is this guru and what is the origin of this message ?

In the 1980s the Amiga computer system was a very popular personal computer brand. Originally intended as a videogame machine but latter reconceived as a general purpose computer, the development of the first Amiga computer took a considerable time. In the interim the Amiga corporation released a number of other products.

One of them was the Joyboard, a balance board peripheral for the Atari 2600. The Joyboard was conceived by installing the four directional latches of a joystick on the bottom of a plastic board. Leaning in a certain direction engaged these latches, controlling the game pretty much like the modern Nintendo Wiiboard does.

According to the legend, in the early development of the AmigaOS, developers became so frustrated with the system’s frequent crashes that, as a relaxation technique, they attempted to sit cross-legged perfectly still on a Joyboard. In this position they look like Indian gurus.

Quickly they developed a little video game where the winner was the one who stayed still the longest without engaging any of Joyboard’s latches. If a player moved too much a guru meditation game-over screen occurred. As an easter-egg this guru meditation was integrated into the AmigaOS as a general error message, and since them became quite popular.