Dell Equallogic Update

Stop the press… this is a must read from Cormac Hogan..
Describes what we were seeing and still are seeing to a degree with HA or aam process locking up now. So we dont get a host not responding but the issue has moved from complete disaster to just a broken HA for the cluster. To fix often a hostd process restart is needed and occasionally a full reboot of the vsphere host.. This is still on esxi 4.1 with the latest build.

With the changes done in the above link we have reduced our issue significantly. Yes we still get the disconnect and reconnect but at less of a rate.
With the aid of splunk I found that we are getting volume moves (autoteiring) about 4 – 5 times a day on high load days however averaging about 2-3 a day (did not realise it was moving so much data).

So with the slices of cheese constantly moving the mouse occasionally simply has to open its mouth and bite….. okay a bit off track there.

When a slice moves from member to member we will see the disconnect and reconnect or close and successful login through splunk.
This is expected behaviour and this is what both VMware and Dell say to ignore, the question is whether you are seeing excessive entrys and whether they line up to what is occuring underneath as in slices moving.
If you find that they do line up, then you have done everything you can, do as VMWARE and DELL suggest and if the Log Entries frustrate you then disable the alarm.

I have found some very interesting write ups about the equallogic and I hate to admit it but I am a fan, they are my second favourite SAN now.
Mainly due to the cost and ease of maintenance / setup.

Anybody still playing in the dell equallogic space I plead with you to talk to your network guys.

Jumbo frames is not always 9000. Please set your jumbo frames on your switch ports to the cisco devices max (within jumbo frames, not talking baby jumbos here).
Most cisco equip will run a 9216, this allows the SAN and ESX to talk with a 9000 packet without it being fragmented when the switch adds its overhead.
When you get your network boffins to change this also plead (buy them coffee, redbull, coke) to turn on LLDP so you can turn on DLP within the Equallogic, this will greatly / dramtically reduce your retransmissions count.

To test this, download ethereal / wireshark.

On your iscsi virtual switch (hopefully you have a seperate switch but even capturing on the vlan will be okay) create a virtual machine port group and run up either a windows guest or linux.
Set the port group to accept promisicous mode and start ethereal capture.
Or tcpdump on linux.
btw… vlan 4096 is promisicous for all vlans in vmware.. be careful with this one though as you will capture a truck load of data in a large environment.

I like to capture around 1 Million packets and have great enjoyment trying to get the same number everytime.. yes you can automate this to capture a certain amount, but hey there is no reason this cannot be fun right.

So filter for “tcp.analysis.retransmission” and see how many you get… We hit the 5000 / 1 million packets and could repeat this count constantly.
Yes you can get the graphs from the equallogic about retransmissions but are you sure you are getting the whole picture?

Sadly we are moving away from the equallogic as my team does not have the trust in it anymore, but hopefully others out there can benefit from my findings to get theirs hummming..

And in case any of you are asking my SAN Weapon of choice is the Netapp.

“You mean avamar”
“no I mean dedupe”
“yeah avamar”
“not backups, data on disk connected to esx hosts as NFS or ISCSI or FC and dedupe’d”
“Okay let me paint a picture, 100 X Window 2008 R2 servers all patched to the same level with their System drives on the same 3Tb Datastore”
“lol, why would you do that”
“because I can, now shutup and listen. Each system drive is 40Gb in size, but installed only 12Gb is consumed”
“okay go on”
“On the datastore those 100 X Windows 2008 R2 servers are consuming 40Gb of disk if thick provisioned and less if thin provisioned”
“wait what, how?”


Creating a report for all virtual environments

So this is going to be a work in progress post.. A thoughts to paper post.

Here is what I have so far.

The below code will get details from the vCenter server and populate an excel spread sheet.
The inspiration is the sydi project scripts.

#By Whackdiddy
#Manager(s) quick report

Disconnect-VIServer * -Confirm:$false

#$config = Get-PowerCLIConfiguration
#if($config.DefaultVIServerMode -eq "Single"){
# Set-PowerCLIConfiguration -DefaultVIServerMode Multiple
#Open your vCenter or ESX(i) connections
#$vclist = Read-Host 'Enter the vCenter Server Names seperated by commas: '
#foreach ($vc in $vclist){
# connect-viserver -Server $vc

#$vcentername1 = Read-Host 'Enter 1st vCenter Server Name?'
#$vcentername2 = Read-Host 'Enter 2nd vCenter Server Name if none press enter?'
#$vcentername3 = Read-Host 'Enter 3rd vCenter Server Name if none press enter?'
#$vcentername4 = Read-Host 'Enter 4th vCenter Server Name if none press enter?'
#$vcentername5 = Read-Host 'Enter 5th vCenter Server Name if none press enter?'
#$vcentername6 = Read-Host 'Enter 6th vCenter Server Name if none press enter?'
#$vcentername7 = Read-Host 'Enter 7th vCenter Server Name if none press enter?'
echo "all connected"

#Create excel COM object
$excel = New-Object -ComObject excel.application

#Make Visible
$excel.Visible = $True
$excel.DisplayAlerts = $False

#Add a workbook
$workbook = $excel.Workbooks.Add()

#Name worksheets
$serverInfoSheet2 = $workbook.Worksheets.Item(1)
$serverInfoSheet2.Activate() | Out-Null
$serverInfoSheet2.Name = 'Dashboard'

$serverInfoSheet3 = $workbook.Worksheets.Item(3)
$serverInfoSheet3.Activate() | Out-Null
$serverInfoSheet3.Name = 'Host and Datastore'

$serverInfoSheet = $workbook.Worksheets.Item(2)
$serverInfoSheet.Activate() | Out-Null
$serverInfoSheet.Name = 'VM-Guest Info'

#Create a Title for the first worksheet
$row = 1
$Column = 1
$serverInfoSheet.Cells.Item($row,$column)= 'vMachine Report'

$range = $serverInfoSheet.Range("a1","n2")
$range.Merge() | Out-Null
$range.VerticalAlignment = -4160

#Give it a nice Style so it stands out
$range.Style = 'Title'

#Increment row for next set of data

#Save the initial row so it can be used later to create a border
$initalRow = $row

#Create a header for Disk Space Report; set each cell to Bold and add a background color
$serverInfoSheet.Cells.Item($row,$column)= 'VM_Name'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM FQDN'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM IP Address'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM MAC Address'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Operating System'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Operating System Family'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'vSphere Host'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM CPU Count'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Memory'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'Custom Attrib'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Network Cards'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Disks'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Harddisk'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Harddisk used'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Harddisk free'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM VMX Location'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'VM Datastore'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48
$serverInfoSheet.Cells.Item($row,$column)= 'vSphere Notes'
$serverInfoSheet.Cells.Item($row,$column).Interior.ColorIndex =48

#Set up a header filter
$headerRange = $serverInfoSheet.Range("a3","n3")
$headerRange.AutoFilter() | Out-Null

