Questions tagged [pysphere]

Python API for interaction with the vSphere Web Services SDK.

It's built upon a slightly modified version of ZSI (that comes bundled-in) which makes it really fast in contrast to other python SOAP libraries that don't provide code generation.

link: https://code.google.com/p/pysphere/

18 questions
20
votes
4 answers

What is the Difference between PySphere and PyVmomi?

I need to write python scripts to automate time configuration of Virtual Machines running on a ESX/ESXi host. I don't know which API to use. I am able to find to python bindings for VMWare APIs viz. PySphere and PyVmomi. Could anyone please explain…
anukalp
  • 2,780
  • 5
  • 15
  • 24
3
votes
2 answers

How to get filtered VM list on vcenter with python

I'm trying to get a list of registered virtual machines - by their name - in my vcenter. The problem that I have many vms (~5K), and I am doing it a lot of times (O(1000)/hour). The SDKs I'm using causing it a lot of traffic…
eplaut
  • 666
  • 1
  • 7
  • 26
3
votes
1 answer

Need python interface for moving a machine to another folder

I am trying to find a code support in python for moving a machine between Datacenter's folders without success, I saw in pysphere that you can define the folder just in the clone stage and not after machine already cloned. This seems as a solution…
JavaSa
  • 5,813
  • 16
  • 71
  • 121
2
votes
0 answers

pysphere PerformanceManager fails to get statistics of datastores

I'm trying to get statistics of vsphere datastores. While I'm able to get statistics of hosts, it fails with datastores: from pysphere import VIServer server = VIServer() server.connect(HOST, USER, PASSWORD) pm =…
EliadL
  • 6,230
  • 2
  • 26
  • 43
1
vote
0 answers

How can I globally set the SSL protocol for a python application?

I'm working on maintaining a Python application for my company that uses pysphere to connect to a vCenter. If our users select the option to only allow incoming requests via TLSv1 (default is both TLSv1 and SSLv3, and the setting is rarely changed)…
amarkon
  • 341
  • 1
  • 6
  • 17
0
votes
1 answer

How to change port group properties in vcenter,e.g., like blocking a specific port of virtual port group by MAC address

I want to write a script that accepts a virtual port group name and a MAC address, based on which I want to block a certain port of that Virtual Port Group. Is there any way of doing it using pysphere APIs?
AdityaVV
  • 119
  • 9
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

Python: Parallel execution pysphere commands

My current for loop does 1 by 1 removing snapshots from my 16 VMs for vmName in vmList: snapshots = vmServer.get_vm_by_name(vmName).get_snapshots() for i in range(len(snapshots)-3): snapshotName = snapshots[i].get_name() …
Dimu4
  • 213
  • 1
  • 4
  • 18
0
votes
1 answer

AttributeError: 'str' object has no attribute 'typecode'

I am trying to use VIProperty in pysphere but I am getting 'str' object has no attribute 'typecode'. Code: for h, mor in server.get_hosts().items(): if mor == 'xxx.com': prop = VIProperty(server, mor) Error: Traceback (most recent call…
davegallant
  • 533
  • 8
  • 27
0
votes
1 answer

Error in libcloud and vsphere integration

I am using libcloud 1.2.1 with pysphere 0.1.7. I am getting the below error when trying to connect to the ESXi host. Traceback (most recent call last): File "", line 1, in File…
AvnishSingh
  • 488
  • 3
  • 10
0
votes
1 answer

Pysphere error when running playbook

--- - hosts: my-host tasks: - vsphere_guest: vcenter_hostname: vcenter.mydomain.local username: myuser password: mypass guest: newvm001 vmware_guest_facts: yes When I run this playbook, I get this error…
user3796292
  • 141
  • 1
  • 2
  • 10
0
votes
0 answers

Launching a process using pysphere in activatedWindow mode

When I launch various processes on VM's on my ESXi server the default opening style of any process is minimize,i.e the window is not activated. Does anyone know how to activate that window using pysphere?
saurabh
  • 1
  • 4
0
votes
2 answers

Getting error while logging in to guest VM using pysphere

I have vCenter 5.5 and ESXi host is 5.1 But I am getting the following error while logging in to guest VM.I have also updated vmware tools import sys from pysphere import VIServer s=VIServer() …
Enchara
  • 1
  • 2
0
votes
1 answer

ImportError: cannot import name 'VIServer'

I am using python 2.7.6 and pysphere 0.1.7.I am getting the error in the following code: import sys import pysphere from pysphere import VIServer server=VIServer() server.connect(host,login,password) vm_target=server.get_vm_by_name(guest) if…
Shasha99
  • 1,746
  • 2
  • 16
  • 30
0
votes
1 answer

Pysphere get current snapshot name

Does anybody know how to get current snapshot name, using pyshpere api? https://code.google.com/p/pysphere/wiki/GettingStarted#List_snapshots
JavaSa
  • 5,813
  • 16
  • 71
  • 121
1
2