Update the WMI Script handling Hyper-V friendly port names
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 8 Oct 2014 17:05:02 +0000 (20:05 +0300)
committerBen Pfaff <blp@nicira.com>
Wed, 8 Oct 2014 17:51:31 +0000 (10:51 -0700)
commit8d0ba416d45a2bd679d4677ba636f6f769cd9cf3
treefba702630fa9011e7f92e1fdca689fd7314b8243
parentef31e854e70134a051cb12ab7daa46ba72e25b88
Update the WMI Script handling Hyper-V friendly port names

This patch ensures that the friendly port name has no more than 16 characters
and also if it is not in use.

The method which checks the WMI jobs has been updated in order to provide
relevant error codes/descriptions.

Methods retrieving the according VM and VM network adapter mapped to an OVS
port have been added as well. They are called:
Get-VMNetworkAdapterByOVSPort
Get-VMByOVSPort

Example of usage:
 2 import-module .\OVS.psm1
 3 $vnic = Get-VMNetworkAdapter test_2_1
 4 $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-1
 5 $vnic[1] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-1
 6 $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-2
 7 $vnic[1] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-1
 8 Get-VMNetworkAdapterByOVSPort ovs-port-1
 9 Get-VMByOVSPort ovs-port-2

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
datapath-windows/misc/OVS.psm1