Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcsim: Failed to destroy Host system #1039

Closed
Akasurde opened this issue Feb 17, 2018 · 0 comments
Closed

vcsim: Failed to destroy Host system #1039

Akasurde opened this issue Feb 17, 2018 · 0 comments

Comments

@Akasurde
Copy link
Contributor

Python traceback:

python host_destroy.py
Traceback (most recent call last):
  File "host_destroy.py", line 7, in <module>
    host1.Destroy_Task()
  File "/Volumes/data/src/ansible/venv4/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 580, in <lambda>
    self.f(*(self.args + (obj,) + args), **kwargs)
  File "/Volumes/data/src/ansible/venv4/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 386, in _InvokeMethod
    return self._stub.InvokeMethod(self, info, args)
  File "/Volumes/data/src/ansible/venv4/lib/python2.7/site-packages/pyVmomi/SoapAdapter.py", line 1357, in InvokeMethod
    raise exc
pyVmomi.SoapAdapter.ParserError: 'xml document: <httplib.HTTPResponse instance at 0x1116be9e0> parse error at: line:2, col:503'

Python reproducer

from pyVim.connect import SmartConnect, Disconnect
import ssl
import atexit
from pyVmomi import vim

def connect():
    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
    context.verify_mode = ssl.CERT_NONE

    si = SmartConnect(host='0.0.0.0', user='user', pwd='pass', port=443, sslContext=context)
    atexit.register(Disconnect, si)
    content = si.RetrieveContent()
    return content

def get_obj(content, vimtype, name):
    """
    Return an object by name, if name is None the
    first found object is returned
    """
    obj = None
    container = content.viewManager.CreateContainerView(
        content.rootFolder, vimtype, True)
    for c in container.view:
        if name:
            if c.name == name:
                obj = c
                break
        else:
            obj = c
            break

    container.Destroy()
    return obj

content = connect()

host1 = get_obj(content, [vim.HostSystem], 'DC0_H0')
host1.Destroy_Task()
@anfernee anfernee self-assigned this Feb 20, 2018
anfernee pushed a commit to anfernee/govmomi that referenced this issue Feb 21, 2018
anfernee pushed a commit to anfernee/govmomi that referenced this issue Feb 22, 2018
anfernee pushed a commit to anfernee/govmomi that referenced this issue Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants