Saturday, July 12, 2014

Gift from Tintri to vExperts 2014


Few days back I received one parcel from Fedex after opening it I found Nike Tshirt my name on it with vExpert logo, I would like to thanks Tintri for the generosity sending TShirt on becoming vExpert 2014. 


Tintri Zero Management Storage™ helps IT organizations eliminate storage complexity and minimize costs for their virtualized environments. Designed from the ground up for virtualization and cloud, Tintri addresses the mismatch between storage and virtualization with the industry’s first and leading VM-Aware Storage architecture.  With intelligence that understands virtual machines and keeps storage always optimized, Tintri VMstore improves performance by as much as 10x, makes virtualization predictable and enables higher IT productivity—all while slashing costs. Production-proven in hundreds of global enterprises, Tintri helps businesses and organizations worldwide maximize their virtualization investments.
Check out more at http://www.tintri.com

Wednesday, July 9, 2014

VMware Networking 101: VMware Network Load Balancing policies – Part 1



Route based on originating virtual port ID: Policy works like as similar as Round Robin technic. Let’s suppose you have multiple VMs on vswitch and that vswitch having only 2 physical nic cards assigned. Here VM1 will get vmnic0, VM2 will be on vmnic1 after VM3 will get mapped to vmnic0 and so on.

If we look at the pros, you don’t have to configure any special configuration at physical network side, it puts zero load on esxi. This is default setting.

Con of this policy is, it’s not aware of the physical NIC card load. As an example I have seen one of the bad design of having 2 physical NIC with different speed 10Gig and 1Gig attached to vSwitch using Route based on originating virtual port as load balancing, there might be a chance your heavy traffic vms get mapped to 1 GBps NIC and 10 GBps NIC is sitting idle (getting mapped idle vms).

Traffic of the VMs will not exceed the underlying mapped NIC speed. If my 5 VMs start utilizing more than 200 MB (mapped to 1 GBPS NIC), this policy will not load balance traffic to other NIC.




Route based on source MAC hash: It is little bit similar to Route based on originating virtual port but the calculation is done on the algorithm of Mac hash value.


Route Based on IP Hash: This policy uses source and destination IP to determine on which physical NIC traffic will be send. It knows the best path to send traffic on and it is unaware load on the link.

This policy is complex compared to other policies, if not implemented correctly might cause 1 link saturated completely and other is sitting idle. To implement this policy you will have to configure Etherchannel (802.3(AD) Link aggregation) on the Physical switch. Beacon probing cannot be used with policy as all links are in Etherchannel and considered as single link. 




Route Based on physical NIC load: This is my favorite load balancing policy, it is only available on Distributed vSwitches. In the initial works as same as Route based on originating virtual port ID, maps vm port to physical NIC but as soon as it detects Physical NIC load reaches threshold of 75% over 30 Sec, it load balances traffic to another less saturated Physical NIC.



Explicit failover order: In this policy you are defining the active NIC and standby NIC. Generally speaking it in not doing any kind of load balancing. Standby will be used only when the active NIC fails. As earlier I gave bad design example in the Originating virtual port ID, you can correct it with this policy keeping 10 GBps in active and 1 GBps as standby.

VMware Networking 101: VMware Network Load Balancing policies – Part 1
VMware Networking 101: VLAN handling in vSwitches – Part 2
VMware Networking 101: Network Failure Detection – Part 3
VMware Networking 101: vSwitches or PortGroup Security Settings – Part 4
Disclaimer:

This is a personal weblog. The opinions expressed here represent my own. If you find any correction need to be done or anything inappropriate, Feel free to comment on the post.

Thursday, June 12, 2014

VCP5-DCV Vmware Certified Professional - Data Center Virtulization on vSphere 5.5 Study Guide Exam VCP-550 review




I received my new book VCP5-DCV Vmware Certified Professional - Data Center Virtulization on vSphere 5.5 Study Guide Exam VCP-550.


It is around 800 pages. After going through most of chapters  found this is so very well written and well explained. I impressed with the quality of the book, your concepts will become full proof after reading.




Book has good graphics, which help to properly understand GUI part. I recommend this book as must read if anyone preparing for VCP exam as well as someone who is looking for Real-world Scenarios, looking for job roles.


This book is written by Brian Atkinson he is Vmware vExpert since 2009 And moderator and very well known in vmware community.


