reubenur-rahman / vmware-pyvmomi-examples

The example codes are written using the VMware official python library pyvmomi
Apache License 2.0
89 stars 60 forks source link

Getting a problem adding a virtual nic. #16

Closed jonathanmier closed 7 years ago

jonathanmier commented 7 years ago

When I use this function def add_virtual_nic(host_network_system, pg_name): from your create_vswitch_and_portgroup.py, I get an error? I created the portgroup and vswitch fine but cant add a vnic.

Error I get:

vmodl.fault.SecurityError: (vmodl.fault.SecurityError) { dynamicType = , dynamicProperty = (vmodl.DynamicProperty) [], msg = 'vpxapi.fault.NotAuthenticated.summary', faultCause = , faultMessage = (vmodl.LocalizableMessage) [] }

jonathanmier commented 7 years ago

@rreubenur any clue?

reubenur-rahman commented 7 years ago

Not sure but looks like you are messing with the "Management Network" connectivity of the Host which is causing the NotAuthenticated error !

Am I right ? If not then it needs further research ! If yes then try creating a different vSwitch and portgroup and then try to add a vnic there. Also try the method "AddVirtualNic"