Monday, June 16, 2014

Centos 6.4 GUI installation : Could not allocate requested partitions: not enough space for LVM requests.

Issue:

I'm building a new vm image of Centos 6.4 using the GUI. Upon creating the lvm disk configuration, I receive the following error message despite having a 5G disk :



 

Solution:  Use "Create Custom Layout"

 

Overview of tasks:
  • Create /boot partition
  • Create lvm partition
  • Create / partition using lvm

 

Detail steps

  • Click back button to return to disk installation menu, select "Create Custom Layout".
  • Click Next" 



  • Click "Create"
  • Select "Standard Partition" and click "Create"
  • In the Mount Point list, Select "/boot"
  • Click "OK"


  •  Click "Create"
  •  Select "LVM Physical Volume", and click "Create"
  • If you want use the rest of the partition for the entire lvm type the "Size" as show below then click OK.


  • Click "Create"
  • Select "LVM Volume Group" and click "Create"
  • If you want to Change the name of the Volume Group Name. We use VolGroup00
    • Note : Volume Group Name maps this part of the filesystem name
      • /dev/mapper/VolGroup00-root
  • Click "Add"
  • In the "Mount Point" list, select "/"
  • If you want to change the "Logical Volume Name". We use root
    • Note : Logical Volume Name maps this part of the filesystem name
      • /dev/mapper/VolGroup00-root
  • Click "OK"
  • Click "OK"
  •  Finally, Click "Next"

  •  Enjoy

Wednesday, May 28, 2014

Opennebula context support for Centos 5

Issue

I am a big fan of Opennebula because of some of features such as good support for virtual networking and vmware and documentation. One of the biggest attractions is that is it truly open source. Opennebula has way to pass parameters from the Sunstone interface and pre-defined templates to provision a new virtual machine(vm) via context. We tried to provision some vm's with Centos 6 and it worked great using Opennebula-context rpm package install in the base image. Unfortunately the context package did not work for Centos 5.

Diagnosis

We first installed one-context.rpm on a Centos 5 image. Upon provisioning a new guest, We noticed that the context was not being implement. Such as the hostname not being update to what we typed in the Sunstone interface.

We then looked at Opennebula-context in Github. /etc/init.d/vmcontext is the main service which runs all the context.

Upon closer inspection, the cdrom was not being mounted and that /dev/disk/by-label/CONTEXT symlink was missing. /dev/disk/by-label/CONTEXT was symlink to /dev/sr0 on Centos 6 which was named differently on Centos 5.

Centos 6
/dev/sr0
 
Centos 5
/dev/hdb
 
On the Centos 5 guest vm. We manually symlinked to the cdrom:
cd /dev/disk/by-label
ln -sf ../../hdb CONTEXT
 
Test vmcontext service:
service vmcontext start

We received : "mount: no such partition found" which was tracked down to this line in /etc/init.d/vmcontext
mount -t iso9660 -L CONTEXT -o ro /mnt
 
If we run the following first then the line above would work. Weird.
mount /dev/disk/by-label/CONTEXT -o ro /mnt
umount /mnt
mount -t iso9660 -L CONTEXT -o ro /mnt

 

Solution

Perform these steps on the Centos 5 base image before you import into Opennebula
vi /etc/init.d/vmcontext
change
mount -t iso9660 -L CONTEXT -o ro /mnt
to
mount /dev/disk/by-label/CONTEXT -o ro /mnt
 
To make the symlink correct cdrom device we need to update udev

vi /etc/udev/rules.d/50-udev.rules
change
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", SYSFS{device/media}=="cdrom", SYMLINK+="cdrom cdrom-%k"
to 
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", SYSFS{device/media}=="cdrom", SYMLINK+="cdrom cdrom-%k disk/by-label/CONTEXT"
 
comment out 
BUS=="ide", KERNEL=="hd*[0-9]", SYSFS{../removable}=="1", GOTO="persistent_end"
to
#BUS=="ide", KERNEL=="hd*[0-9]", SYSFS{../removable}=="1", GOTO="persistent_end"

Friday, May 23, 2014

Restore Classic Firefox toolbars

Again I have to blog about the stupidity of the firefox version 29.0.1 interface designers. I want to refresh the screen but do not want to press F5. Hunting for that tiny refresh icon on the left of the url bar is quite annoying.



 Let's restore the classic theme




  • Restart Firefox
  • Click View > Toolbars > ...Customize
  • Bottom right Click right of Buttons Toggle to Small
  • Drag Refresh Tool button to where you want.
  • Close Customize Tab

Thursday, May 15, 2014

Iastordatasvc.exe High CPU usage

Iastordatasvc.exe High CPU usage

 

System configurations:
Dell Vostro 220

Intel(R) Core(TM)2 Duo CPU E7500@2.93GHz
4.0 GB
Windows 7 32-Bit

I found that my computer system was very slow and sluggish. 

View processes running
  • Ctrl+Shift+Esc to view the Windows Task Manager
  • Click processes tab
  • Click CPU column to sort by highest percentage
I just install a new video card that changed the Intel Rapid Storage technology driver to use Iastordatasvc instead.

After a bit of research I found the correct driver for this configuration. 


Intel_Intel-Rapid-Storage-Te_A00_R295887.exe 
download here:http://www.dell.com/support/drivers/us/en/19/driverdetails?driverid=RR3H4
 
Run the installation and restart computer and the CPU usage was back to normal.  

Tuesday, May 13, 2014

Annoying default design of Firefox tab location


As of late, Firefox version 29 in its infinite wisdom decided the default location for tabs is above the url toolbar. It's in my opinion and many others agree that having the tabs immediate above the main html section is functionally correct, productive and makes sense.


Here is the solution : https://support.mozilla.org/en-US/questions/991043

