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

Trying to pull task information on an virtual machine entity

If I run the below code in pycharm, I get this error: --error-- C:\Python33\python.exe B:/Python/untitled3/working_test.py 'vim.VirtualMachine:vm-65063' Traceback (most recent call last): File "B:/Python/untitled3/working_test.py", line 47, in…
markc
  • 1
  • 3
0
votes
1 answer

vmware python sdk get single vm/template without pulling all the vm's

I'm using vmware python sdk (https://github.com/vmware/pyvmomi). Is there any way via rest api's, python or anyway to just list vm based on filters for getting single vm based on name or uuid, without listing all vm's and then searching.
Sumit Murari
  • 1,597
  • 3
  • 28
  • 43
0
votes
1 answer

ANSIBLE: Adding VMware ESX server to Vcenter Failing though Ansible vmware_host module: Certificate Error

I am trying to add an ESX host to a vcenter server using Ansible code and vmware_host module. It's failing in Certification validation. is there any workaround for this ? --- - hosts: localhost tasks: - name: Add ESXi Host to VCSA …
user3802947
  • 63
  • 2
  • 7
0
votes
1 answer

How I can fetch CPU reservation details of a VM from VMware using pyvmomi or any other python API

https://github.com/vmware/pyvmomi-community-samples/issues/265? From here I can get the Memory info, but I am not able to get CPU reservation field. Please find below code def main(): service_instance = connect.SmartConnect(host=vcenter_host, …
GeekSRE
  • 3
  • 2
0
votes
1 answer

Python pyvmomi VMware API - how to convert a VM to template?

I was looking at a solution to convert a VMware vsphere VM to a template using any of Ansible modules and failed as it seems vmware_guest (using pyvmomi) failed to to that. So, I started investigating the alternatives; it seems the direct pyvmomi…
LinenG
  • 109
  • 3
  • 14
0
votes
1 answer

pyvmomi python: how to create virtual machine in specific folder

I have ESX and have different folders in it. how to create virtual machine in specific folder using python pyvmomi module.
Ajayk
  • 21
  • 2
0
votes
1 answer

Getting List of ESXs and system settings per ESX using pyVmomi

What are the parallel pyVmomi API for the following esxcli commands: esxcli system settings advanced list --option /DataMover/HardwareAcceleratedMove esxcli system settings advanced list --option /DataMover/HardwareAcceleratedInit esxcli system…
curious
  • 85
  • 8
0
votes
1 answer

python3.4 indentation error in "for loop" (pyvmomi)

Trying to invoke python3.4 class methods in a loop. But getting this "TabError: inconsistent use of tabs and spaces in indentation" I viewed the code in both "vim" and "gedit/sublime" and they show no obvious error. Is it not necessarily an…
user1907700
0
votes
1 answer

How to change vm name through pysphere

I'm using the Pysphere API written in python in order to manage VM operations. My question is, how do I change the machine name after it was already cloned. The API is here and here.
JavaSa
  • 5,813
  • 16
  • 71
  • 121
0
votes
1 answer

Executing program via pyvmomi creates a process, but nothing happens after that

I'm studying vCenter 6.5 and community samples help a lot, but in this particular situation I can't figure out, what's going on. The script: from __future__ import with_statement import atexit from tools import cli from pyVim import connect from…
Sergey
  • 1
  • 4
0
votes
1 answer

pyvmomi:error when calling RelocateVM

Hi I am using pyvmomi API, to perform vmotions against a cluster when DRS is set to manual mode. I am going through a vcenter and querying a cluster and getting recommendation and using that to perform the Vmotions. The code is something like this. …
jramacha
  • 117
  • 2
  • 13
0
votes
1 answer

Pyvmomi get folders name

I'm new to Python and Django and I need to list all my VMs. I used pyvmomi and Django but I can't get the folders name from VSphere, it shows a strange line. VMware list 'vim.Folder:group-v207' 'vim.Folder:group-v3177' 'vim.Folder:group-v188' I…
dxtr69
  • 25
  • 2
  • 8
0
votes
1 answer

How to get Disk type information from VMware using pyvmomi?

I have to get DiskType information using python pyvmomi library, I am able to get the same through C# VMware sdk via "Get-VM | Get-HardDisk -DiskType "Flat" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName,Diskmode | fl" command, which…
justjais
  • 344
  • 3
  • 13
0
votes
1 answer

Open Power Shell as Admin on remote VM

I have a python that uses pyvmomi library of VMWare to perform operations on remote VM. I open the remote VM cmd prompt using Pyvmomi library like this vim.vm.guest.ProcessManager.ProgramSpec( …
user1312155
  • 173
  • 4
  • 13
0
votes
1 answer

JSON/Python - decoding

I've got json formatted file, 'datastores.json' that looks like this: { "{'ESXi_Host': 'elvis.lab.vsphere.com'}": { "elvis.data": { "capacity": 293131517952, "uuid": "57431578-630f1322-7bf2-00212883a5b0", …
tnunu
  • 15
  • 5