Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ Related Projects
* VMware vSphere Automation SDK for Python: https://github.com/vmware/vsphere-automation-sdk-python
* Samples Project: https://github.com/vmware/pyvmomi-community-samples

Licence Error
================
If you are facing the following error: "Caught vmodl fault : Current license or ESXi version prohibits execution of the requested operation." i solved that and this fork has the solution implemented.

Have fun!
12 changes: 9 additions & 3 deletions pyVmomi/SoapAdapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,10 @@ def __init__(self,
customHeaders=None,
sessionId=None):
self._customHeaders = customHeaders
self.cookie = ""
# ESXi license fix: spoof the vSphere client cookie to bypass
# "Current license or ESXi version prohibits execution of the
# requested operation."
self.cookie = "vmware_client=VMware;"
if ns:
assert (version is None)
version = versionMap[ns]
Expand Down Expand Up @@ -1478,7 +1481,8 @@ def InvokeMethod(self, mo, info, args, outerStub=None):
status = resp.status

if cookie:
self.cookie = cookie
# ESXi license fix: keep the spoofed vSphere client cookie prefix.
self.cookie = "vmware_client=VMware;" + cookie
sessionId = SimpleCookie(cookie)[COOKIE_NAME].value
super(SoapStubAdapter, self).SetSessionId(sessionId)
if status == 200 or status == 500:
Expand Down Expand Up @@ -1598,7 +1602,9 @@ def ReturnConnection(self, conn):

def SetSessionId(self, sessionId):
super(SoapStubAdapter, self).SetSessionId(sessionId)
self.cookie = '{0}="{1}"'.format(COOKIE_NAME, sessionId) if sessionId else ""
# ESXi license fix: keep the spoofed vSphere client cookie prefix.
self.cookie = 'vmware_client=VMware;{0}="{1}"'.format(
COOKIE_NAME, sessionId) if sessionId else "vmware_client=VMware;"

# Need to override the depcopy method. Since, the stub is not deep copyable
# due to the thread lock and connection pool, deep copy of a managed object
Expand Down