But instead of giving a clear answer, you need to read the thread figure it out and decide which course of action.

Here's the skinny.

You should also be able to do this with code in userChrome.css by specifying a value for -moz-box-ordinal-group higher than the default 1, so the Tab bar is moved to a lower position than its current position in the DOM.


Manual steps to update firefox configuration

  1. Find the equivalent directory to the following:
    •  Windows
      • C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default  
    •  Mac
      • ./Library/Application Support/Firefox/Profiles/xxxxxx.default/chrome/userChrome.css
    • Linux
      • /home/[username]/.mozilla/firefox/xxxxxx.default/chrome/userChrome.css
  1. mkdir chrome 
    • C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default\chrome  
  2. cd chrome
  3. Add code to file userChrome.css (case-sensitive )
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
 #TabsToolbar{ -moz-box-ordinal-group: 100 !important; }
  1. Restart Firefox

One liner update for linux

  1. cd /home/[username]
     
  2. chromeprofile=`cat .mozilla/firefox/profiles.ini  | awk '/Path/{split($0,a,"=");print a[2]}'`;userchromepath=.mozilla/firefox/$chromeprofile/chrome;mkdir -p $userchromepath;echo '@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */'$'\n#TabsToolbar{ -moz-box-ordinal-group: 100 !important; }' > $userchromepath/userChrome.css
  3. Restart Firefox

Tuesday, March 25, 2014

Load Testing Websockets

Objective

Determine the load the system can handle in websocket connections.


Background

The difficulty is that websockets require a "handshake" to transform a http request to a tcp connection. I initial looked at Gatling ( http://gatling-tool.org/) with the websockets addon( https://github.com/gilt/gatling-websocket ). But I did not want learn scala or performing scripting. I wanted something that displayed output like apache bench. My research led me to Thor (https://www.npmjs.org/package/thor)


Installation

Centos 5.8 x86_64
nodes.js
npm (node package module )
thor

Install nodes.js


We have a user thor which we are going to run thor
cd /home/thor
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-x64.tar.gz
tar -xvf node-v0.10.26-linux-x64.tar.gz

vi hello_nodes.js
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello Node.js\n');
}).listen(8124, "server");
console.log('Server running at http://server:8124/');

./node-v0.10.26-linux-x64/bin/node hello_node.js
Server running at http://server:8124/

In a browser : http://server:8124/


Install npm


My first attempt to install on Centos 5.8 was to find the rpms. npm and nodes.js was suppose to be in epel repo.

wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
yum search --enablerepo=epel-testing --enablerepo=epel npm
No Matches found

yum provides --enablerepo=epel-testing --enablerepo=epel npm */npm
No Matches found

I decided to build from source

https://github.com/npm/npm
export PATH=$PATH:/home/thor/node-v0.10.26-linux-x64/bin
yum install git -y
git clone https://github.com/npm/npm.git
cd npm
make install
cd ..

which npm
/home/thor/node-v0.10.26-linux-x64/bin/npm


Install Thor

https://www.npmjs.org/package/thor
npm install thor

Example
You can setup an apache tomcat websocket server Here.

ws
 ./npm/node_modules/thor/bin/thor --amount 100 ws://websocket:8080/examples/websocket/chat
 ./npm/node_modules/thor/bin/thor --amount 1000 ws://websocket:8080/examples/websocket/chat
 ./npm/node_modules/thor/bin/thor --amount 100 --concurrent 5 ws://websocket:8080/examples/websocket/chat

apache

ws
 ./npm/node_modules/thor/bin/thor --amount 100 ws://websocket:9090/examples/websocket/chat
 ./npm/node_modules/thor/bin/thor --amount 1000 ws://websocket:9090/examples/websocket/chat
 ./npm/node_modules/thor/bin/thor --amount 100 --concurrent 5 ws://websocket:9090/examples/websocket/chat


Output


Thor:                                                  version: 1.0.0

God of Thunder, son of Odin and smasher of WebSockets!

Thou shall:
- Spawn 1 workers.
- Create 2 concurrent/parallel connections.
- Smash 100 connections with the mighty Mjölnir.

The answers you seek shall be yours, once I claim what is mine.

Connecting to ws://websocket:8080/examples/websocket/chat

  Opened 100 connections


Online               439 milliseconds
Time taken           441 milliseconds
Connected            100
Disconnected         0
Failed               0
Total transferred    132.62kB
Total received       71.85kB

Durations (ms):

                     min     mean     stddev  median max
Handshaking          1       5             3       4 20
Latency              0       0             1       0 3

Percentile (ms):

                      50%     66%     75%     80%     90%     95%     98%     98%    100%
Handshaking          4       5       5       6       7       11      17      20      20
Latency              0       0       1       1       1       1       1       2       3


References: http://howtonode.org/how-to-install-nodejs

Monday, March 24, 2014

Installing different version of python on Fedora / Centos

Objective

We need a specific version of python other that the default version install by the OS. For instance Centos 5.8 comes with python version 2.4.3. Under no circumstance we should replace the python version the OS requires. Bad things will happen.

Current Installation


#python
Python 2.4.3 (#1, Jun 18 2012, 08:55:23)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg', '/usr/lib/python2.4/site-packages/chardet-1.0.1-py2.4.egg', '/usr/lib/python2.4/site-packages/autobahntestsuite-0.6.1-py2.4.egg', '/usr/lib/python2.4/site-packages/klein-0.2.3-py2.4.egg', '/usr/lib/python2.4/site-packages/Jinja2-2.7.2-py2.4.egg', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages']


Installation in a different location


python2.7
http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xvf Python-2.7.2.tgz
cd Python-2.7.2
./configure
make
make altinstall


Check path

 
#python2.7
>>> import sys
>>> print sys.path
['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']
>>>