You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I used vmware_vm_shell to execute shell command on a VM, another VM was deleted and caused vmware_vm_shell failed.
ok: [localhost] => {
"changed": false,
"failed_when_result": false,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible-tmp-1616384002.2108204-3887-78505575399347/AnsiballZ_vmware_vm_shell.py\", line 102, in <module>\n _ansiballz_main()\n File \"/tmp/ansible-tmp-1616384002.2108204-3887-78505575399347/AnsiballZ_vmware_vm_shell.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/tmp/ansible-tmp-1616384002.2108204-3887-78505575399347/AnsiballZ_vmware_vm_shell.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_vm_shell', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 95, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_shell.py\", line 364, in <module>\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_shell.py\", line 360, in main\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_shell.py\", line 235, in __init__\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware.py\", line 222, in find_vm_by_id\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware.py\", line 241, in find_vm_by_name\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware.py\", line 138, in find_object_by_name\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 700, in __call__\n return self.f(*args, **kwargs)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 520, in _InvokeAccessor\n return self._stub.InvokeAccessor(self, info)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/StubAdapterAccessorImpl.py\", line 41, in InvokeAccessor\n result = self._pc.RetrievePropertiesEx(specSet=[filterSpec],\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 706, in <lambda>\n self.f(*(self.args + (obj,) + args), **kwargs)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 512, in _InvokeMethod\n return self._stub.InvokeMethod(self, info, args)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/SoapAdapter.py\", line 1397, in InvokeMethod\n raise obj # pylint: disable-msg=E0702\npyVmomi.VmomiSupport.ManagedObjectNotFound: (vmodl.fault.ManagedObjectNotFound) {\n dynamicType = <unset>,\n dynamicProperty = (vmodl.DynamicProperty) [],\n msg = \"The object 'vim.VirtualMachine:vm-2047' has already been deleted or has not been completely created\",\n faultCause = <unset>,\n faultMessage = (vmodl.LocalizableMessage) [],\n obj = 'vim.VirtualMachine:vm-2047'\n}\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Run vmware_vm_shell on a VM to execute some shell command
Delete another VM in the same datacenter at the same time.
Expected Results
vmware_vm_shell be executed successfully. And the vmodl.fault.ManagedObjectNotFound exception should be caught and ignored.
Actual Results
The vmodl.fault.ManagedObjectNotFound exception failed vmware_vm_shell task:
ok: [localhost] => {
"changed": false,
"failed_when_result": false,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible-tmp-1616384002.2108204-3887-78505575399347/AnsiballZ_vmware_vm_shell.py\", line 102, in <module>\n _ansiballz_main()\n File \"/tmp/ansible-tmp-1616384002.2108204-3887-78505575399347/AnsiballZ_vmware_vm_shell.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/tmp/ansible-tmp-1616384002.2108204-3887-78505575399347/AnsiballZ_vmware_vm_shell.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_vm_shell', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 95, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_shell.py\", line 364, in <module>\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_shell.py\", line 360, in main\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_shell.py\", line 235, in __init__\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware.py\", line 222, in find_vm_by_id\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware.py\", line 241, in find_vm_by_name\n File \"/tmp/ansible_vmware_vm_shell_payload_xmlnwzyz/ansible_vmware_vm_shell_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware.py\", line 138, in find_object_by_name\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 700, in __call__\n return self.f(*args, **kwargs)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 520, in _InvokeAccessor\n return self._stub.InvokeAccessor(self, info)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/StubAdapterAccessorImpl.py\", line 41, in InvokeAccessor\n result = self._pc.RetrievePropertiesEx(specSet=[filterSpec],\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 706, in <lambda>\n self.f(*(self.args + (obj,) + args), **kwargs)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/VmomiSupport.py\", line 512, in _InvokeMethod\n return self._stub.InvokeMethod(self, info, args)\n File \"/usr/local/lib/python3.8/dist-packages/pyVmomi/SoapAdapter.py\", line 1397, in InvokeMethod\n raise obj # pylint: disable-msg=E0702\npyVmomi.VmomiSupport.ManagedObjectNotFound: (vmodl.fault.ManagedObjectNotFound) {\n dynamicType = <unset>,\n dynamicProperty = (vmodl.DynamicProperty) [],\n msg = \"The object 'vim.VirtualMachine:vm-2047' has already been deleted or has not been completely created\",\n faultCause = <unset>,\n faultMessage = (vmodl.LocalizableMessage) [],\n obj = 'vim.VirtualMachine:vm-2047'\n}\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
The text was updated successfully, but these errors were encountered:
Akasurde
added
easyfix
Good for new comers and easy to start with contribution
and removed
needs_triage
Needs a first human triage before being processed.
labels
Mar 22, 2021
Summary
When I used vmware_vm_shell to execute shell command on a VM, another VM was deleted and caused vmware_vm_shell failed.
Issue Type
Bug Report
Component Name
vmware_vm_shell
Ansible Version
Configuration
OS / Environment
Oracle Linux 8.3
Steps to Reproduce
Expected Results
vmware_vm_shell be executed successfully. And the vmodl.fault.ManagedObjectNotFound exception should be caught and ignored.
Actual Results
The vmodl.fault.ManagedObjectNotFound exception failed vmware_vm_shell task:
The text was updated successfully, but these errors were encountered: