VMware vSphere Automation SDK Perl
The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities
 All Classes Files Functions
Classes | List of all members
Com::Vmware::Vcenter::Vm::Power Class Reference
Inheritance diagram for Com::Vmware::Vcenter::Vm::Power:
Com::Vmware::Vapi::Bindings::VapiInterface

Classes

class  Info
 
class  State
 

Avaliable Methods

public method suspend ()
 
public method reset ()
 
public method stop ()
 
public method get ()
 
public method new ()
 
public method start ()
 

Detailed Description

The Com::Vmware::Vcenter::Vm::Power interface provides methods for managing the power state of a virtual machine.

Member Function Documentation

public method Com::Vmware::Vcenter::Vm::Power::get ( )

Returns the power state information of a virtual machine.

Parameters
vm[REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
Return values
Powerstate information for the specified virtual machine. The return type will be Com::Vmware::Vcenter::Vm::Power::Info
Exceptions
Com::Vmware::Vapi::Std::Errors::Errorif the system reports an error while responding to the request.
Com::Vmware::Vapi::Std::Errors::NotFoundif the virtual machine is not found.
Com::Vmware::Vapi::Std::Errors::ResourceInaccessibleif the virtual machine's configuration or execution state cannot be accessed.
Com::Vmware::Vapi::Std::Errors::ServiceUnavailableif the system is unable to communicate with a service to complete the request.
Com::Vmware::Vapi::Std::Errors::Unauthenticatedif the user can not be authenticated.
Com::Vmware::Vapi::Std::Errors::Unauthorizedif the user doesn't have the required privileges.
Code:
click to view
public method Com::Vmware::Vcenter::Vm::Power::new ( )

Constructor to initialize the object

Parameters
api_provider- protocol connection to use with stubs created by this factory
StubConfig- Stub's additional configuration
Return values
Blessedobject
Code:
click to view
public method Com::Vmware::Vcenter::Vm::Power::reset ( )

Resets a powered-on virtual machine.

Parameters
vm[REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
Exceptions
Com::Vmware::Vapi::Std::Errors::Errorif the system reports an error while responding to the request.
Com::Vmware::Vapi::Std::Errors::NotFoundif the virtual machine is not found.
Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentStateif the virtual machine is powered off or suspended.
Com::Vmware::Vapi::Std::Errors::ResourceBusyif the virtual machine is performing another operation
Com::Vmware::Vapi::Std::Errors::ServiceUnavailableif the system is unable to communicate with a service to complete the request.
Com::Vmware::Vapi::Std::Errors::Unauthenticatedif the user can not be authenticated.
Com::Vmware::Vapi::Std::Errors::Unauthorizedif the user doesn't have the required privileges.
Code:
click to view
public method Com::Vmware::Vcenter::Vm::Power::start ( )

Powers on a powered-off or suspended virtual machine.

Parameters
vm[REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
Exceptions
Com::Vmware::Vapi::Std::Errors::Errorif the system reports an error while responding to the request.
Com::Vmware::Vapi::Std::Errors::NotFoundif the virtual machine is not found.
Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredStateif the virtual machine is already powered on.
Com::Vmware::Vapi::Std::Errors::Unsupportedif the virtual machine does not support being powered on (e.g. marked as a template, serving as a fault-tolerance secondary virtual machine).
Com::Vmware::Vapi::Std::Errors::UnableToAllocateResourceif resources cannot be allocated for the virtual machine (e.g. physical resource allocation policy cannot be satisfied, insufficient licenses are available to run the virtual machine).
Com::Vmware::Vapi::Std::Errors::ResourceInaccessibleif resources required by the virtual machine are not accessible (e.g. virtual machine configuration files or virtual disks are on inaccessible storage, no hosts are available to run the virtual machine).
Com::Vmware::Vapi::Std::Errors::ResourceInUseif resources required by the virtual machine are in use (e.g. virtual machine configuration files or virtual disks are locked, host containing the virtual machine is an HA failover host).
Com::Vmware::Vapi::Std::Errors::ResourceBusyif the virtual machine is performing another operation.
Com::Vmware::Vapi::Std::Errors::ServiceUnavailableif the system is unable to communicate with a service to complete the request.
Com::Vmware::Vapi::Std::Errors::Unauthenticatedif the user can not be authenticated.
Com::Vmware::Vapi::Std::Errors::Unauthorizedif the user doesn't have the required privileges.
Code:
click to view
public method Com::Vmware::Vcenter::Vm::Power::stop ( )

Powers off a powered-on or suspended virtual machine.

Parameters
vm[REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
Exceptions
Com::Vmware::Vapi::Std::Errors::Errorif the system reports an error while responding to the request.
Com::Vmware::Vapi::Std::Errors::NotFoundif the virtual machine is not found.
Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredStateif the virtual machine is already powered off.
Com::Vmware::Vapi::Std::Errors::ResourceBusyif the virtual machine is performing another operation.
Com::Vmware::Vapi::Std::Errors::ServiceUnavailableif the system is unable to communicate with a service to complete the request.
Com::Vmware::Vapi::Std::Errors::Unauthenticatedif the user can not be authenticated.
Com::Vmware::Vapi::Std::Errors::Unauthorizedif the user doesn't have the required privileges.
Code:
click to view
public method Com::Vmware::Vcenter::Vm::Power::suspend ( )

Suspends a powered-on virtual machine.

Parameters
vm[REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
Exceptions
Com::Vmware::Vapi::Std::Errors::Errorif the system reports an error while responding to the request.
Com::Vmware::Vapi::Std::Errors::NotFoundif the virtual machine is not found.
Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredStateif the virtual machine is already suspended.
Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentStateif the virtual machine is powered off.
Com::Vmware::Vapi::Std::Errors::ResourceBusyif the virtual machine is performing another operation.
Com::Vmware::Vapi::Std::Errors::ServiceUnavailableif the system is unable to communicate with a service to complete the request.
Com::Vmware::Vapi::Std::Errors::Unauthenticatedif the user can not be authenticated.
Com::Vmware::Vapi::Std::Errors::Unauthorizedif the user doesn't have the required privileges.
Code:
click to view

The documentation for this class was generated from the following file: