knife-vsphere icon indicating copy to clipboard operation
knife-vsphere copied to clipboard

Creating a VLAN/port group on a Standard vSwitch

Open mschnell42 opened this issue 8 years ago • 2 comments

Good day,

I have been using knife-sphere with quite some success. Thanks for all the work. However, I often run across older vSphere environments (that I can't re-config :-) that only use the Standard vSwitch (not the Distributed vSwitch). The docs on...

knife vsphere vlan create NAME VLAN_ID [–switch DSSWITCH]

Creates a vlan (port group on a distributed virtual switch) with the given name and VLAN ID. If you have multiple distributed switches then use the --switch option to set the switch

...only indicate support of the Distributed vSwitch.

The command knife vsphere vlan list does show me all the VLANs in my lab vCenter (across 5 clusters). But, with a little bit of experimentation, I've not gotten the knife vsphere vlan create NAME VLAN_ID [–switch DSSWITCH] command to work. I always get FATAL: No switches found.

Q1: Is there any clever naming trick (something like ClusterA:vSwitch2 or vSwitch2@ClusterA) for the DSSWITCH value that will get this command to support the Standard vSwitch?

Q2: Or is this a new feature request?

mschnell42 avatar Aug 14 '15 16:08 mschnell42

Hi, I'm pretty sure it's a different set of APIs... The code to create a DV port group is specific to distributed virtual switches. Creating a port group on a standard vSwitch looks a fair bit simpler though.

I don't have anything to test this on though. If you feel like trying to code something up, even if it's a hack, I'd be happy to help get it to a submittable state.

swalberg avatar Aug 14 '15 18:08 swalberg

Hmmm... I'm a newbie to this Chef, Ruby & knife world. With my other on-going tasks, It would take me awhile to get it complete. (And I'd anything I would create would certainly want to be well scrubbed and reviewed by more knowledgeable folks. ;-) But, in general, I'm willing to work on it... with a bit of guidance from you all.

mschnell42 avatar Aug 14 '15 22:08 mschnell42