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
1 answer

How to retrieve datastores in VMWARE based on the cluster name

How to retrieve datastores in VMWARE based on the cluster name using Pyvmomi. [vim.Storagepod] gives null result, so is there any other way to retrieve the datastores filtering on the datacluster name. datastores = get_all_objs(content,…
Spurthi
  • 1
  • 1
0
votes
1 answer

Failed to create top level directory using pyvmomi

I am using python 3.7 and pyvmomi 6.7 I am connecting to exsi host (version 6.7 free license) and trying to deploy a vm with my python script. In one of the step I'm trying to create a directory (to store iso and vmdk) in the datastore. This is the…
Soumyajit
  • 329
  • 1
  • 5
  • 16
0
votes
1 answer

How to strip the resource pool name from 'vim.ResourcePool:resgroup-151'

The data type is and when I return the rp I get 'vim.ResourcePool:resgroup-151' (with the single quote characters there) but are there any methods that can just return the resgroup-151?
Optical Carrier
  • 368
  • 1
  • 4
  • 14
0
votes
3 answers

How to automate the user creation in vcenter using python

I am pretty new to Pyvmomi and vsphere automation. I have been trying to automate the user and group creation in vsphere but could not locate the method in Pyvmomi which could help me automate the process of user creation. I already have a user…
Praseemol
  • 1
  • 2
0
votes
1 answer

Uploading an OVA using pyVmomi appears to require a connection directly to a compute host

I'm hitting an issue with a script that is built on pyVmomi trying to upload an OVA to vSphere. This script is run on a VM that has network connectivity to the vCenter, but not to the compute host. The script is very similar to the community…
0
votes
1 answer

how to create vms with pyvmomi

I am trying to create a python program that will create a provided number of identical virtual machines. I have used the community sample scripts to get as much as i can running but i am completely stuck now. #!/usr/bin/env python """ vSphere SDK…
nathan rod
  • 11
  • 2
0
votes
1 answer

How to get a file from a server in a cluster in Vsphere using pyVmomi to remote(host) pc

I am able to execute a command inside the server but I want to get that output in my local pc. I don't want want to use ssh keys. I want to use just the host's username and password as well as vm's(server's) username and password. I couldn't find a…
mozilla-firefox
  • 864
  • 1
  • 15
  • 23
0
votes
1 answer

How can I tell what strain is caused by pyvmomi on vmware?

I need to make a python script that gathers large amounts of information about vcenters. I basically call every single diagnostic possible, one after the other, gathering this info into a database daily for machine learning. This logs into the…
AlbinoRhino
  • 467
  • 6
  • 23
0
votes
1 answer

Error when connecting to ESXI through python vsphere API

I am creating a script that asks the user for the FQDN of a host, then the script sets that host to maintenance mode. I am running the script on the Windows Management Computer that is obviously connected to the esxi-vcsa that has these hosts on it.…
vmVisor
  • 1
  • 2
0
votes
1 answer

pyvim UpdateVirtualSwitch return "A specified parameter was not correct"

I'm trying to update virtual switch security setting via python but failing with message: Traceback (most recent call last): File "VPC_CRS-Compliance-Remediation-ESXi.py", line 787, in main() File…
VladoPortos
  • 563
  • 5
  • 21
0
votes
1 answer

Is there any API for VMware Compatibility Guide?

Following link provides VMware's compatibility with Ontap device(IMT) https://www.vmware.com/resources/compatibility/search.php It returns IMT data on click of button:"Update and view result", I want to fetch the same data using python script, so…
0
votes
1 answer

Get Esxi networks usage via Pyvmomi

I'm stuck trying to retrieve the network usage per vnic (packets sent/received) from Esxi hosts I have been able to get network names and their properties but i can't figure out how to get the real usage. In the general API explorer I found this…
ale
  • 1
0
votes
0 answers

Pyvmomi API _mor.TerminateVM throws pyVmomi.VmomiSupport.NotSupported: (vmodl.fault.NotSupported)

I am trying to power off a VM hosted on ESX host. while host _mor.TerminateVM is executed below exception is thrown. pyVmomi.VmomiSupport.NotSupported: (vmodl.fault.NotSupported) { dynamicType = , dynamicProperty =…
RaghavendraB
  • 67
  • 1
  • 11
0
votes
1 answer

Python map and lambda combination gives error

I am trying the following working code from pyVmomi import vim mapping = [] propertyDict = {'ipv4': '192.168.2.2/24'} for k in propertyDict: v = propertyDict[k] mapping.append(vim.KeyValue(key=k, value=v)) with map and lambda as…
Ibrahim Quraish
  • 3,889
  • 2
  • 31
  • 39
0
votes
1 answer

Creating a VMware HA cluster using pyvmomi throws exception

Error while creating VMware HA cluster using pyvmomi library. I'm following the official documentation…
iAmHani
  • 1
  • 1