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
2
votes
2 answers

How to get sizes of VMWare VM disks using PyVMomi

Can anyone guide me how to calculate the sizes of disks attached to VMWare VMs using PyVMomi?
user2847686
  • 21
  • 1
  • 3
2
votes
2 answers

pyvmomi no thin provision when cloning

I am trying to clone a VM in VMWare using pyVmomi. However, I am having trouble getting thin provisioning for the disk. Here are the portions of the code I believe are relevant for reproducing the issue. def find_disk(vm,index): """Return the disk…
hilcharge
  • 1,515
  • 3
  • 12
  • 18
2
votes
0 answers

pyvmomi: adding a .vmx to inventory as a template and moving to a specific folder

EDIT: crossposted to reddit in r/vmware here I'm new to using the VMWare API, and specifically trying to use pyVmomi. I'm having a really difficult time understanding how it all fits together. What I'm trying to accomplish is simply: 1. take a…
digitalsy
  • 138
  • 2
  • 10
2
votes
2 answers

How to create a VM (not clone) with a vmdk disk attached using Pyvmomi?

I am trying to create a new VM using Pyvmomi. I am successful creating the VM with RAM and CPU, but I cannot find docs on how to create this VM with a disk attached. I am looking to create a VM with a 20GB thin provisioned HDD, but I cannot find…
John G.
  • 21
  • 1
  • 3
1
vote
0 answers

Use pyvmomi to add managment service to vmnikc?

Good day, I am trying to use pyvmomi to build out a network infrastructure that includes a closed network with a virtual nic to access the ESXi web management interface. Thus far, I have successfully added a virtual nic with…
bjb28
  • 11
  • 1
1
vote
0 answers

Download file from VM 'pyvmomi'

I'm having difficulty downloading file from VM using 'InitiateFileTransferFromGuest' in python. Here's the code: def main8(host,user,password, VM_NAME,VM_USER,VM_PASS,LOCAL_FILE_PATH,REMOTE_FILE_PATH,UUID): class Namespace: def __init__(self,…
1
vote
1 answer

Deploy a VM form ovf, vmdk on a standalone ESXi host without vCenter

I have a single standalone ESXi installation, and it's not being managed by vCenter. How can I programmatically deploy a new VM on this ESXi using an OVF, VMDK file? I have come across pyvmomi and its deploy_ove.py example, but it looks like it's…
Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98
1
vote
1 answer

Change guest password using pyvmomi

I am using pyVmomi for my automation. Now I am testing a VM, where the SSH is disabled by default, and I must change the password upon the first login: You are required to change your password immediately (root enforced) If I try connecting using…
Arik
  • 1,257
  • 9
  • 13
1
vote
0 answers

Get performance data from Pyvmomi

I'm using the Python library for vsphere (pyvmomi) and I'm trying to get the performance data for a vm, this is the performance part: perfManager = content.perfManager metricId = vim.PerformanceManager.MetricId(counterId=6, instance="*") …
Rafael
  • 1,099
  • 5
  • 23
  • 47
1
vote
1 answer

Pyvmomi configure ESXi 'NTP Client Enabled' check box

Using the below code its possible to update the start up policy of ntpd service in an ESXi server, con = connect.SmartConnect(host=host, user=user, pwd=pwd) content = con.RetrieveContent() cv = content.viewManager.CreateContainerView( …
user2264738
  • 302
  • 4
  • 18
1
vote
0 answers

Python3, problem importing vim from pyVmomi

I had a project in PyCharm with python2.7 perfectly working and in it the class VMWare that imported vim from pyVmomi. I'm reworking it it python3.6, via pip I installed all the needed library but on PyCharm I can't import vim from pyVmomi. Cannot…
Carlos15
  • 21
  • 2
1
vote
0 answers

How to execute govc/pyvmomi run command which lists output of server on local pc

I am able to list all the vm's using govmomi(not govc which is one line command in terminal) but I am trying to implement this: govc guest.run -vm $vm_name cat sample.txt from scratch rather than running it via govc. The docs seems to be confusing.…
mozilla-firefox
  • 864
  • 1
  • 15
  • 23
1
vote
0 answers

How can I get all information about my vcenters in vmware vsphere with pyvmomi

I can currently get info on all vms, all hosts, all "clusters" (datacenters?) and all datastores. Is there anything else, any other managed datatype that would provide useful information. My objective is to give my company info about the machines…
AlbinoRhino
  • 467
  • 6
  • 23
1
vote
1 answer

How do I get ipstack for VMs using vmware pyvmomi?

Is there a way to get the IPStack for a vm in vmware? Particularly using pyvmomi for python https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.GuestInfo.html#field_detail no longer shows ip stack and vm.summary returns a large list of info…
AlbinoRhino
  • 467
  • 6
  • 23
1
vote
1 answer

vsphere python extend vmfs datastore

I would like to extend a vmfs datastore thanks the vsphere python api pyvmomi. A methode exist for this purpose extendvmfsdatastore…
tofu
  • 25
  • 6
1 2
3
12 13