Powershell script to create vsphere distributed virtual switch port groups

I used the following Powershell Powercli script to create a bunch of DVS Port Groups on a VSAN vSphere 6 cluster.  Using the command line speeds things up and eliminates minimizes the impact of human error – no more mouse clicking.
Based on the work from the following blog post – I adapted it for our environment:
Creating consistent Distributed Port Groups with PowerCLI  
I recently had to create a new vDS to replicate a standard vSwitch from another vCenter install. I wanted to create my vDS Distribute Port Groups (DPG) simply, but consistently. As I have a low number of DPGs to create, I could probably have done this manually, but scripting the creation ensures consistency. Plus, it’s a subset of PowerCLI that I wanted to familiarize myself with.
First, I created a vDS and a reference DPG through the vSphere Web Client. You can do this with PowerCLI, but you have to go down the rabbit hole of Views to touch some of the advanced settings, something that’s not well documented and would have been very time consuming for me to explore. I also didn’t mind creating the initial vDS and DPG as the visual view of the Web Client made it easy for me to verify the settings whereas a long string of PowerShell (PoSH) would have been a little more difficult to interpret.
 
 
————————-
Here is my script… it created 41 port groups with the name “VM Network 3500” and so on…
Iben Rodriguez – 2015
$vDS = “SNSJ-DSwitch”
$Reference_DPG = “DPortGroup”
$DPGs = @{
     “3500”  = “VM Network”;
     “3501”  = “VM Network”;
     “3502”  = “VM Network”;
     “3503”  = “VM Network”;
     “3504”  = “VM Network”;
     “3505”  = “VM Network”;
     “3506”  = “VM Network”;
     “3507”  = “VM Network”;
     “3508”  = “VM Network”;
     “3509”  = “VM Network”;
     “3510”  = “VM Network”;
     “3511”  = “VM Network”;
     “3512”  = “VM Network”;
     “3513”  = “VM Network”;
     “3514”  = “VM Network”;
     “3515”  = “VM Network”;
     “3516”  = “VM Network”;
     “3517”  = “VM Network”;
     “3518”  = “VM Network”;
     “3519”  = “VM Network”;
     “3520”  = “VM Network”;
     “3521”  = “VM Network”;
     “3522”  = “VM Network”;
     “3523”  = “VM Network”;
     “3524”  = “VM Network”;
     “3525”  = “VM Network”;
     “3526”  = “VM Network”;
     “3527”  = “VM Network”;
     “3528”  = “VM Network”;
     “3529”  = “VM Network”;
     “3530”  = “VM Network”;
     “3531”  = “VM Network”;
     “3532”  = “VM Network”;
     “3533”  = “VM Network”;
     “3534”  = “VM Network”;
     “3535”  = “VM Network”;
     “3536”  = “VM Network”;
     “3537”  = “VM Network”;
     “3538”  = “VM Network”;
     “3539”  = “VM Network”;
     “3540”  = “VM Network”;     
};
$DPGs.Keys | % {
     $VLAN = $_
     $DPG = $DPGs.Item($_) + ” ” + $VLAN
     New-VDPortgroup -VDSwitch $vDS -Name $DPG -ReferencePortgroup $Reference_DPG
     Set-VDPortgroup -VDPortgroup $DPG -VlanId $VLAN
}
 
Advertisements

JDSU Medusa Labs Test Tools Suite

JDSU Medusa Labs Test Tools Suite

JDSU Medusa Labs Test Tool (MLTT) Suite 6.0 is the industry’s leading application-based data and signal integrity testing solution for companies developing servers, switches, Host Bus Adapters (HBAs), Ethernet Network Adapters (NICs and CNAs), and other storage equipment for next-generation converged storage networks.

Test functions Covered:

  • data integrity
  • performance benchmarking
  • stress test
  • data corruption errors
  • undesirable device and system data pattern sensitivities
  • input/output (I/O) timeouts
  • I/O losses
  • system lockup scenarios

Test Tools Diagram

 

The Medusa Labs Test Tools Suite performs data integrity testing, generated signal quality stressing data patterns, and enterprise application simulation. The suite consists of these tools:

  • I/O Tools Pain, Maim, and Sock
    • Pain is a synchronous I/O tool designed to issue a single pending I/O per worker thread.
    • Maim is an asynchronous I/O tool that uses a single worker thread to issue multiple I/Os at once.
    • Sock is a TCP and UDP traffic generator. Each thread opens its own socket connections.
  • Catapult Test Tools Automation
    • Target discovery tool that acts as a shell for the I/O tools.
    • Passes these targets to the other Medusa Labs Test Tools for I/O testing.
    • Launch tests on remote systems and verify test results.
    • Test scripting and automation.
  • FindLBA is for use when debugging data corruption issues in tests on file systems or logical devices. It is useful in cases where the logical block address (LBA) reported in the I/O tool error logs is not accurate because the tools are not directly referencing areas of the physical media. You can use FindLBA in conjunction with a protocol analyzer to identify the actual LBA corresponding to a file offset reported by Medusa Labs Test Tools. The FindLBA tool sends a periodic “poll” of consecutive reads to a specified offset, which you can identify in a protocol trace. FindLBA is most useful when you need help finding I/O command that resulted in data corruption in a protocol trace capture.
  • GetKey is used for remote license checkouts. A system with network access to a license server can perform a license checkout for another system that does not have network access. This utility is particularly useful for temporarily using Medusa Labs Test Tools at an offsite location.

 

PDF DataSheet: http://www.jdsu.com/ProductLiterature/mltt6-ds-snt-tm-ae.pdf

A 30 day trial is available. Here are some notes on the steps to follow:

  1. Download and install the software: ftp://medusawindows:1PG6h36v@ftp.jdsu.com/
  2. From a fresh CMD prompt run PAIN.EXE – it will generate a DAT file that you have to send to get a license key back.

 

C:\Windows\system32>set
MEDUSA_MLM_ADMIN_CFG=C:\Program Fies\Medusa Labs\Test Tools\config\MedusaTools.cfg
MEDUSA_MLM_PRODUCT=1/1
MEDUSA_MLTT_INSTALL_DIR=C:\Program Files\Medusa Labs\Test Tools\
C:\Windows\system32>"\Program Files\Medusa Labs\Test Tools\bin\pain.exe"
-------------------------------------------------------------------------------
Medusa Labs Test Tools 6.0.1.148039
Copyright (c) 1997-2007, 2008-2013, JDS Uniphase Corp. All rights reserved.
PAIN 3.3.3 (win-x64) Medusa Labs Synchronous I/O Test Tool
Support: TechSupport-Medusa@jdsu.com
Built on: Thu Dec 12 18:15:53 UTC 2013
-------------------------------------------------------------------------------
Workstation name set to: GARAGESSD
Initializing license management library...
Loaded: Medusa L.E.O. module for Medusa License Management client library
LM Server: medusalabs.com
LM Port: 5033
License library initialized
Checking for existing license...
This system does not have a valid license
Attempting to checkout a license over the network for 90 days
If the license server is down or not reachable, this may take a while...
License error: Unknown socket error
Creating the license checkout request file 'C:\Program Files\Medusa Labs\Test Tools\config\GSSD.dat'...
Created the license checkout request file 'C:\Program Files\Medusa Labs\Test Tools\config\GSSD.dat'
This file may be used for proxy license checkout
STOP: Thu Jun 26 16:10:37 2014 - exit code 18 (licensing operation failure)


I’ve sent in my DAT file and am waiting to hear back from tech support with the license file now. 6/26/2014 16:35