Tuesday, May 22, 2012

Amazing!!!

900+ views!!! wow thatz amazing!! (for a blog that is updated rarely)

I started this blog when i was involved high time on VMware and Linux related projects in an ISP. Later on I moved over to a different work environment and totally forgot about this blog. Today I was here by a wrong click and to my astonishment I found people actually looking here for info. My purpose of starting this blog seems to be fulfilling and that is an encouragement to continue.

I will start working more frequently on this and try to get as much info/posts as possible to my viewers.
Untill then Happy Virtualizing..
-
Penguin ;)

Friday, November 12, 2010

how to get flash videos on ubuntu-8.04 desktop


I was breaking my head for the past 15 days or more to play videos posted in
facebook using firefox 3 on ubuntu-8.04 (hardy). But nothing worked, from downloading the .deb file from adobe to manually installing the adobe-flashplugin.
After much search over web and testing on my ubuntu desktop finally below things solved my problem.

Firefox actually searches for libflashplayer.so file to play the videos so if its not present in the plugins dir then create softlink using below commands...

prudhvi@RAPTOR:~$ sudo cd /usr/lib/firefox-addons/plugins/
prudhvi@RAPTOR:~$ ln -s /usr/lib/adobe-flashplugin/libflashplayer.so

Now I was able to play the videos but it was like watching TV on mute :).. On checking for that I found that flash looks for libesd.so.1 for playing audio.
Again create a soft link.. blah blah like below.

prudhvi@RAPTOR:~$ sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1

Its not over yet the above lib expects a socket for playing audio so create one as below..
prudhvi@RAPTOR:~$ sudo mkdir -p /tmp/.esd/
prudhvi@RAPTOR:~$ sudo touch /tmp/.esd/socket

This should be it and i can view all my videos with out any problemo..
Just thought of documenting here for future references and hope this is helpful to whoever is still using HARDY.

see yaa

Monday, October 25, 2010

small script to collect data using esxtop

here is a script to collect 24 hours worth of data into 24 separate files:

for i in `seq 24`;do esxtop -a -b -n 1800 -d 2 > esxtop_$i.csv;done

You can adjust the "seq x" number to any number of hours and it names the file with the hour it is running in...

Cheers :)

Tuesday, October 5, 2010

ESXTOP - a swiss knife for ESX performance analysis

ESXTOP is an excellent tool for VMs performance analysis in an ESX server. Based on my analysis, i am posting info about some of the parameters in ESXTOP which help in identifying the resource that is degrading performance of VMs.

History behind post:


Sometime ago, developers working for one of my client started complaining about performance issue they were facing with desktop VMs alloted to them. At that time we weren't equipped with products which could do Performance analysis except for VIC Performance charts. But charts weren't giving me enough confidence to prove the cause of performance bottle necks. During this time I had to play around with ESXTOP command and the Perfomance analysis using this was so accurate that we could exactly pinpoint what resources (CPU and Mem) were degrading the VMs Performance and take the necessary steps.

Virtual Infrastructure:
--> Virtual center 2.5
--> ESX 3.5


Analysis:

After running ESXTOP command in the ESX server, decide the required option (like cpu, mem, disk and n/w) you want check and type ' f '
to add/remove parameters that are mentioned below.
--> For CPU related:


The most important thing to check is %RDY. %RDY needs to be around 5 but if reaches more than 10% better press the panic button and start finding what is eating resources. Usually, it could be low availability of resources in the host which can be overcome by migrating some VMs present on this host to other and then again check %RDY.


%USED displays the percentage of CPU cycles that remain unused. This should be compared with %RDY, see if %USED is not near to 1% while %RDY is in its expected values.

More %RDY can be brought down by reducing the VMs count on that host and also by providing some CPU reservation to VMs.


Sometimes we also need to see the PCPU values which show utilization of physical processors. The utilization values should be nearly same for all the processors.

If they are not same, I mean -

