Openshift 3.4: broken ansible dependencies

The new ansible openshift 3.4 installation playbook is very nice.

Just set deploy variables in the inventory and everything will raise from the ground magically…

Well, not immediately tough. Due to this bug you need to:

– downgrade ansible to 2.2.0.0 (the latest is 2.2.1.0)

Or the playbook will try do serialize python objects which are actually strings.

Eg. if your configuration contains:

– name: “MyServer”

Ansible looks for a MyServer() class instead of using str(“MyServer”)

RHEV: recovery VM in Unknown state

If an operation that implies a state change on a VM fails, sometimes RHEV sets the VM status to ‘Unknown’.
This morning, after a fail of a ‘Power off’ operation on a VM in panic – due to a bug ([vdsm] AttributeError: GuestAgent instance has no attribute ‘_sock’) – the VM state was set to ‘Unknown’.
In this case basically you don’t can do anything…
If you know the real state of your VM, you can manually change it and restart the VM. So I set the state of my VM to 0 (stopped) and I restarted it.

[root@rhevm ~]# psql -U engine
psql (8.4.20)
Digita "help" per avere un aiuto.

engine=> select vm_guid from vm_static where vm_name='server.example.com';
vm_guid
--------------------------------------
2d1e72a1-16c4-4f38-a21e-78113669dd98
(1 riga)

engine=> select status from vm_dynamic where vm_guid='2d1e72a1-16c4-4f38-a21e-78113669dd98';
status
--------
7
(1 riga)

engine=> update vm_dynamic set status=0 where vm_guid='2d1e72a1-16c4-4f38-a21e-78113669dd98';
UPDATE 1
[oVirt shell (connected)]# action vm server.example.com start

job-id : 7f1ac179-047c-4d50-932f-3ae7970c96e2
status-state: complete
vm-id : 2d1e72a1-16c4-4f38-a21e-78113669dd98

$ mv vaunaspada labs

Avete cercato vaunaspada.babel.it e vi siete ritrovati su labs.par-tec.it? Non siete vittime di un DNS spoofing, abbiamo solo dato una rinfrescata al blog, allineandolo al nuovo brand e look&feel.

Ciò che non cambia è la natura tecnica dei contenuti e l’entusiasmo del nostro team nel condividere le proprie esperienze con i propri simili.


Were you searching for vaunaspada.babel.it and you ended up on labs.par-tec.it? You are not the victim of a DNS spoofing, we just gave our blog a makeover, matching it with our (new) brand and look&feel.

What stays the same is the technical nature of the contents and the enthusiasm of our team in sharing their experience with others of their own kind.

Enjoy 😉

EuroPython 2015: Par-Tec c’è!

Anche quest’anno, come da 4 anni a questa parte, siamo presenti ad Europython. Nella magnifica cornice di Bilbao più di mille programmatori, sistemisti, devops e appassionati si sono riversati al check-in! [foto].
EP15
La location è fantastica, grazie al Google Social Event abbiamo potuto anche sperimentare la terrazza all’ultimo piano!

Il nostro talk è iniziato subito dopo il keynote, e nonostante la community python sia più vicina a mongodb e postgres, è stato bello vedere le persone fotografare lo schermo con le slide e chiedere informazioni alla fine. Pochissimi sapevano poi dell’esistenza di driver pure-python per MySQL!

La discussione innescata da Cloud Wars – un bel confronto tra i container provider (Atomic, CoreOS, …) dove ovviamente vince Atomic 😛 – è stata bella: più di un’ora a parlare dei problemi legati alla containerizzazione dei db insieme a sviluppatori di Openstack e vari cloud provider.

Qui ogni momento è geek, e anche se non ci siete potete seguire la diretta su twitter e/o farmi domande sui talk e le slide che trovate sul programma!

Altri talk interessanti:
Misurare i goal dello sviluppo
Garbage collection
Plotting big data

Linux@Dell XPS/Inspiron

My new Fedora 21 running on the nice Dell Inspiron with Touchscreen.

KDE works smoothly with both the touchpad and the touch display, I just had to tune the touch display with

xinput_calibrator

following this nice tutorial.

Today I tweaked the screen brightess. KDE uses steps of 10% – making things un-smooth.

From this post https://askubuntu.com/a/588016/401397 I just

sudo yum -y install xbacklight

And remapped the light up|down with

xbacklight -inc 10
xbacklight -dec 5

In this way I can fine tune up to 5%.

Get the keymap for the “win” button with:

# xinput --list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen Pen                      id=11   [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=12   [slave  pointer  (2)]
⎜   ↳ DLL0674:00 06CB:75DB UNKNOWN              id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ Integrated_Webcam_HD                      id=10   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)] <-------this device!
    ↳ Dell WMI hotkeys                          id=16   [slave  keyboard (3)]

Then listen for changes with

#xinput --test 14
key press   134 
key release 134 

CentOS 7 KeyMap IT

CentOS 7 utilizza di default systemd che è una suite di tools per l’amministrazione dei servizi di sistema.

per impostare il layout della tastiera si utilizza:

# localectl set-keymap it

ma facendo così, le informazioni al riavvio vengono perse.

basta editare il file /etc/grub2.cfg e impostare il parametro corretto vconsole.keymap=it al posto di vconsole.keymap=it2

al riavvio le informazioni vengono preservate dato che stiamo dicendo al kernel linux di utilizzare la virtual console con keymap it

maggiori info: http://www.freedesktop.org/software/systemd/man/systemd-vconsole-setup.service.html

Speeding up compression

We usually use compression when the only way to achieve faster data transmission is often reduce its size (especially  over the net). Canonical compression tools offer poor parallelism support, while multi-core system are wide adopted today.

If you want to keep working with versatile tool like gzip and step up to a higher level of performance, take a look at pigz (pronounced “pig-zee”, http://zlib.net/pigz , same lead programmer of zlib).

Command line is barely identical to gzip; by default it uses all available cores to spread calculation over. To limit core usage use the-p switch:

tar c  /data/path | pigz -p 3 > archive.tar.gz

uses 3 processes, if you run on a quad-core system, a processor  is made available for other tasks.

Restricted ssh access

Sometimes we need to use ssh secured connections to perform only a few system activities and not to actually open a command shell to the remote host.

When performing secure critical tasks, or accessing highly secured machines, accessing a full remote shell can be equal to open a breach.

E.g., backup tasks are usually performed by a specific system user, granting access using ssh; allowing a restricted set of commands for the backup user introduce some additional security, avoiding system-wide access.

Adding some configuration to ~user/.ssh/authorized_keys on the remote host can be a quick solution:

from="accessing_host.example.com",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="echo 'I can only print this useless message...damn'" ssh-rsa AAA...
...
...Pw== user@accessing_host.example.com

Where:

  • from option enables accessing from the specified host only
  • no-port-forwarding,no-X11-forwarding,no-agent-forwarding disable forwarding  capabilities from remote host
  • command option defines which command the connecting user can issue to the remote host. ALL other commands are ignored

command option can also include a script containing different shell commands to accomplish complex tasks.