Hi,
I want to use the API command (with c#) to run a process on a vm.
This is what I do:
ManagedObjectReference processManagerRef = new ManagedObjectReference {
type = "GuestProcessManager",
Value = "ha-guest-operations-process-manager"
};
NamePasswordAuthentication auth = new NamePasswordAuthentication {
username = username,
password = password,
interactiveSession = true
};
GuestProgramSpec progSpec = new GuestProgramSpec {
programPath = program,
arguments = progParams
};
ManagedObjectReference vmRef = GetInventoryItem(GetEsxVmInventoryPath(new Host { VmxPath = vm }));
long pid = service.StartProgramInGuest(processManagerRef, vmRef, auth, progSpec);
return (ulong)pid;
When I run this code, I get:
System.Web.Services.Protocols.SoapException: The guest operations agent could not be contacted.
When searching similar problems I didn't find something that solves this..
When looking at the VM, it's powered on and VMware tools are running and up-to-date.
I'm using the SDK API for Vsphere 5.1.
Thank you,
Meytal