> If the PCPU values are very high that means host is having high utilization – migrate some VMs from this host and check again if PCPU values have reduced (high host utilization will definitely reduce VM performance) . The values can be somewhere in b/w 30-65%
.

>If the PCPU values are showing different values like one processor has 100% utilization while another has 10% that means some of the VMs are using the whole CPU allocated to them. This may be reduced by allocating multiple vCPUs but this kind of situation is very rare.

--> For RAM related:

From VM perspective, RAM utilization is more dependent on applications running in VMs but sometimes host might be having issue in providing RAM to VMs which can be checked with below parameters.

Below are expansion of each parameter's abbreviation that are related RAM on ESX host.
PMEM – Physical memory;
VMKMEM - virtual machine memory;
COSMEM – ESX server service console memory;
PSHARE – ESX server page sharing statistic;
SWAP – ESX server swap space;
MEMCTL – memory balloon driver;
MEMSZ column gives total allocated memory;


The memory that is actively in use by guest operating system and its applications are reported in touched (TCHD) and active counters (mainly %ACTV, %ACTVS, %ACTVF).
TCHD (shouldn’t cross around 60% of MEMSZ) and %ACTV counters should be as low as possible because the more these are the more they try to consume ESX memory and if that is not available
VMs start using their swap memory (.vswp file) which lowers performance.


MCTL parameter shows if the balloon driver is active or not. Will be ‘Y’ if active.
MCTLSZ gives the amount of memory the balloon driver is using in a specific guest operating system. This memory for balloon driver is collected from less RAM intensive VMs. ESX server uses this before resorting to last option - VMs SWAP memory (present as .vswp file). This value should be nearer to 0.

Check the swap write (SWW /s ) and swap read (SWW /r). These need to be nearer to 0. If they show a significant MB/s then the VM is not having enough RAM.

The memory overhead required to maintain each virtual machine is displayed by the OVHD counter. This is dependent on memory, vCPUs, 32 or 64 bit OS of virtual machine. Its good to have these values as low as possible.

--> For Disk related:

QUED - lists the number of queued commands that the host will process after commands in 'ACTV column' have finished. This should be as low as possible.

LOAD - its ratio of "no. of commands that are active or queued" to the "total no. of commands that can be active or queued at one time". This should be nearer to 0.0

%USD - counter provides the percentage of the queue depth used by VMkernel active commands. Thresholds should be around 0-10.

GAVG /cmd - total latency seen from a virtual machine to the array – Sum of 'hardware (HAVG)' and 'kernel (KAVG) latency'. GAVG around 0 - 25 is fine (this changes from local to SAN)

ABRTS /s - Aborted commands per second. – this should be near 0.

--> For Network related:

Things that need to be checked are, Transmitted data (MBTX /s) and Received data (MBRX /s). These values will be high if network usage is high.
Apart from above values, when usage is at saturation level some packet dropping while sending and receiving may be observed. These dropped packets can be checked using DRPTX /s (sending) and DRPRX /s (receiving), their values should be 0 or near to it.

For more info, on other parameters and also on how to use ESXTOP, check below links-
http://www.yellow-bricks.com/esxtop/
http://communities.vmware.com/docs/DOC-5240

Happy Virtualizing....

Note: These are my views... :-)


Tuesday, May 11, 2010

check cronjobs run by all users

how to check the cronjobs run by all users in a linux server?

below command would help::

for i in `cat /etc/passwd | cut -f 1 -d ':'`; do echo -n "$i: "; crontab -l -u $i; done;

cheers..

Tuesday, April 27, 2010

Install and use PowerCLI

VMware vSphere PowerCLI is a powerful command line tool that lets you automate all aspects of vSphere management, including network, storage, VM, guest OS and more. PowerCLI is distributed as a Windows PowerShell snapin, and includes more than 150 PowerShell cmdlets.
This scripting tool is gaining popularity day by day because of its easy to use architecture and it equips administrator who are good at scripting to manage their environments the best way.