Get-View -ViewType VirtualMachine -Property Name, Runtime.Host,Config.Hardware, Guest.Disk ,Summary, Config.Hardware , Network , Guest | Where {-not $_.Config.Template} | %{
if($ip = ($_.Guest | %{$_.IpAddress})){

$serverInfoSheet.Cells.Item($row,3) = [string]::Join(',',$ip)
if(($mac = $_.Guest.Net | %{$_.MacAddress})){

$serverInfoSheet.Cells.Item($row,4) = [string]::Join(',',$mac)
$esx = Get-View $_.Runtime.Host -Property Name,Hardware.SystemInfo.Model,Parent





$memory = $_.Summary.Config.MemorySizeMB
$serverInfoSheet.Cells.Item($row,9).FormulaR1C1=("=IF($memory<1024,($memory & "" MB""),($memory/1024 & "" GB""))")




#$hdpath = ($_.Guest.Disk | Select DiskPath)
if($Partition = ($_.Guest.Disk | %{$_.DiskPath})){

$serverInfoSheet.Cells.Item($row,13) = [string]::Join(',',$Partition)
#$serverInfoSheet.Cells.Item($Row,13) = $_.Guest.Disk | Select DiskPath
#if($Capacity = ($_.Guest.Disk | %{$_.Capacity})){

#$serverInfoSheet.Cells.Item($Row,14) = [math]::Round(',',$Capacity)
#The below line works will vmtools installed on all guests
#$serverInfoSheet.Cells.Item($Row,14) = $_.Guest.Disk | Select Capacity
#if($freespace = ($_.Guest.Disk | %{$_.FreeSpace})){

#$serverInfoSheet.Cells.Item($Row,15) = [string]::Join(',',$freespace)


#"VM Datastore (location of vmx)
$serverInfoSheet.Cells.Item($row,17).FormulaR1C1 = $Mid




$usedRange = $serverInfoSheet.UsedRange
$usedRange.EntireColumn.AutoFit() | Out-Null

$dataRange = $serverInfoSheet.Range(("A{0}" -f $initalRow),("P{0}" -f $row))
7..12 | ForEach {
$dataRange.Borders.Item($_).LineStyle = 1
$dataRange.Borders.Item($_).Weight = 1

#$serverInfoSheet.ActiveCell.FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R[-2]C[-6]:R[18]C[-6],'Dashboard'!RC[-1])"
#$serverInfoSheet.ActiveCell.FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C7:R24C7,'Dashboard'!RC[-1])"
#$serverInfoSheet.Selection.AutoFill Destination:=Range("M6:M7"), Type:=xlFillDefault
#$serverInfoSheet.ActiveChart.ChartType = xlColumnClustered
#$serverInfoSheet.ActiveChart.SetSourceData Source:=Range("L6:M7")

#$lastRow = row

#Connect to first worksheet to rename and make active
$serverInfoSheet3 = $workbook.Worksheets.Item(3)
$serverInfoSheet3.Activate() | Out-Null

$RowX = 2

Get-View -ViewType HostSystem -Property Name,Hardware | %{
#$col = 12
$serverInfoSheet3.Cells.Item(2,2)= 'vSphere Host List'
$serverInfoSheet3.Cells.Item(2,3)= 'Number of Guests'
$serverInfoSheet3.Cells.Item(2,4)= 'Vendor'
$serverInfoSheet3.Cells.Item(2,5)= 'Model'
$serverInfoSheet3.Cells.Item(2,6)= 'No. CPU(s)'
$serverInfoSheet3.Cells.Item(2,7)= 'NO. Cores'
$serverInfoSheet3.Cells.Item(2,8)= 'Memory Size GB'

$serverInfoSheet3.Cells.Item($RowX,3).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R[1]C[4]:R3389C[4],'Host and Datastore'!RC[-1])"

if($HostMem = ($_.Hardware | %{$_.MemorySize})){

$lasthostchartrange = $Rowx


$RowY = 1
Get-View -ViewType Datastore -Property Name,Summary | %{
#$col = 12
$serverInfoSheet3.Cells.Item(2,12)= 'Datastore Name'
$serverInfoSheet3.Cells.Item(2,13)= 'Size (GB)'
$serverInfoSheet3.Cells.Item(2,14)= 'Free Space (GB)'
$serverInfoSheet3.Cells.Item(2,15)= 'No. VM(s)'
if($dstoreCapacity = ($_.Summary | %{$_.Capacity})){

#$serverInfoSheet.Cells.Item($Row,14) = [math]::Round(',',$Capacity)

if($dstorefree = ($_.Summary | %{$_.FreeSpace})){

#$serverInfoSheet.Cells.Item($Row,14) = [math]::Round(',',$Capacity)

$serverInfoSheet3.Cells.Item($RowY,15).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R[1]C[2]:R[3389]C[2],'Host and Datastore'!RC[-3])"


#Connect to first worksheet to rename and make active
$serverInfoSheet2 = $workbook.Worksheets.Item(1)
$serverInfoSheet2.Activate() | Out-Null

#$chart.SeriesCollection(1).DataLabels().Position = 2
#$serverInfoSheet3.ActiveChart.ChartType = xlColumnClustered
#$serverInfoSheet3.ActiveChart.SetSourceData Source:=Range("L5:M30")

#Calculate Collected Statistics for OS Type Spread

#Build Heading
$serverInfoSheet3.Cells.Item(2,18)="GUEST OS"
#Make Bold
$headerRange = $serverInfoSheet3.Range("A1","X2")
#$headerRange.AutoFilter() | Out-Null
$headerRange.EntireColumn.AutoFit() | Out-Null

$serverInfoSheet3.Cells.Item(3,18)="Microsoft Windows"
$serverInfoSheet3.Cells.Item(3,19).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C5:R3889C5,""*Windows*"")"

$serverInfoSheet3.Cells.Item(4,19).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C5:R3889C5,""*Ubuntu*"")"

$serverInfoSheet3.Cells.Item(5,19).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C5:R3889C5,""*Red*Hat*"")"

$serverInfoSheet3.Cells.Item(6,19).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C5:R3889C5,""*Free*BSD*"")"

$serverInfoSheet3.Cells.Item(7,19).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C5:R3889C5,""*Solaris*"")"

$serverInfoSheet3.Cells.Item(8,19).FormulaR1C1 = "=COUNTIF('VM-Guest Info'!R4C5:R3889C5,""*Other*"")"

$chartRange = $serverInfoSheet3.Range(("R2:S8"))

#Chart formula
##Add a chart to the workbook
#Open a sheet for charts
$temp = $excel.Charts.Add()
$chart = $serverInfoSheet2.Shapes.AddChart().Chart

$chartRangeHost = $serverInfoSheet3.Range(("B2:C$lasthostchartrange"))
$charthost = $serverInfoSheet2.Shapes.AddChart().Chart
$charthost.ChartType = -4100
$charthost.HasTitle = $True
$charthost.ChartTitle.Text = "Host Guest Distribution"
$charthost.ApplyLayout(5) | out-Null
$charthost.ChartStyle = 48
$charthost.SeriesCollection(1).ApplyDataLabels() | out-Null
#$charthost.SeriesCollection(1).DataLabels().ShowValue = $True
#$charthost.SeriesCollection(1).DataLabels().Separator = ("{0}" -f [char]10)
#$charthost.SeriesCollection(1).DataLabels().Position = 2

#Datastore Chart
$chartRangedatastore = $serverInfoSheet3.Range(("L2:O$lastdatastorechartrange"))
$chartdatastore = $serverInfoSheet2.Shapes.AddChart().Chart
$chartdatastore.ChartType = 92
$chartdatastore.HasTitle = $True
$chartdatastore.ChartTitle.Text = "Datastore at a glance"
$chartdatastore.ApplyLayout(5) | out-Null
$chartdatastore.ChartStyle = 42
$chartdatastore.SeriesCollection(1).ApplyDataLabels() | out-Null
$chartdatastore.SeriesCollection(2).ApplyDataLabels() | out-Null
$chartdatastore.SeriesCollection(3).ApplyDataLabels() | out-Null
#$chartdatastore.SeriesCollection(1).DataLabels().Separator = ("{0}" -f [char]10)
#$chartdatastore.SeriesCollection(1).DataLabels().Position = 2

#Configure the chart for OS Type Spread
##Use a 3D Pie Chart
$chart.ChartType = 92
$chart.Elevation = 7
$charthost.Elevation = 7
$chartdatastore.Elevation = 7

#Give it some color
#$serverInfoSheet2.Shapes.Item("Chart 2").Fill.ForeColor.TintAndShade = .34
#$serverInfoSheet2.Shapes.Item("Chart 2").Fill.ForeColor.ObjectThemeColor = 5
#$serverInfoSheet2.Shapes.Item("Chart 2").Fill.BackColor.TintAndShade = .765
#$serverInfoSheet2.Shapes.Item("Chart 2").Fill.ForeColor.ObjectThemeColor = 5
#$serverInfoSheet2.Shapes.Item("Chart 2").Fill.TwoColorGradient(1,1)

#Set the location and size of the chart(s)
$serverInfoSheet2.Shapes.Item("Chart 1").Placement = 3
$serverInfoSheet2.Shapes.Item("Chart 1").Top = 30
$serverInfoSheet2.Shapes.Item("Chart 1").Left = 100
$serverInfoSheet2.Shapes.Item("Chart 1").Width = 600
$serverInfoSheet2.Shapes.Item("Chart 1").Height = 200

$serverInfoSheet2.Shapes.Item("Chart 2").Placement = 3
$serverInfoSheet2.Shapes.Item("Chart 2").Top = 240
$serverInfoSheet2.Shapes.Item("Chart 2").Left = 100
$chart2width = ($lasthostchartrange*110)
$serverInfoSheet2.Shapes.Item("Chart 2").Width = $chart2width
$serverInfoSheet2.Shapes.Item("Chart 2").Height = 300

$serverInfoSheet2.Shapes.Item("Chart 3").Placement = 3
$serverInfoSheet2.Shapes.Item("Chart 3").Top = 550
$serverInfoSheet2.Shapes.Item("Chart 3").Left = 100
$chart3width = ($lastdatastorechartrange*140)
$serverInfoSheet2.Shapes.Item("Chart 3").Width = $chart3width
$serverInfoSheet2.Shapes.Item("Chart 3").Height = 450

$chart.HasTitle = $True

$chart.ApplyLayout(5) | out-Null
$chart.ChartTitle.Text = "OS Type Spread"
$chart.ChartStyle = 42
#$chart.PlotVisibleOnly = $False
$chart.SeriesCollection(1).ApplyDataLabels() | out-Null
#$chart.SeriesCollection(1).DataLabels().ShowValue = $True
#$chart.SeriesCollection(1).DataLabels().Separator = ("{0}" -f [char]10)

#$chart.SeriesCollection(1).DataLabels().Position = 2
#$chart.SeriesCollection(1).Points(1).Format.Fill.ForeColor.RGB = 255
#$chart.SeriesCollection(1).Points(2).Format.Fill.ForeColor.RGB = 65535
#$chart.SeriesCollection(1).Points(3).Format.Fill.ForeColor.RGB = 5287936

#Hide the data
#$chartRange.EntireRow.Hidden = $True

Disconnect-VIServer * -Confirm:$false

#Connect to first worksheet to make active
$serverInfoSheet2 = $workbook.Worksheets.Item(1)
$serverInfoSheet2.Activate() | Out-Null

$serverInfoSheet2.Cells.Item(4,17).FormulaR1C1= "=""$vcentername1 "" & ""$vcentername2 "" & ""$vcentername3 "" & ""$vcentername4 "" & ""$vcentername5 "" & ""$vcentername6 "" & ""$vcentername7"""
$sheet1titlerange = $serverInfoSheet2.Range("q4","u4")
$sheet1titlerange.Merge() | Out-Null
$sheet1titlerange.Style = 'Heading 1'

#Release COM Object
[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null

So whilst this code works fine, it is a bit slower than I would like, and I would like to port to a html document rather than to excel.
But this will suffice for the moment.

vmware fury

Okay so I have a rather large green field / migration project I am working on.
So I started putting together some powercli scripts to build the environment and then thought to myself there must be a quicker way and something I can use again and again going forward.

So I created an excel spreadsheet (yeah dont cringe).
I ended up choosing excel because most people have it and it is easy to automate and drive.

So with the excel spreadsheet you work through the numbers and enter the details of your planned install.
Datacenter, Cluster, dvswitch, port groups, resource pools, top level folders, folder in folders.

The spreadsheet will format your entries into their relative powercli commands and then give you an output of all the commands.
The output you simply paste into your powercli session and sit back and watch.

Here is a vid demo that I have done so you can see it in action.
note… I have limited the cells to 500, I mean really who wants 500+ port groups anyway…

Create user on hosts

Simply copy and paste into notepad++ or equiv and save as createlocalshelluser.ps1

### There is a downside to this script, it does not create a permisson for you on the local host. As in you will not have admin permission so will not be able to interact with vmware as such. You will be able to login to shell and then sudo but that is about as far as you will be able to get.###

You may have to sign the script prior to running depending on your domain GPO settings.

ESXi Code:
#Vcenter name, can be FQDN
$vsphere = "Whackdiddy"
#User to create
$new_user = "Username"
#Password for new user
$new_user_passwd = "MyP@ssw0rd"
#Group to add user too
$new_user_grp = "root"

#local host username with rights to create local users
$root_user = "root"
#Password for local host user with rights to create local users
$root_passwd = "whackdiddy"

# Get all of the ESX servers (connect using Windows credentials)
connect-viserver $vsphere
$hosts = Get-View -ViewType HostSystem
disconnect-viserver -confirm:$false

# For each ESX server, connect and see if the new account exists.
# If it does, reset the password and ensure the account is granted shell access.
# If it doesn't, create it and add to the root group (this seems to be necessary to allow ssh login in ESX4.0)
$hosts | %{ $ } | %{
  echo $_
  connect-viserver -server $_ -user $root_user -password $root_passwd
  if ($?) {
    if (! (get-vmhostaccount | ?{ $ -eq $new_user })) {
      new-vmhostaccount -useraccount -id $new_user -password $new_user_passwd -grantshellaccess
   set-vmhostaccount -groupaccount $new_user_grp  -assignusers $new_user
 else {
   set-vmhostaccount -useraccount $new_user -password $new_user_passwd -grantshellaccess $true

 disconnect-viserver -confirm:$false "*"
ESX Code:
#Vcenter name, can be FQDN
$vsphere = "Whackdiddy"
#User to create
$new_user = "Username"
#Password for new user
$new_user_passwd = "MyP@ssw0rd"
#Group to add user too
$new_user_grp = "esxadmin"

#local host username with rights to create local users
$root_user = "root"
#Password for local host user with rights to create local users
$root_passwd = "whackdiddy"

# Get all of the ESX servers (connect using Windows credentials)
connect-viserver $vsphere
$hosts = Get-View -ViewType HostSystem
disconnect-viserver -confirm:$false

# For each ESX server, connect and see if the new account exists.
# If it does, reset the password and ensure the account is granted shell access.
# If it doesn't, create it and add to the root group (this seems to be necessary to allow ssh login in ESX4.0)
$hosts | %{ $ } | %{
  echo $_
  connect-viserver -server $_ -user $root_user -password $root_passwd
  if ($?) {
    if (! (get-vmhostaccount | ?{ $ -eq $new_user })) {
      new-vmhostaccount -useraccount -id $new_user -password $new_user_passwd -grantshellaccess
	  set-vmhostaccount -groupaccount $new_user_grp  -assignusers $new_user
	else {
	  set-vmhostaccount -useraccount $new_user -password $new_user_passwd -grantshellaccess $true

	disconnect-viserver -confirm:$false "*"

taken from jbarbers site.

200+ port groups in 5 minutes, no sweat

Okay, so exciting news and just in time.
We are doing a major migration with 200+ vlans.
When I say migration it is a green field approach with no downtime.

Powercli is now supporting dvSwitches.
Well Powercli 5.1.0-1012425 is anyway.

Can be downloaded from here

What can we do with it…


#Change the values below to what you want your hierachy to look like.
#This setting will createa a datacenter (whackdiddy), cluster (whackdiddy-cluster) and two dvswitches (dvs1-whackdiddy and dvs2-whackdiddy)
#It will then import the csv with all the vlan settings and create port groups.

$dc = "whackdiddy"
$cl = "whackdiddy-cluster"
$vds1 = "dvs1-whackdiddy"
$vds2 = "dvs2-whackdiddy"

New-Datacenter -Name $dc -Location Datacenters
New-Cluster -Name $cl -Location $dc -HAEnabled -DrsEnabled -DrsMode FullyAutomated
New-vdswitch -Name $vds1 -Location $dc -Mtu 9000 -Version 5.1.0 -contactDetails "whackdiddy" -Notes "version 5.1.0"
New-Vdswitch -Name $vds2 -Location $dc -Mtu 9000 -Version 4.1.0 -contactDetails "whackdiddy" -Notes "version 4.1.0"

Import-Csv C:\temp\whackdiddy\vlans.csv | %{
New-VDPortgroup -VDSwitch $_.Vds -Name $_.Name -NumPorts $_.UplinkPorts -VlanId $_.Vlan -Notes $_.Notes

Create a csv file with the following headings.
Place this file in c:\temp\whackdiddy\


Then we run the script in our lab environment.
The vid does not have audio, I will get around to amending this shortly.

Stripping the fat and a bit of the bacon

Okay so I have always loved the DRS rules, and find them so under utilised in almost every scenario.

So lets take this scenario on board.

1050 virtual servers spread across 30 vSphere 5.1 hosts on mixed vlans.
DRS Rules in place – none…?

Q. What would happen if we found the top talkers on the same vlans and placed them on the same hosts?
A. Well when two of the guests needed to talk to each other (provided they were on the same vlan) would talk through the virtual switch, whether standard or dv.

Q. Really?
A. Yes really, unless they need to talk to another vlan (and of course users) they would not need to go over the physical network, physical switch.

Q. What are the implications of this?
A. Well for starters you are taking load off the physical switches (yes most physical switches are designed with capacity in mind and can handle the load easily) but we can still reduce that load so if on a particular day there was a high level of traffic (Backups, Vmotion, DRS actions for example) the physical switches would simply laugh at you saying is that all you got…

Q. So what you are saying is that if I have two sql servers configured with database mirroring then the network component will simply go over the virtual switch.
A. Yes, however in the scenario you describe you would have to put a lot of faith into vmware HA. This is not something I would advise, dont get me wrong HA is awesome if you lost a fan or anything on the physical host you would most likely drop at least one packet to each sql server and there are so many applications that cannot handle a drop out to their Database. But in theory yes, a better scenario is if you had an application server that fetched data from its sql server, if you put these on the same host you would reduce network traffic to the virtual switch only.

Q. That seems like a lot of effort, are there any tools to tell me what my top talkers are and to put them in groups for me?
A. Sadly there are a number of applications out there but they are high end and whilst they may tell you what the top talkers are they will not create the DRS groups for you.

Q. Is there a better way..
A. Yes there is, you can create a DRS group via powershell. So all we need to do is sort the guests by vlan or port group name and then add all those in the same port group to a DRS group labelled as the port group name. Then we create a rule “Virtual Machines to Hosts” , vlan 202 , should run on hosts in group , clu8ter host group name.

Q. Should run on hosts in group?
A. I try never to use the Must run on hosts in group as it restricts DRS options for moving machines around, and this type of rule applies even with DRS turned off, so it can be a bit dangerous in my opinion.

Carving Cheese with a Chainsaw

Some products I tell you, frustrating or what…
Is all this logging really necessary?
This is symantec backup agent running using VACP

I must say if VDR could play nicely with tape drives I would be going down that route in a heartbeat..

This is just a vent as I was trying to consolidate, remove and create some snapshots today and the backups kicked in. This is large environment so there is no stopping backups for the night so we worked through it