VMware vApp (from vSphere) to KVM

So we have a simple migration at hand looking at the current virtualization landscape, right ?

  1. Use virt-convert from python-virtinst. In other words: OVF to libvirt’s XML
  2. Launch KVM with the resulting migrated files (both images and metadata)
  3. Do trivial configurations inside the guest machine to match host environment

That was my idealized view. It turns to be this way:

  1. Try virt-convert to discover that it fails when converting from OVF.
  2. Try to fix libvirt python code libraries (OVF XML parser).
  3. When the code is fixed, the resulting metadata files are malformed.
  4. Try with the commercial “vCenter Converter Standalone”: ERROR: “OVF contains multiple virtual machines”.
  5. Download ~500MB of “VMWare Server” to just use the “vmware-vdiskmanager” binary (1.4MB).
  6. Construct libvirt’s xml, with some hand-edited sections.
  7. virt-manager fails when connecting via VNC to your remote VM due to a Ubuntu-CentOS cross-distro issue involving NetCat parameters. Place a workaround and report the bug.
  8. Optimize both virtual network and disk performance switching to VirtIO.
  9. Rebuild guest ramdisk image in order to load VirtIO drivers in the boot process.


Dilbert.com

Want more details ? Keep reading…
Continue reading →

India: Airtel.in GPRS mini-howto


If you ever happen to need GPRS “MoBoffice” data connection in India with Airtel.in, keep in mind that after activating your pre-paid SIM-card you should:

  1. Send an SMS message to 170 with text PLIVE
  2. Dial *148# (toll free).
  3. You will be presented a menu with 2 options: select 1, to activate Airtel Moboffice.
  4. After 1 hour you’ll receive nearly 6 SMS’s with details on howto configure your mobile.
  5. If you use a nokia770, make sure that the GPRS access point is airtelgprs.com and *not* airtelfun.com. Nokia 770 hacker edition has this outdated info by default and will not work out of the box :/

Airtel.in website is hugely undocumented on this aspect, I discovered this details (tricks?) by sending an email to Airtel.in support: 121@airtelindia.com :S

And btw, the tariff at the moment is 30 paisa for each 50KB you use… 100 paisa is 1 rupee, so to check your email and post a text entry on your blog costs you about 1 to 2 rupees… really cheap indeed !

Change MySQL root password

So you forgot your MySQL root password ? Don’t worry, logging in is easy as 1,2,3:

  1. Stop all running mysqld processes (/etc/init.d/mysqld stop or killall mysqld)
  2. # mysqld –skip-grant-tables
  3. $ mysql -uroot and you’re in, no password required

Till here, you’ll be able to operate with your DB…but, you’ll not be able to change your password right away:

mysql> SET PASSWORD FOR root = PASSWORD('will_not_forget_again');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables
option so it cannot execute this statement

Here’s the workaround:

mysql> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE user
    -> SET PASSWORD=PASSWORD('really:I_will_not_forget_again')
    -> WHERE user="root";
Query OK, 2 rows affected (0.02 sec)
Rows matched: 2  Changed: 2  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

Thanks to netadmintools for this quick recipe :)

Ben tip d’SPAM: Greylisting i SPF

SPAM

La batalla continua indefinidament: es milloren els motors antispam (spamassassin, dspam…) i els spammers s’adapten, s’usen llistes negres remotes (RBL‘s) i ells s’adapten… que un gif com attachment pot tenir pinta d’spam ? Doncs ells usen PDF’s… el compte de mai acabar :/

Doncs bé, fart de rebre una mitja de 10 spams diaris a l’Inbox vaig decidir implantar mesures dràstiques. Primer vaig probar amb greylisting (usant postgrey). El resultat va ser decepcionant: apenes filtrava un 10% més dels spams respecte a no tenir aquesta mesura.

La capacitat d’adaptació i perseverança dels spammers em recorda a uns personatges d’una sèrie de ciència ficció :-/… El cas és que finalment em vaig decantar per SPF… conclusió després de setmanes d’ús i revisió de logs exhaustiva: tant de bo ho hagués fet abans !

Continue reading →

Nokia 6230i simple backup

If you’re switching between providers and want to keep your addressbook and sms’s, here is a simple way of doing so with gnokii:

$ gnokii --getsms AR 1 10 -d >> sms_archive
$ gnokii --getphonebook SM 1 200 > phonebook

The “AR” stands for “ARchive” and tells gnokii to search the SMS’s there, and not in the INbox (“IN” being another cellphone storage area). Following AR, there is the SMS range you want to save (sms 1st till 10th). Make sure you have a look at gnokii manpage if this is not working for you. For instance, on the following command, the “SM” is referring to the SIM card… perhaps you’re not storing your phonebook there, but in the internal mobile phone memory (“ME”).

Here I’m assuming that you have configured your /etc/gnokiirc properly. Just for the record, I’m using a bluetooth usb adapter.

As a result of this mini-howto, you have a plaintext copy of your phonebook and sms messages on your computer, isn’t it easy and convenient ? :) Sure, there are clearly better and comprehensive alternatives out there, like SyncML (OpenSync), but this solution suits my needs very quickly and it’s quite effortless.

Doing a backup of the photos is even simpler if you happen to have kblueetothd, one of the coolest KDE kioslaves: just drag&drop the pictures to your PC and you’re done !