Softwares needed:

1. Powershell
2. vSphere PowerCLI -4.0

Installation of PowerShell on windows box is pretty easy. But with PowerCLI you may face certain issue post installtion which are discussed below.
Note: My Post is based on installation in Vista and I will be discussing issue specifically in that regard.

Issues during Installation and configuration of PowerCLI:

A) In Vista, While installation of PowerCLI a warning might be issued regarding the “ execution policy for running Power CLI”.



Solution: proceed by clicking continue, this warning is taken care after installation.

B) After installation of PowerCLI and before you start using change the execution policy from “Restricted” to “Remote Signed”. Otherwise even if you open the PowerCLI prompt you won’t be able to work on it. It will fail with below error in red…



Solution: Open PowerShell console as administrator (right click on PowerShell icon and select run as administrator)
Enter the command: Set-ExecutionPolicy RemoteSigned

Note: If you run as normal user this won’t work and will throw permission error.

After running above command you can use PowerCLI console by running cmdlets/commands to manage your vSphere environment.

Eg:> Connect-VMServer

Now try running the above command in PowerShell console….I don’t want to have two consoles one for PowerShell and another for PowerCLI so I have decided to have PowerCLI used from PowerShell Console itself. For that we need to add the PowerCLI snap-in to PowerShell which is achieved by running the below command in PowerShell.

D:/>get-pssnapin -registered | add-pssnapin –passthru

This will check all the registered snap-ins on PowerShell and add any new ones, in our case PowerCLI snap-in.
Now you should be able to run all the PowerCLI cmdlets from PowerShell itself.

But this addition is not persistant and once you close the powershell console and open a new one you have to run the above command again...
I googled a little bit and tried a trick of windows which worked.

Below steps can help in making the addition of snap-in permanent.
1. open powershell console
2.add powercli snap-in using command " get-pssnapin -registered | add-pssnapin –passthru "
3.now export the console configuration to a file by running below command.
export-console
a config file with the mentioned name will be created in the current directory.
4.now right click on powershell application icon --> open "Properties" --> select tab "shortcut"
5.Edit the lines in "target" section with
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -psconsolefile C:\Users\prudhvi\file_name.psc1
Note: filename should be specified with full path.
6. Click 'ok'

From now onwards whenenver you opent the Powershell console its comes added with PowerCLI.

My intention of providing this info is to help people who like me are beginners and also facing similar problems that i bumped into. Hope the above info was helpful to kick off with PowerCLI

Keep following this page as i'll be updating this post while i learn more about PowerCLI and use it more in my VMware Environment...

Happy Virtualizing....
-
Penguin ;)

Friday, April 23, 2010

Friday, January 22, 2010

Update an ESX server with VUM

Vmware update manager (VUM)

I've recently worked on VUM for one of my clients and I thought of sharing experiences here as it might be useful to people out there who may work in near future....

Let me describe the setup on which i have tried VUM. My client runs 36 ESX servers (OS ver-3.5 update 4) over 4 clusters and 1 Virtual Center 2.5 with a licence to implement HA and DRS on all 4 clusters. VUM 1.0u2 version is installed on VC server and a plugin is installed to access from VI client. This should give you an idea of our setup.