You will not regret buying this book.

Go to www.sybex.com/go/vcp5 and download a full set of electronic test prep tools to help you thoroughly prepare for the exam. These include:

  • Custom Test Engine
  • Over 300 Sample Questions
  • Electronic Flashcards
  • Glossary of Terms in PDF
Purchase a copy


Book's insight:

Chapter 1 What’s New in vSphere 5.5

Chapter 2 Planning, Installing, Configuring, and Upgrading VMware ESXi and vCenter Server

Chapter 3 Securing vCenter Server and ESXi and Identifying vSphere Architecture and Solutions

Chapter 4 Planning and Configuring vSphere Networking

Chapter 5 Planning and Configuring vSphere Storage

Chapter 6 Creating and Deploying Virtual Machines and vApps

Chapter 7 Managing and Administering Virtual Machines and vApps

Chapter 8 Establishing Service Levels with Clusters, Fault Tolerance, and Resource Pools

Chapter 9 Maintaining Service Levels

Chapter 10 Performing Basic Troubleshooting

Chapter 11 Monitoring a vSphere Implementation and Managing vCenter Server Alarms

Appendix A Answers to Review Questions

Appendix B About the Additional Study Tools

Sunday, April 27, 2014

Get peak CPU, Memory, Disk, Network stats with date and time.

This script gives you the details about peak CPU, Memor, Disk, Network Stats, plus it includes date and time of the peak usage.  

Check the section to define days back."#Define how long back you want to go and check the peak time and value", 
 #####################################    
 ## http://kunaludapi.blogspot.com    
 ## Version: 1    
 ## Tested this script on    
 ## 1) Powershell v3    
 ## 2) Powercli v5.5    
 ## 3) Vsphere 5.x    
 #####################################   
 Add-PSSnapin vmware.vimautomation.core   

 # vCenter username password   
 $vCenterServer = "vCenterserver"   
 $vcenteruser = "domain\user"   
 $vcenterpasswd = "Password"   

 #connect vCenter Server   
 Connect-VIServer -Server $vCenterServer -User $vcenteruser -Password $vcenterpasswd   
 $Result = @()  
 $metrics = "cpu.usage.average", "mem.usage.average", "disk.usage.average", "net.usage.average"  
 $vms = Get-VMHost | Get-VM | Where-Object {$_.PowerState -eq “PoweredOn”}  

 #Define how long back you want to go and check the peak time and value.
 $start = (Get-Date).AddDays(-7)  
 $finish = (Get-Date).AddDays(-6) 
 
