Montag, 7. September 2015

How to import exising VM from virsh to ovirt?

It is simple as this:

  •  virsh dumpxml> centos70.xml 
  • Edit xml for corect path of the raw file
  • virt-v2v -i libvirtxml -ic qemu+ssh://ovirt-engine.server/system -o rhev -os IP:/EXPORT0/ -n ovirtmgmt /pathtoxml/centos70.xml

Sonntag, 12. Juli 2015

Sms from ubuntu with UMTS stick??

It is happened!!! Due to the terrible heat the clusters where overheated.
So I did not notified because of barbeque party. Nice weather, pool, friends..etc..

I did not have wifi on phone but GSM was there. Solution in this case is GSM connection from important services.
I got some telekom huawei stick with mobile data contract.
After plugging it to USB port Under ubuntu 14.04:  you should see something like this in lsusb:
lsusb
Bus 002 Device 006: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0c45:6409 Microdia Webcam
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Next step is Gammu
apt-get install gammu-smsd  

next configure it with correct ttyUSB:
/home/arm2arm# cat /etc/gammu-smsdrc
# Configuration file for Gammu SMS Daemon

# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
port = /dev/ttyUSB0
connection = at
# Debugging
#logformat = textall

# SMSD configuration, see gammu-smsdrc(5)
[smsd]
pin=1234
service = files
logfile = syslog
logfile = /var/log/gammu-smsd

# Increase for debugging information
debuglevel = 4
ReceiveFrequency = 300

# Paths where messages are stored
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/
 
 Warning: setup your PIN for the SIM card.
Restart the service and check the logs if it is ok:
/etc/init.d/gammu-smsd restart
If you get an error like this:
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: Created POSIX RW shared memory at 0x7f6aff847000
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: Starting phone communication...
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [Gammu            - 1.33.0 built 16:20:47 Aug  1 2013 using GCC 4.8]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [Connection       - "at"]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [Connection index - 0]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [Model type       - ""]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [Device           - "/dev/ttyUSB0"]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [Running on       - Linux, kernel 3.13.0-57-generic (#95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015)]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: [System error     - open in serial_open, 16, "Device or resource busy"]
Sun 2015/07/12 20:29:23 gammu-smsd[4934]: gammu: Init:GSM_TryGetModel failed with error DEVICEOPENERROR[2]: Error opening device. Unknown, busy or no permissions.

It is meaning some application holds your GSM stick.  
lsof  /dev/ttyUSB0 will shouw which program hold it.
WARNING: If you want to send SMS you should disable mobile data over the stick.
 

That's it you are done.
Let us test if we can send and recieve SMS:
from terminal try following:
echo "Test-SMS from ubuntu" | sudo gammu-smsd-inject TEXT "+49176xxxxxxxx"
Put your cell phone number and in a few second you will get the test SMS from laptop.
 

Montag, 4. Mai 2015

Performance Samsung SSD vs Seagate Hybrid Drives

I have 2 disks in my laptop Samsung ssd and normal HDD.
The second disk mostly used as a storage rather than fast io disk. It was going bad, and became bad.
To bye a big SSD for me make no sense my laptop supports only SATA2 and it is already 5 years old.
Recently I decided to replace the second HDD to hybrid one: ST1000LM014-1EJ164 ATA Device.
It has a 1TB storage with 8GB ssd inside for only 92EUR(cool!).

Let us see the performance between SSD and SSHD with CrystalDiskMark 3.0.2:
-----------------------------------------------------------------------
CrystalDiskMark 3.0.2 x64 (C) 2007-2013 hiyohiyo
                           Crystal Dew World : http://crystalmark.info/
-----------------------------------------------------------------------
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]

           Sequential Read :   109.523 MB/s
          Sequential Write :   109.937 MB/s
         Random Read 512KB :    41.080 MB/s
        Random Write 512KB :    86.506 MB/s
    Random Read 4KB (QD=1) :     0.724 MB/s [   176.7 IOPS]
   Random Write 4KB (QD=1) :     1.012 MB/s [   247.2 IOPS]
   Random Read 4KB (QD=32) :     1.898 MB/s [   463.3 IOPS]
  Random Write 4KB (QD=32) :     1.024 MB/s [   250.1 IOPS]

  Test : 1000 MB [D: 20.9% (195.0/931.5 GB)] (x5)
  Date : 2015/05/04 12:32:21
    OS : Windows 7 Home Premium Edition SP1 [6.1 Build 7601] (x64)
  -----------------------------------------------------------------------
CrystalDiskMark 3.0.2 x64 (C) 2007-2013 hiyohiyo
                           Crystal Dew World : http://crystalmark.info/
-----------------------------------------------------------------------
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]

           Sequential Read :   250.616 MB/s
          Sequential Write :   233.874 MB/s
         Random Read 512KB :   201.951 MB/s
        Random Write 512KB :   154.954 MB/s
    Random Read 4KB (QD=1) :    13.728 MB/s [  3351.6 IOPS]
   Random Write 4KB (QD=1) :    23.077 MB/s [  5634.0 IOPS]
   Random Read 4KB (QD=32) :    99.181 MB/s [ 24214.1 IOPS]
  Random Write 4KB (QD=32) :    68.726 MB/s [ 16778.8 IOPS]

  Test : 1000 MB [C: 96.6% (230.3/238.5 GB)] (x5)
  Date : 2015/05/04 12:38:47
    OS : Windows 7 Home Premium Edition SP1 [6.1 Build 7601] (x64)


In some cases my SSHD is 2 time slower that SSD but price is very reasonable:  0.09Euro/GB vs Samsung SSD 0.44Euro/GB
So price efficiency is about ~5times more for SSHD.
For sure for some loads ssd is better than SSHD becouse it brings about 52 times more IOPs in 4KB tests. As a archive SSHD is better than normal HDD, byt for virtual machines and DB applications better to use SSDs.



Freitag, 6. Februar 2015

OVIRT engile unable to import old "Export storage": How to fix

WARNING: before to start this tests, backup your datacenters,storages, config files etc..!!!
 
After reinstall ovirt 3.5.x I got following error during the import export domain:
Error while executing action: Cannot add Storage Connection. Storage connection already exists.

This was due to the many experiments what I was doing with old storage, I was trying  to attach or detach/ destroy them in meanwhile the name server went down, so Ovirt-Engine  somehow was screwed out.

Not show time to fix the corrupted database:
1) Try identify ovirt storageconnections using API:
curl -k -v -u "admin@internal:xxxxxxx" -H "Content-type: application/xml" -X GET https://ovirt-engine.cls/api/storageconnections

It shows something like this:

.....
   
       
192.168.101.102

        nfs
        /tank/VMs/EXPORT
   
......


2) So let us delete it:
 curl -k -v -u "admin@internal:xxxxx"  -X DELETE https://ovirt-engine.cls/api/storageconnections/8e5335e0-8821-40ee-8dc8-6b4245032920

 output will be like this:
complete

Important to have here complete, otherwise you should dive more deeper to find out the trouble.

So next try to connect again your old export, if it claims that domain is inuse with other one then make following:
1) mount old export storage to /tmp/media
2) find file: dom_md/metadata
3) remove line _SHA_CKSUM=
4) set empty  POOL_UUID=

Try to import in to new DC.
Enjoy the new setup.