[ovs-dev] [PATCH] WMI Script that updates Hyper-V friendly port names

Eitan Eliahu eliahue at vmware.com
Fri Sep 26 15:50:05 UTC 2014


Hi Alin,
Can you please add a short description of how you see this script is used in the sequence of actions to add or delete a port to the switch?
I assume that the script will set the friendly name of a port even if the port is not connected (yet), is it correct?
Thank you,
Eitan

-----Original Message-----
From: dev [mailto:dev-bounces at openvswitch.org] On Behalf Of Alin Serdean
Sent: Friday, September 26, 2014 6:20 AM
To: Nithin Raju
Cc: dev at openvswitch.org
Subject: Re: [ovs-dev] [PATCH] WMI Script that updates Hyper-V friendly port names

Hello Nithin,

Yes it works if a VM has multiple network adapters. Invocation is different though. Example for a VM with 2 network adapters:

$vnic = Get-VMNetworkAdapter test_2_1
$vnic[0]
Connect-VMNetworkAdapter -VMNetworkAdapter $vnic[0] -SwitchName external $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-1

Connect-VMNetworkAdapter -VMNetworkAdapter $vnic[1] -SwitchName external $vnic[1] | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-2 $vnic[1]

Regards,
Alin.

-----Mesaj original-----
De la: Nithin Raju [mailto:nithin at vmware.com]
Trimis: Friday, September 26, 2014 9:35 AM
Către: Alin Serdean
Cc: dev at openvswitch.org
Subiect: Re: [ovs-dev] [PATCH] WMI Script that updates Hyper-V friendly port names


On Sep 24, 2014, at 11:18 PM, Alin Serdean <aserdean at cloudbasesolutions.com> wrote:

> The following script leverage's the advantages of WMI infrastructure 
> offered in Hyper-V.
> 
> This scripts allows the user to change the 
> Msvm_EthernetPortAllocationSettingData property of a VM network 
> adapter connected to a Hyper-V Virtual Switch.
> 
> Usage:
> import-module .\OVS.psm1
> $vnic = Get-VMNetworkAdapter VM1
> Connect-VMNetworkAdapter -VMNetworkAdapter $vnic -SwitchName external 
> $vnic | Set-VMNetworkAdapterOVSPort -OVSPortName ovs-port-1
> 
> VM1 - is a VM on top of a Hyper-V
> external - is a Hyper-V Virtual Switch

hi Alin,
Will this code work if the VM has multiple adapters? It is OK if it does not, but I was just curious about it.

I'll give this a shot tomorrow.

thanks,
Nithin
_______________________________________________
dev mailing list
dev at openvswitch.org
https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=yTvML8OxA42Jb6ViHe7fUXbvPVOYDPVq87w43doxtlY%3D%0A&m=ocm6OWCWKfg6G2HklatNQ9PA1gHAXgz3eT%2BK9C%2Bpa%2BE%3D%0A&s=ff2a803be7f24dd75e2674f9a590b8f5ad6edd54ccf35c3781ef811191b7c4c2



More information about the dev mailing list