Is there a way to execute shell commands on VMWare server via PyVMomi?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Feb 11 17:42:40 EST 2015


Johnny Ting Shi wrote:

> We have some VM running on top of EXSi. We want to be to run some remote
> arbitrary commands on the VM, anyone has experience with
> https://github.com/vmware/pyvmomi? which command do i need to call?


I'm afraid I've never used pyvmomi, but I'm not sure why the fact it is a VM
is relevant. You want to run commands on another machine (hence, remote
commands), whether that machine is a physical machine or a VM shouldn't
matter. Is there something special about the host or VM that prevents
normal remote procedure calls from working?

Do you mean OS commands? That suggests using ssh on Linux machines.

If you want to run Python code remotely, I have used both Pyro and Rpyc,
they are both very mature and quite good.

https://pypi.python.org/pypi/rpyc/

https://pypi.python.org/pypi/Pyro4/

Watch out though, there is another project calling itself "Pyro" too, Python
Robotics. I don't know which has seniority.




-- 
Steven




More information about the Python-list mailing list