Now let me tell a small story of why we wanted to update our esx server to 3.5 update5. Sometime back our esx servers frequently started reporting HA errors and we also found there were process threads stuck in ESX server that were eating all service console memory. To resolve this issue we increased our service console memory but that too didnt help us :( .
So we contacted VMware support and their advice was to upgrade to update5 which should solve this type of HA errors. (End of story ;)

VUM:

Regarding VUM, its a nice tool for admins like me who are lazy to sit and do all steps like putting ESX in maintenance mode, install updates, reboot etc. The GUI makes the VUM easy to use because once VUM is installed an additional tab is added to the ESX server in VI client and also you see option like "scan for updates and remediate" if you right click on any ESX server. The update manager gives information whether the ESX server is compliant or not.
What VUM does while remediating an ESX host?
It migrates the VMs in an ESX host, puts it in maintenance mode, installs updates, reboots host, brings out of maintenance mode and re-checks for compliance. All these steps are done during successfull remediation.

We created a ESX_upd5 baseline and added the update5 that was downloaded by VUM from vmware site. Next we attached the created ESX_upd5 to the cluster


Now proceeded to remediate hosts in this prod cluster which were non-compliant with ESX_upd5 baseline. Its simple just right click on ESX server and select remediate task, a window showing the attached baseline and the updates shows up click finish and remediation of host begins.
But there are few things that i've noticed while using VUM which i feel could make the usage a pleasant experience.
  • Make sure you have configured the baseline with exact updates that you want to install because its very critical and most important task while configuring baselines.
  • For VUM to migrate VMs before putting the host in maintenance mode the DRS on cluster should be set to "fully automated" or else VMs will not be migrated.
  • When VUM is migrating a VM it locks all possible options you can use like disable "edit settings ", "install vmware tools" etc. Only possible things you can do are poweroff, migrate and storage migration.
  • When VMs are not being migrated using VUM you could try to manually migrate VMs by resolving vMotion failure issues. If that is also not possible then we need cancel remediation task solve the issue then restart remediation task.
  • Dont forget to check the P2V'ed VMs where cdroms, serial ports are left enabled by mistake. They are the VMs that can waste ur time...
These issues may look silly but they can seriously extend the maintenance time (which I hate ). I mean imagine this .. you scheduled remediation task on host and next morning when you come the task is still progress just because one VM didnt migrate....
Dont worry there is an alternative to this problem, In VUM configuration tab there is an setting called ESX host settings->failure response..
It has 4 options :

fail task: if VM migration fails VUM will fail the task and report error in VC logs
retry: if VM migration fails, VUM will retry after mentioned time.
Poweroff and retry: If VM migration fails, VUM will power off the VM and retry migration
suspend and retry: If VM migration fails, VUM will suspend the VM and retry

3rd option can help in solving the problem but I wouldnt do that on production cluster but 4th option is a safe bet to use if you have approval for downtime.

This concludes my narration of date with VUM. Till now i have updated 2 of 4 clusters and will be doing the remaining soon. If any new issues happen i shall update this post.
Happy virtualizing....

Thursday, August 6, 2009

i wrote script to wish when u login!!!

First post.... :)
most of unix admins use putty to login, so when they login this thing wishes...
cool thing in this is it actully adjusts to the terminal size and prints at the center of the screen.. here it goes....

#!/bin/bash
#Author: Prudhvi raj
# Print greetings during login of user
########################################################
#funtion to print the greeting word by word
greet()
{
string=$1
tput clear
#echo -e " \c"
rows=`tput lines`
columns=`tput cols`
strng_len=`echo -n $string | wc -c`
indent=$(( ($columns / 2) - ($strng_len / 2) ))
verti_pos=$(( $rows / 2 ))
timevalue=`date +%S`
tput cup $verti_pos $indent
for(( i=1; i<=$strng_len; i++ ))
do
val=`echo $string | cut -c$i`
echo -e "$val\c"
usleep 100000
done
echo " "
}

#######################################################

n=`date +%H%M`

if [ $n -ge 0600 ] ;
then
if [ $n -le 1200 ] ; then
greet "Good morning `logname`"
else
if [ $n -le 1600 ] ; then
greet "Good afternoon `logname`"
else
if [ $n -le 2200 ] ; then
greet "Good evening `logname`"
else
greet "`logname` Go home!!!!!"
fi
fi
fi
else
greet "`logname` Go home!!!"
fi

#######################END###############################

Tuesday, August 4, 2009

First Post

{Where, what and how} do i start??
are the questions that are running in my mind now. Lets see how wil this thing go...