Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6767531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:57:43+00:00 2026-05-26T14:57:43+00:00

How do i contact the vSphere (or VMWare) form Python either with some form

  • 0

How do i contact the vSphere (or VMWare) form Python either with some form of library or via SUDS to get the number of number of vCPU or a specific host/guest/virtual-machine?

Currently i’m trying:

from suds.client import Client
from suds.sudsobject import Property

client = Client("https://<server>/sdk/vimService?wsdl")
queryCon = client.wsdl.services[0].ports[0].methods['QueryConnectionInfo']
print queryCon

And that works, and it gives me some form of output:

(Method){
   name = "QueryConnectionInfo"
   location = "https://localhost/sdk/vimService"
   binding =
      (binding){
         input = <suds.bindings.document.Document instance at 0x0775C080>
         output = <suds.bindings.document.Document instance at 0x0775C080>
      }
   soap =
      (soap){
         action = ""urn:vim25/4.1""
         style = "document"
         input =
            (Input){
               body =
                  (Body){
                     parts[] =
                        (Part){
                           root = <part name="parameters" element="vim25:QueryConnectionInfo"/>
                           name = "parameters"
                           qname[] =
                              "parameters",
                              "urn:vim25",
                           element = "(u'QueryConnectionInfo', u'urn:vim25')"
                           type = "None"
                        },
                     use = "literal"
                     namespace[] =
                        "vim25",
                        "urn:vim25",
                     wrapped = True
                  }
               headers[] = <empty>
            }
         output =
            (Output){
               body =
                  (Body){
                     parts[] =
                        (Part){
                           root = <part name="parameters" element="vim25:QueryConnectionInfoResponse"/>
                           name = "parameters"
                           qname[] =
                              "parameters",
                              "urn:vim25",
                           element = "(u'QueryConnectionInfoResponse', u'urn:vim25')"
                           type = "None"
                        },
                     use = "literal"
                     namespace[] =
                        "vim25",
                        "urn:vim25",
                     wrapped = True
                  }
               headers[] = <empty>
            }
         faults[] =
            (Fault){
               name = "InvalidLoginFault"
               use = "literal"
               parts[] =
                  (Part){
                     root = <part name="fault" element="vim25:InvalidLoginFault"/>
                     name = "fault"
                     qname[] =
                        "fault",
                        "urn:vim25",
                     element = "(u'InvalidLoginFault', u'urn:vim25')"
                     type = "None"
                  },
            },
            (Fault){
               name = "HostConnectFaultFault"
               use = "literal"
               parts[] =
                  (Part){
                     root = <part name="fault" element="vim25:HostConnectFaultFault"/>
                     name = "fault"
                     qname[] =
                        "fault",
                        "urn:vim25",
                     element = "(u'HostConnectFaultFault', u'urn:vim25')"
                     type = "None"
                  },
            },
            (Fault){
               name = "RuntimeFault"
               use = "literal"
               parts[] =
                  (Part){
                     root = <part name="fault" element="vim25:RuntimeFaultFault"/>
                     name = "fault"
                     qname[] =
                        "fault",
                        "urn:vim25",
                     element = "(u'RuntimeFaultFault', u'urn:vim25')"
                     type = "None"
                  },
            },
      }
 }

I’ve tried following the following “guides”:

SUDS – programmatic access to methods and types

http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.VirtualMachine.html#field_detail

http://communities.vmware.com/thread/273616

I know that all the information probably is here, i just can’t see the entire picture :/

After a while of trying this is where i get stuck:

client = Client("https://<server>/sdk/vimService?wsdl")
#queryCon = client.wsdl.services[0].ports[0].methods['QueryConnectionInfo']
print client.service.QueryConnectionInfo("https://<server>/sdk", None, r'domain\user', 'Password')

And the output is:

urllib2.URLError: <urlopen error [Errno 1] _ssl.c:490: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:57:44+00:00Added an answer on May 26, 2026 at 2:57 pm

    You might want to try psphere, a Python library (based on suds) which will give you access the entire vSphere Web Services SDK.

    Install it:

    $ pip install psphere
    

    Find a virtual machine and print the number of CPUs it has:

    >>> from psphere.client import Client
    >>> from psphere.managedobjects import VirtualMachine
    >>> client = Client(server="vcenter.mydomain.com", username="Administrator", password="strong")
    >>> vm = VirtualMachine.get(client, name="genesis")
    >>> vm
    <psphere.managedobjects.VirtualMachine object at 0xd3fbccc>
    >>> print("%s has %s CPUs" % (vm.name, vm.config.hardware.numCPU))
    genesis has 2 CPUs
    

    You can find more examples in the documentation.

    Disclaimer: I am the author of psphere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a contact form, I need to filter some words. I'm doing it
While troubleshooting a contact form with an e-mail host they told me to use
On a web contact form , is the reset button really required? Is it
I have a simple contact form with Subject and Message that I want to
I'm creating a contact form for my company and I want to make it
Given this object class Contact { public IEnumerable<Person> People { get; } public string
Made a small contact form on php, it gets $_POST variables and mails to
I am using Contact Form 7 with Wordpress, but I am experiencing an email
I am writing a contact us form on a web project that I am
I have a contact us form in my iphone application. with first name last

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.