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


snapshot removal powercli

Okay so a bit of a place holder for me, as I am sick of looking up these simple commands.

update… to take a snapshot

New-Snapshot -RunAsync -VM guest -Name snapshotname

I am in the habit of naming my snapshots with the date they were created and my username, in the description field I will put in any detailed information. So on a product release we end up with 7 and up guests with snapshots, the next day comes the cleanup process. So instead of running through every single guest we can simply run these..

First get the snapshots relative to the guests running.

Use the below code instead of the old code “Get-VM | Get-snapshot …..” as it is quicker and easier to remember.

New Code (note that the name field is first – this allows for easy copy and paste into a snapshot removal code framework)

Get-Snapshot * | Select Name, VM, SizeGB, Created | ft -au

Old Code

Get-VM | Get-Snapshot | select @{name="VM Name"; Expression={$_.vm.name}},name,created | ft -au

Then delete based on the snaphot name as it appears from the output of the above command.

Get-Snapshot * "date of snapshot-usename" | Remove-Snapshot

To suppress confirmation

Get-Snapshot * "date of snapshot-username" | Remove-Snapshot -Confirm:$false

Of course it goes without saying that if somebody else created a snapshot today with the days date that would be removed as well. You could always append your name to the start or the end and then it would be unique.

There are plenty of examples out there…



Ever so slightly ripped off

In Australia we get absolutly ripped off…

Some examples.

Microsoft Office 2013..
This is a download and a product key, and the craziest thing is you dont know if you are downloading from AU or the US.

AUD – $599

US – $399

$200 dollar profit for um nothing.?


Girls Toddlers Nike Free Run 3

AUD – $70

US – $44

But the winner of the bunch is Dell
Add a 512 SSD Hard Drive to your laptop..

AUD – $1,145.10

USD – $375.00

That is a difference of

Like really?