Open tim-ireland opened 7 years ago
Hi @tianhao64, would you be able to tell me if there is a transaction/rollback mechanism in place that would mitigate a loss of connection in the middle of a pyvmomi update to configuration? In this case, modifying a vim.dvs.VmwareDistributedVirtualSwitch.ConfigSpec
. Or is it actually possible to corrupt a configuration if a connection is lost mid-update?
Thanks!
@tim-ireland There is no tranaction/rollback mechanism AFAIK. We released the task.py in pyVim package. Do you want to give that file a try?
maybe I wrong but, problem must be in urllib3 when you try to connect not safe cert in your esxi host:
Environment:
vCenter 6.5 pyVmomi 6.5 vconnector (0.4.6) Python 2.7.13
I have a script which connects to vCenter and updates the discovery protocol settings on all dvSwitches.
Here is a snippet that illustrates what the code is doing. Basically it finds dvSwitches that need updates and then it creates a new
LinkDiscoveryProtocolConfig
and sets the protocol toProtocolType.lldp
, and then it updates the dvswitch with the new configuration.The
vsphere_utils.wait_for_task
is implemented as:I am investigating an issue where this code resulted in the dis-association of a set of Physical NICs from the active interfaces associated with the Dv_uplinks on a dvswitch. I don't see how that could occur based on the data model, but I am curious about the failure mode for
ReconfigureDvs_Task
method. During the execution, the code received the following exception:My theory is that the DNS configuration changed on the host while this
ReconfigureDvs_Task
was in progress, and that resulted in the HTTPSConnectionPool to fail to make additional connections. My primary question is what will happen to vSphere if this happens? Is there a transactional rollback mechanism that will undo any of the changes thatReconfigureDvs_Task
initiated, or will this potentially leave the system in a mis-configured state?I found a similar issue HERE with requests/urllib3 HTTPSConnectionPool related to file descriptors, yet the error:
[Errno -2] Name or service not known
in this case suggests DNS resolution errors.