pyvmomi: vpshere connection connect.SmartConnect does not persist for longer than 15 min inactive time.
This issue is an offshoot of Issue #194 and #294 -----
My environment consists of a SAN attached to ESX host.
I am currently using pyvmomi 6.0 with Python 2.7.10 -
This is how am trying to connect to the vsphere web client (As per #294,)
import ssl
connect.SmartConnect(protocol="https",
host=self.fqdn,
user=self.username,
pwd=self.password,
sslContext=ssl._create_unverified_context())
the Test does below -
- Clone “x” VMs and power them on , in a sequence. “x” is passed as an argument to the test.
- Perform IO from each cloned VM to a common datastore provided to test as an argument.
- Take Snapshots of each clones
- Stop IO. ( this Step happens on the client host and vsphere is inactive for more than 15mins usually)
- Power off VMS and delete them
I am consistently hitting failure in Step 5 , while trying to power off the first Vm. Typical stack trace looks like this -
File “/home/usr/banalas/139895/testSW/lib/ClientHostVMware.py”, line 682, in vmPowerOff dlog.debug("Powering off " + virtualMachine.name) File “/home/usr/banalas/139895/testSW/lib/pyVmomi/VmomiSupport.py”, line 560, in call return self.f(args, *kwargs) File “/home/usr/banalas/139895/testSW/lib/pyVmomi/VmomiSupport.py”, line 383, in _InvokeAccessor return self._stub.InvokeAccessor(self, info) File “/home/usr/banalas/139895/testSW/lib/pyVmomi/StubAdapterAccessorImpl.py”, line 47, in InvokeAccessor raise objectContent.missingSet[0].fault vim.fault.NotAuthenticated: (vim.fault.NotAuthenticated) { dynamicType = , dynamicProperty = (vmodl.DynamicProperty) [], msg = ‘’, faultCause = , faultMessage = (vmodl.LocalizableMessage) [], object = ‘vim.VirtualMachine:vm-1050’, privilegeId = ‘System.View’
I ve also seen pyvmomi/SoapAdapter.py having CONNECTION_POOL_IDLE_TIMEOUT_SEC =900 secs which is 15 mins.
Is this the reason for my consistent failure? Can I try using a new connection to the vsphere before the power off task? How do I ensure the vsphere connection instance can be tolerant of idle timeouts > 15 mins and not hit vim.fault.NotAuthenticated.
Please suggest how to resolve this issue.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 32 (22 by maintainers)
Commits related to this issue
- Support additional kwargs upon login This will allow, among other things, to control connectionPoolTimeout (vmware/pyvmomi#491) and prevent timeout for automation execution and other long operation, ... — committed to yaelmi3/infi.pyvmomi_wrapper by yaelmi3 4 years ago
- Add SmartStubAdapter support to avoid vim.fault.NotAuthenticated exception in case of idle timeouts. This is according to solution specified here: https://github.com/vmware/pyvmomi/issues/347 — committed to yaelmi3/infi.pyvmomi_wrapper by yaelmi3 4 years ago
- Add SmartStubAdapter support to avoid vim.fault.NotAuthenticated exception in case of idle timeouts. This is according to solution specified here: https://github.com/vmware/pyvmomi/issues/347 — committed to Infinidat/infi.pyvmomi_wrapper by yaelmi3 4 years ago
- Finished Release vpatch * develop: Add SmartStubAdapter support to avoid vim.fault.NotAuthenticated exception in case of idle timeouts. This is according to solution specified here: https://github.... — committed to Infinidat/infi.pyvmomi_wrapper by deleted user 4 years ago
Hi team, do you merge the fix to 6.5 version? I used the pyVmomi6.5 still the issue and found the timeout is 900s. CONNECTION_POOL_IDLE_TIMEOUT_SEC =900