VMware Cloud Community
ajaymedidi
Contributor
Contributor

create virtual machine port groups on dvswitch from command line

Hi ,

We are using Vsphere 4.1. We have around 25 Virtual machine port gruops Need to be configured for each ESX Server(not Esxi).

I am trying to create virtual machine portgroup on dvSwith from the command line but don't know the command and syntax to do that.

I have some experience configuring esx networking from the command line but that is for Standard Switches not for dvSwitches.

Please help.

Thanks.

AJ

Tags (3)
0 Kudos
3 Replies
djciaro
Expert
Expert

You can use PowerCLI with the command  New-dvSwPortgroup

here is a great guide:  http://www.lucd.info/2009/10/12/dvswitch-scripting-part-2-dvportgroup/

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!
0 Kudos
ajaymedidi
Contributor
Contributor

Hi djciaro,

Thanks for your reply. I have checked this site before. But it is really hard to understand the code as I am a beggener to power shell/powercli scripting.

Instead of looking at this, I was trying to work with newly introduced vmware dvswitch cmdlets for powercli.

My requirement is simple.

I need to create a dvport group (virtual machine port group) on a dvswitch.

searching for the simple alternatives for now.

Anyway I will try to understand Lucd scripting for dvswitches.

Thanks for your suggestions.

AJ

0 Kudos
djciaro
Expert
Expert

why not simply create your port group via the vSphere client connected to your vCenter?

anyway to create from powerCLI you would use New-VdsDistributedPortgroup

example

#Create new DVPortgroup with referenceDVPortgroup:

New-VdsDistributedPortgroup -Name MYVMNWPORTGROUP -Vds $vds -ReferenceDVPortgroup $dvpg

ref: http://blogs.vmware.com/vipowershell/2011/11/vsphere-distributed-switch-powercli-cmdlets.html

2011/11/27 ajaymedidi <communities-emailer@vmware.com<mailto:communities-emailer@vmware.com>>

VMware Communities<http://communities.vmware.com/index.jspa>

create virtual machine port groups on dvswitch from command line

reply from ajaymedidi<http://communities.vmware.com/people/ajaymedidi> in VMware ESX™ 4 - View the full discussion<http://communities.vmware.com/message/1870348#1870348

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!