Questions tagged [pyvmomi]

pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter.

pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter.

https://github.com/vmware/pyvmomi

183 questions
0
votes
2 answers

How do you delete a virtual disk with pyvmomi

I am trying to write a Python program using the pyvmomi library to "erase" a virtual hard drive associated with a VM. The way this is done manually is to remove the virtual disk and create a new virtual disk with the same specs. I am expecting that…
Ben Franske
  • 330
  • 2
  • 11
0
votes
0 answers

How do I compact a virtual disk using pyVmomi?

In VirtualBox I have been using the command: VBoxManage.exe modifymedium disk disk.vdi --compact In order to reduce the size of .vdi files after running zerofree. I'd like to do the same for vSphere virtual disks using pyVmomi. I've seen you can…
Keeely
  • 895
  • 9
  • 21
0
votes
1 answer

how to use TraversalSpec to track new task state change

I'm using pyVmomi, I create a TraversalSpec to recurse through the objects I want to monitor with the property collector. I want to know how to set the TraversalSpec and property collector to monitor the new task. Thanks!
Luo
  • 1
  • 1
0
votes
1 answer

Get current tasks of VirtualMachine with pyvmomi

I'm trying to get all the current tasks of a VirtualMachine and check if they are all 'Completed' before continuing. Using python2.7 on vmware 6.0
Lauden
  • 88
  • 1
  • 8
0
votes
2 answers

How do I modify CPU limit/reservation on the ESXi 5.5.0 console?

I realize that I can modify the resources of a VM in the vsphere client by clicking modify settings -> resources -> CPU and then move the sliders for the Limit and Reservation. What I need to be able to do is modify those values either through SSH…
incanus86
  • 77
  • 6
0
votes
2 answers

PySphere/pyvmomi how to retrieve the DNS and Routing settings of an EXSi host?

Using PySphere library How could it possible to retrive the 'DNS and Routing' configuration of an EXSi host. Here I need to retrieve the Name attribute under DNS and Routing -udm00esx04
user2264738
  • 302
  • 4
  • 18
0
votes
1 answer

How to get vm cluster name via vmware SDK (pyvmomi)

I have code which gets VM capacity (name etc). But one problem: I need to get cluster name of this VM. As I can see , we only can get LUN name , but not cluster name. """Getting data from vCenter and parsing It""" …
0
votes
1 answer

How to add or register .vmtx file from datastore to host inventory?

I have created the vm templates on nfs datastore. Now via automation, I am adding that datastore to a standalone ESX host and then I want to register the .vmtx file to ESX host. While the datastore is added to the host through the script, I am not…
pythonuser
  • 197
  • 5
  • 10
0
votes
1 answer

Pyvmomi supported types

Background I am trying to extract all of the information from vmware that I can via its API and pyvmomi. I noticed from pyvmomi examples that this is how to get all of the vms on a vsphere instance: import yaml from pyVmomi import vim from…
Rorschach
  • 3,684
  • 7
  • 33
  • 77
0
votes
1 answer

pyvmomi get total cpu, memory stat of vcenter server

I am able to get cpu memory of different objects like hosts, datacenter through the api. But i need the total CPU, memory statistics of the whole vcenter as shown in the pic below using pyvmomi. Any help would be appreciated.
sandesh hegde
  • 34
  • 1
  • 12
0
votes
1 answer

Failed to create a VmWare VM via ansible 2.6, pyvmomi 5.5.0, vsphere 5.5 and ESXI 6

I use a playbook with : - hosts: localhost vars_prompt: name: passwd prompt: "{{ vcenter }} passwd for {{ login }} ? >>> " tasks: - name: Create a virtual machine "{{ vm_name }}" vmware_guest: datacenter: '{{ datacenter }}' …
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
0
votes
2 answers

pyvmomi: can't set IP address in VmWare vSphere

I use this playbook, it create a new VM from a template, but I can't figure out the way to use the IP and DNS configuration. Is there something I miss ? # Deploy a guest from a template* - hosts: 127.0.0.1 tasks: - name: Create a virtual…
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
0
votes
1 answer

Get last login time to VM with pyvmomi

I’m trying to get the last time user logged in to each one of the VM’s we have and the user name using pyvmomi without login to each one of the VM to get this info, I'm not looking for a specific user just the last one. I searched the github and…
Epligam
  • 741
  • 2
  • 14
  • 36
0
votes
1 answer

pyvmomi deploy ovf templte

I am trying to deploy a ovf image in vcenter using the code in below link: [https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/deploy_ovf.py][1] python vm_deploy.py -s ‘vcneter_url’ -u ‘username’ -p ‘password’ -v ‘.vmdk path’ -f…
rdm_
  • 67
  • 1
  • 8
0
votes
1 answer

Flask: Pass object between pages

i want to create a simple web application who use a connection to a vCenter Server, and i want to pass the variable connection between pages, instead of recreate this connection on every page. This is the code: #!/bin/env python from flask import…