Files
deb-python-pyvmomi/docs/vim/vm/guest/ProcessManager.rst
Shawn Hartsock c83651f5be pyvmomi RST docs do not properly show lists
Fixes RST documents to include list mark up when appropriate.

closes: https://github.com/vmware/pyvmomi/issues/76
2014-08-13 14:49:24 -04:00

9.3 KiB

vim.vm.guest.ProcessManager

ProcessManager is the managed object that provides APIs to manipulate the guest operating system processes.

since

vSphere API 5.0

Attributes

Methods

StartProgramInGuest(vm, auth, spec):

Starts a program in the guest operating system.A process started this way can have its status queried with ListProcessesInGuest . When the process completes, its exit code and end time will be available for 5 minutes after completion.

Privilege:

Args:
vm (vim.VirtualMachine):

Virtual machine to perform the operation on.

auth (vim.vm.guest.GuestAuthentication):

The guest authentication data. See GuestAuthentication .

spec (vim.vm.guest.ProcessManager.ProgramSpec):

The arguments describing the program to be started.

Returns:
long:

The pid of the program started.

Raises:

vim.fault.GuestOperationsFault:

if there is an error processing a guest operation.

vim.fault.InvalidState:

if the operation cannot be performed because of the virtual machine's current state.

vim.fault.TaskInProgress:

if the virtual machine is busy.

vim.fault.FileFault:

if there is a file error in the guest operating system.

vim.fault.GuestOperationsUnavailable:

if the VM agent for guest operations is not running.

vim.fault.InvalidPowerState:

if the VM is not powered on.

vim.fault.FileNotFound:

if the program path does not exist.

vim.fault.CannotAccessFile:

if the program path cannot be accessed.

vim.fault.GuestPermissionDenied:

if the program path cannot be run because the guest authentication will not allow the operation.

vim.fault.InvalidGuestLogin:

if the the guest authentication information was not accepted.

vim.fault.GuestComponentsOutOfDate:

if the guest agent is too old to support the operation.

vim.fault.OperationNotSupportedByGuest:

if the operation is not supported by the guest OS.

vim.fault.OperationDisabledByGuest:

if the operation is not enabled due to guest agent configuration.

ListProcessesInGuest(vm, auth, pids):

List the processes running in the guest operating system, plus those started by StartProgramInGuest that have recently completed.

Privilege:

Args:
vm (vim.VirtualMachine):

Virtual machine to perform the operation on.

auth (vim.vm.guest.GuestAuthentication):

The guest authentication data. See GuestAuthentication .

pids (long, optional):

If set, only return information about the specified processes. Otherwise, information about all processes are returned. If a specified processes does not exist, nothing will be returned for that process.

Returns:
[vim.vm.guest.ProcessManager.ProcessInfo]:

The list running processes is returned in an array of GuestProcessInfo structures.

Raises:

vim.fault.GuestOperationsFault:

if there is an error processing a guest operation.

vim.fault.InvalidState:

if the operation cannot be performed because of the virtual machine's current state.

vim.fault.TaskInProgress:

if the virtual machine is busy.

vim.fault.GuestOperationsUnavailable:

if the VM agent for guest operations is not running.

vim.fault.InvalidPowerState:

if the VM is not powered on.

vim.fault.GuestPermissionDenied:

if there are insufficient permissions in the guest OS.

vim.fault.InvalidGuestLogin:

if the the guest authentication information was not accepted.

vim.fault.GuestComponentsOutOfDate:

if the guest agent is too old to support the operation.

vim.fault.OperationNotSupportedByGuest:

if the operation is not supported by the guest OS.

vim.fault.OperationDisabledByGuest:

if the operation is not enabled due to guest agent configuration.

TerminateProcessInGuest(vm, auth, pid):

Terminates a process in the guest OS.

Privilege:

Args:
vm (vim.VirtualMachine):

Virtual machine to perform the operation on.

auth (vim.vm.guest.GuestAuthentication):

The guest authentication data. See GuestAuthentication .

pid (long):

Process ID of the process to be terminated

Returns:

None

Raises:

vim.fault.GuestOperationsFault:

if there is an error processing a guest operation.

vim.fault.InvalidState:

if the operation cannot be performed because of the virtual machine's current state.

vim.fault.TaskInProgress:

if the virtual machine is busy.

vim.fault.GuestOperationsUnavailable:

if the VM agent for guest operations is not running.

vim.fault.InvalidPowerState:

if the VM is not powered on.

vim.fault.GuestProcessNotFound:

if the pid does not refer to a valid process.

vim.fault.GuestPermissionDenied:

if the process cannot be terminated because the guest authentication will not allow the operation.

vim.fault.InvalidGuestLogin:

if the the guest authentication information was not accepted.

vim.fault.GuestComponentsOutOfDate:

if the guest agent is too old to support the operation.

vim.fault.OperationNotSupportedByGuest:

if the operation is not supported by the guest OS.

vim.fault.OperationDisabledByGuest:

if the operation is not enabled due to guest agent configuration.

ReadEnvironmentVariableInGuest(vm, auth, names):

Reads an environment variable from the guest OSIf the authentication uses interactiveSession, then the environment being read will be that of the user logged into the desktop. Otherwise it's the environment of the system user.

Privilege:

Args:
vm (vim.VirtualMachine):

Virtual machine to perform the operation on.

auth (vim.vm.guest.GuestAuthentication):

The guest authentication data. See GuestAuthentication .

names (str, optional):

The names of the variables to be read. If not set, then all the environment variables are returned.

Returns:
[str]:

A string array containing the value of the variables, or all environment variables if nothing is specified. The format of each string is "name=value". If any specified environment variable isn't set, then nothing is returned for that variable.

Raises:

vim.fault.GuestOperationsFault:

if there is an error processing a guest operation.

vim.fault.InvalidState:

if the operation cannot be performed because of the virtual machine's current state.

vim.fault.TaskInProgress:

if the virtual machine is busy. accepted by the guest OS.

vim.fault.GuestOperationsUnavailable:

if the VM agent for guest operations is not running.

vim.fault.InvalidPowerState:

if the VM is not powered on.

vim.fault.GuestPermissionDenied:

if there are insufficient permissions in the guest OS.

vim.fault.InvalidGuestLogin:

if the the guest authentication information was not accepted.

vim.fault.GuestComponentsOutOfDate:

if the guest agent is too old to support the operation.

vim.fault.OperationNotSupportedByGuest:

if the operation is not supported by the guest OS.

vim.fault.OperationDisabledByGuest:

if the operation is not enabled due to guest agent configuration.