Foreach ($vm in $vms) {  
   $AllStats = Get-Stat -Entity $vm -Stat $metrics -MaxSamples ([int]::MaxValue) -Start $start -Finish $finish -IntervalMins 5   

   #vCPU calculations   
   $CPUStats = $AllStats | Where-Object {$_.Metricid -eq "cpu.usage.average"} | Measure-Object -Property Value -Maximum | Select -ExpandProperty Maximum  
   $RoundCPUStats = [math]::Round($CPUStats)  
   $CPUStatsDate = $AllStats | Where-Object {$_.Metricid -eq "cpu.usage.average" -and $_.value -eq $CPUStats} | Select-Object -ExpandProperty Timestamp  

   #Memory calculations   
   $MemStats = $AllStats | Where-Object {$_.Metricid -eq "mem.usage.average"} | Measure-Object -Property Value -Maximum | Select -ExpandProperty Maximum  
   $RoundMemStats = [math]::Round($MemStats)  
   $MemStatsDate = $AllStats | Where-Object {$_.Metricid -eq "mem.usage.average" -and $_.value -eq $MemStats} | Select-Object -ExpandProperty Timestamp  

   #Disk calculations   
   $DiskStats = $AllStats | Where-Object {$_.Metricid -eq "disk.usage.average"} | Measure-Object -Property Value -Maximum | Select -ExpandProperty Maximum  
   $RoundDiskStats = [math]::Round($DiskStats)  
   $DiskStatsDate = $AllStats | Where-Object {$_.Metricid -eq "disk.usage.average" -and $_.value -eq $DiskStats} | Select-Object -ExpandProperty Timestamp  

   #Network calculations   
   $NetStats = $AllStats | Where-Object {$_.Metricid -eq "net.usage.average"} | Measure-Object -Property Value -Maximum | Select -ExpandProperty Maximum  
   $RoundNetStats = [math]::Round($NetStats)  
   $NetStatsDate = $AllStats | Where-Object {$_.Metricid -eq "net.usage.average" -and $_.value -eq $NetStats} | Select-Object -ExpandProperty Timestamp  

   $Obj = New-Object PSObject  
   $Obj | Add-Member -MemberType NoteProperty -Name "VMName" -Value $vm.Name  
   $Obj | Add-Member -MemberType NoteProperty -Name "Date_MaxUsage_vCPU" -Value $CPUStatsDate[0]     
   $Obj | Add-Member -MemberType NoteProperty -Name "vCPU_Usage_Max(%)" -Value $RoundCPUStats[0]  
   $Obj | Add-Member -MemberType NoteProperty -Name "Date_MaxUsage_Mem" -Value $MemStatsDate[0]  
   $Obj | Add-Member -MemberType NoteProperty -Name "Mem_Usage_Max(%)" -Value $RoundMemStats[0]  
   $Obj | Add-Member -MemberType NoteProperty -Name "Date_MaxUsage_Disk" -Value $DiskStatsDate[0]  
   $Obj | Add-Member -MemberType NoteProperty -Name "Disk_Usage_Max(KBps)" -Value $RoundDiskStats[0]  
   $Obj | Add-Member -MemberType NoteProperty -Name "Date_MaxUsage_Net" -Value $NetStatsDate[0]  
   $Obj | Add-Member -MemberType NoteProperty -Name "Net_Usage_Max(KBps)" -Value $RoundNetStats[0]  
   $result += $Obj   
 }  

 $result | Export-Csv -NoTypeInformation -Path C:\temp\Stats.csv  
Result should look like this

Configuring and testing SNMP traps in esxi server



I am fond of and very comfortable with powercli when doing activities on vsphere environment, but this time I thought let’s try vsphere cli for as a automation tool. My monitoring team asked to configure SNMP on all esxi servers in my organization, I generally follow vmware kb http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1008065 and found I will require to use vsphere cli for the same (It is possible to configure SNMP from Powercli as well I have posted the script in the end)

What is SNMP - is a standard protocol for network monitoring and network devices management. Almost all active network devices support SNMP. Moreover, SNMP is supported by the majority of operational systems and by many network applications.

I downloaded and installed vsphere cli from http://my.vmware.com


Once you open the command prompt for vsphere cli, change the directory to bin, if you dir you will find Perl scripts.

Below command shows current SNMP configuration on the esxi server

Vicfg-snmp.pl --server 192.168.33.21 –username root –password Computer@1 --show

This will set snmp server settings on the esxi server

Vicfg-snmp.pl --server 192.168.33.21 –username root –password Computer@1 –t 192.168.33.40@161/vcloud -c vcloud -E
 
In the screenshot I already have mentioned what the parameters are

Final show command to view the configured settings.




How do you quick test SNMP whether setting or working or not?
Here I have downloaded snmpwalk tool from http://www.snmpsoft.com/freetools/snmpwalk.html and extracted to one of windows server in the network


Open command prompt on the server and run the utility with parameters. Good help is available about the tool.




snmpWalk.exe –r:192.168.33.21 –c:vcloud

-r:192.168.33.21 = esxi server where settings are configured
-c:vcloud = Community string.

If everything is fine it will get response from the esxi server.
(In the case you are using linux run command snmpwalk -v2c -c rageesx 192.168.33.21)




On the esxi server you can verify connection success 




Configuring SNMP on esxi host with powercli
Run get-vmhostsnmp to fetch information



And below screenshot command will set the configuration.


If you have lots of esxi server and want to automate it (esxi server with same password), you can use below script to automate on all esxi servers.

Add-PSSnapin vmware.vimautomation.core
$root = "root"
$password = "Password"
$Listofesxi = "esxi001.vcloud.lab", "esxi002.vcloud.lab", "esxi003.vcloud.lab"

foreach ($esxi in $Listofesxi) {
    Connect-VIServer $esxi -User $root -Password $password
    Set-VMHostSnmp (Get-VMHostSnmp) -ReadOnlyCommunity vcloud -Enabled $true
    Disconnect-VIServer * -Confirm $false
}