«

»

Dec 10 2012

PowerShell Module for (NVP) Nicira Network Virtualization Platform

Advertisement

The network virtualization concept of decoupling the logical networking from the physical networking much like in the same way server virtualization de-coupled the operating systems and software from the physical server hardware is permeating IT organizations.

NVP creates an intelligent abstraction layer between hosts and existing networks. Managed by a distributed controller system this intelligent edge transforms the physical network into a pool of network capacity and enables the programmatic creation of tens of thousands of isolated virtual networks to connect workloads in your cloud.

Why am I writing about NVP when I mostly write about EUC/VDI?

I have recently been asked to look at how would be possible to automatically add VMware View virtual desktops into the NVP Controller Cluster. The NVP Controller Cluster is a highly available distributed system that manages all the virtualized network components and connections. The Controller Cluster exposes a RESTful web services API and defines virtual networks.

Besides the known benefits of network virtualization such as dramatically reducing the complexity of the physical network, and creating shared pool of network capacity that can be consumed and repurposed on demand; with the right storage replication technology in place, network virtualization for virtual desktops enables organizations to move desktop workloads dynamically across datacenter boundaries.

As you may be aware VMware View only provide PowerCLI mechanisms for remote management. Whilst I cannot yet provide details on the integration methods utilized, I am able to share a generic PowerShell module I have created to operate the NVP Controller Cluster. This module is not specific for virtual desktops and may be used for any vCenter based virtual machine.

There are 4 cmdlets to be known in order to add a vCenter virtual machine into the NVP Cluster:

  • Connect-NVP:  Establish connectivity to NVP API. Must be associated to $variable for session persistence (cookies).
  • Query-NVPlSwitch: Return the lSwitch UUID. lSwitch UUID is required for other operations. The lSwitch must be created first.
  • New-NVPLogicalSwitchPort: Create a logical switch port for the virtual machine.
  • Add-NVPVMVIFtoLogicalPort: Attach a virtual machine VIF to the logical lSwitch port.

The PowerShell module below uses PowerShell 3.0 and VMware vSphere PowerCLI.

The module is available to download here.

Example:

Import-Module -Name nvp_module.psm1
$nvpSession = Connect-NVP -nvpIPAddress "x.x.x.x" -nvpusername "admin" -nvppassword "password"
$lswitch = Query-NVPlSwitch -nvpSession $session -nvpIPAddress "x.x.x.x" -nvplswitch "switch_name"
$lport = New-NVPLogicalSwitchPort -nvpSession $session -lSwitch_uuid $lswitch -vmname "vm_name" -nvpIPAddress "x.x.x.x"
Add-NVPVMVIFtoLogicalPort -nvpSession $session -lswitch_uuid $lswitch -lPort_uuid $lport -vmname "vm_name" -nvpIPAddress "x.x.x.x" -PowerOnVM

This article was first published by Andre Leibovici (@andreleibovici) at myvirtualcloud.net.

Similar Posts:

Permanent link to this article: http://myvirtualcloud.net/?p=4210

3 pings

  1. Nicira By VMware Layer 2 Gateway Use Cases • Chris Colotti's Blog

    [...] for other difficult network configurations to happen.  It will tie into the PowerCLI work done by Andre Leibovici that he posted about a little while ago.   I hope to work with him more on refining the scripts [...]

  2. Technology Short Take #29 - blog.scottlowe.org - The weblog of an IT pro specializing in virtualization, storage, and servers

    [...] Leibovici has a brief write-up on the PowerShell module for the Nicira Network Virtualization Platform (NVP). Interesting [...]

  3. Technology Short Take #29 | Strategic HR

    [...] Leibovici has a brief write-up on the PowerShell module for the Nicira Network Virtualization Platform (NVP). Interesting [...]

Leave a Reply