Thursday, May 05, 2016

From 0 to ZFS replication in 5m with syncoid

The ZFS filesystem has many features that once you try them you can never go back. One of the lesser known is probably the support for replicating a zfs filesystem by sending the changes over the network with zfs send/receive.
Technically the filesystem changes don't even need to be sent over a network: you could as well dump them on a removable disk, then receive  from the same removable disk.

Sunday, March 13, 2016

SaltStack targeting: storing roles in pillar

This is an attempt to record my thoughts and describe a solution with regard on how to target/classify minions in a SaltStack environment.
SaltStack logo

An interesting discussion on the topic can be found in this (rather old) thread on the Salt-User mailing list:

https://groups.google.com/forum/#!topic/salt-users/R_jgNdYDPk0

Basically I share the same concern of the thread author Martin F. Kraft, who in an attempt to put and end to this madness ended up writing reklass.

Roles seem to be easy enough to understand and provide for a clear separation between the actual infrastructure and the desired configuration state, while allowing extensibility and customization (a more specific role can override some settings from another role).

Monday, February 29, 2016

Schedule a job every 5 minutes with Oracle DMBS_JOB

For all those struggling to schedule a job every 5 minutes without drift here's a "simple" interval expression which can be easily adapted to other intervals (every 10 minutes, 20, etc):

select
sysdate, trunc(sysdate) + ( ( to_number(to_char(sysdate, 'HH24'))*60+floor(to_number(to_char(sysdate, 'MI'))/5)*5 + 5 )  / 1440)
from dual;

Btw, the espression is in the second column of the query.

Thursday, February 25, 2016

OTRS embedded images and Lotus Notes

Emails with embedded images sent to OTRS from Lotus Notes can reach OTRS rendered as text with the embbeded image placed in a separate attachment.

The problem in not on OTRS side, but rather in the Lotus Notes client and server configuration.

To fix the issue on the Lotus client make sure that the option "Format for messages addressed to internet addresses" is set to MIME.
Then on the sever apply the following settings:

In the Domino Admin open the "Configuration" tab
Choose "Server"
Choose "Configurations"
Choose the appropriate server
Choose tab titled "MIME"
Choose "Conversion Options"
Choose "Outbound"
 

Change the setting for "Message Content formatting" to the bottom option called "Create Multi-part alternative ...".

Email should now reach OTRS properly formatted with embedded image displayed inline.

Tuesday, January 26, 2016

4 podcasts to follow

4 podcasts to listen to while commuting (in no particular order):

  1. DevOps cafè : hosted monthly, features great guests and packs a tremendous amount of valuable information. Warm up by listening to a great episode with with Tom Limoncelli
  2. MagPipe Talk show : I discovered this gem because it recently featured Martin Fowler
  3. The Changelog: more targeted towards developers than the previous two. Make sure you listen to the recent episodes with Yehuda Katx and Mitchell Hashimoto
  4. Hansel Minutes. Usually this one is mostly of interest to Windows people. Useful if one wants to keep an eye on the ther side of the pond or catch the occasional high-level talk

Sunday, January 10, 2016

One-liner libvirt KVM guest

Boot and install a new KVM guest with guest agent support with this super simple libvirt one-liner (great for scripts and CI deployments).
Tested on a Centos 7.1 host creating a Centos 7.1 guest from a basic Kickstart file.

Parameters should be quite self-explanatory, in any case here's the documentation for virt-install. Important: remember to change the unix socket path on the last line.

Tuesday, December 22, 2015

How to automatically import a ZFS pool built on top of iSCSI devices with systemd

When using ZFS on top of iSCSI devices one needs to deal with the fact that iSCSI devices usually appear late in the boot process. ZFS on the other hand is loaded early and the iSCSI devices are not present at the time ZFS scans available devices for pools to import.

This means that not all ZFS pools might be imported after the system has completed boot, even if the underlying devices are present and functional. A quick and dirty solution would be to run zpool import <poolname> after boot, either manually or from cron.

A better, more elegant solution is instead to hook into systemd events and trigger zpool import as soon as the devices are created.