title: How do I get ipstack for VMs using vmware pyvmomi?
body: <p>Is there a way to get the IPStack for a vm in vmware?  Particularly using pyvmomi for python </p>
  
  <p><a href="https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.GuestInfo.html#field_detail" rel="nofollow noreferrer">https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.GuestInfo.html#field_detail</a> no longer shows ip stack and vm.summary returns a large list of info including a single IP and each network card, but not which ip each card is connected to.  </p>
  
  <p><a href="https://github.com/vmware/pyvmomi/issues/769" rel="nofollow noreferrer">https://github.com/vmware/pyvmomi/issues/769</a> seems to show that at some point there was an output that included the IPStack.  </p>
  
  <p>I have MANY vms with more than one ip address viewable when you log into the vcenters via their html interface.  Each IP is viewable, and using the mob, you can access</p>
  
  <p>VIRTUALCENTERNAME/mob/?moid=vm%2dVM_NUMBER&amp;doPath=guest%2eipStack I can see the info I want, but how can I pull this via python</p>
  
  <p>Code snippet: </p>
  
  <pre><code>si = SmartConnectNoSSL(host=MY_VCENTER, user='MYUSERNAME',pwd=MYPASSWORD, port=MYPORT)
  atexit.register(Disconnect, si)
  content = si.RetrieveServiceContent()
  container = content.rootFolder
  recursive = True
  viewTypeComputeResource = [vim.ComputeResource]
  containerView = content.viewManager.CreateContainerView(container, viewTypeComputeResource, recursive)  # create container view
  clusters = containerView.view
  for cluster in clusters:
      hosts = cluster.host
      for each_host in hosts:
          vms = each_host.vm
          for vm in vms:
              print(vm.summary)
  </code></pre>
  
  <p>This code runs and gets you from the root folder to the vms and their summaries, which provide guest info, ethernet info etc.  I would assume vm.summary.guestInfo (or varying caps and non caps) would help but didnt.  </p>