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

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions
Classes | List of all members
Com::Vmware::Vcenter::Vm::Hardware::Cdrom Class Reference
Inheritance diagram for Com::Vmware::Vcenter::Vm::Hardware::Cdrom:

## Classes
class | BackingInfo
class | BackingSpec
class | BackingType
class | CreateSpec
class | DeviceAccessType
class | HostBusAdapterType
class | Info
class | Summary
class | UpdateSpec

## Avaliable Methods
public method | create ()
public method | disconnect ()
public method | get ()
public method | delete ()
public method | new ()
public method | update ()
public method | list ()
public method | connect ()

## Detailed Description

The `Com::Vmware::Vcenter::Vm::Hardware::Cdrom` interface provides methods for configuring the virtual CD-ROM devices of a virtual machine. Constant String::RESOURCE_TYPE # Resource type for the virtual CD-ROM device.

## Member Function Documentation

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::connect | ( |  | ) |

Connects a virtual CD-ROM device of a powered-on virtual machine to its backing. Connecting the virtual device makes the backing accessible from the perspective of the guest operating system.

For a powered-off virtual machine, the :func:`Com::Vmware::Vcenter::Vm::Hardware::Cdrom.update` method may be used to configure the virtual CD-ROM device to start in the connected state when the virtual machine is powered on.

Parameters

  vm | [REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
  cdrom | [REQUIRED] Virtual CD-ROM device identifier. The value must be an identifier for the resource type getQualifiedName(com.vmware.vcenter.vm.hardware.Cdrom). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine or virtual CD-ROM device is not found.
  Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredState | if the virtual CD-ROM device is already connected.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the virtual machine is not powered on.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if the virtual machine is busy performing another operation.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in connect: 11
sub connect {
my ($self, %args) = @_;
my $vm = $args {vm};
my $cdrom = $args {cdrom};
$self->validate_args (method_name => 'connect',
method_args => \%args);
return $self->invoke (method_name => 'connect',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::create | ( |  | ) |

Adds a virtual CD-ROM device to the 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.
  spec | [REQUIRED] Specification for the new virtual CD-ROM device. . The value must be Com::Vmware::Vcenter::Vm::Hardware::Cdrom::CreateSpec.

Return values

  Virtual | CD-ROM device identifier. The value will be an identifier for the resource type getQualifiedName(com.vmware.vcenter.vm.hardware.Cdrom). The return type will be str

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reported that the CD-ROM device was created but was unable to confirm the creation because the identifier of the new device could not be determined.
  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine is not found.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the virtual machine is suspended or if the virtual machine is powered on and virtual CD-ROM type is IDE.
  Com::Vmware::Vapi::Std::Errors::UnableToAllocateResource | if the specified storage address is unavailable; for example, if the SCSI adapter requested does not exist.
  Com::Vmware::Vapi::Std::Errors::ResourceInUse | if the specified storage address is in use.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the specified storage address is out of bounds.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if the virtual machine is busy performing another operation.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.
  Com::Vmware::Vapi::Std::Errors::Unsupported | if the guest operating system of the virtual machine is not supported and spec includes null fields that default to guest-specific values.

Code:
click to view
# Number of lines of code in create: 11
sub create {
my ($self, %args) = @_;
my $vm = $args {vm};
my $spec = $args {spec};
$self->validate_args (method_name => 'create',
method_args => \%args);
return $self->invoke (method_name => 'create',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::delete | ( |  | ) |

Removes a virtual CD-ROM device from the 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.
  cdrom | [REQUIRED] Virtual CD-ROM device identifier. The value must be an identifier for the resource type getQualifiedName(com.vmware.vcenter.vm.hardware.Cdrom). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine or virtual CD-ROM device is not found.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the virtual machine is suspended or if the virtual machine is powered on and virtual CD-ROM type is IDE.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if the virtual machine is busy performing another operation.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in delete: 11
sub delete {
my ($self, %args) = @_;
my $vm = $args {vm};
my $cdrom = $args {cdrom};
$self->validate_args (method_name => 'delete',
method_args => \%args);
return $self->invoke (method_name => 'delete',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::disconnect | ( |  | ) |

Disconnects a virtual CD-ROM device of a powered-on virtual machine from its backing. The virtual device is still present and its backing configuration is unchanged, but from the perspective of the guest operating system, the CD-ROM device is not connected to its backing resource.

For a powered-off virtual machine, the :func:`Com::Vmware::Vcenter::Vm::Hardware::Cdrom.update` method may be used to configure the virtual CD-ROM device to start in the disconnected state when the virtual machine is powered on.

Parameters

  vm | [REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
  cdrom | [REQUIRED] Virtual CD-ROM device identifier. The value must be an identifier for the resource type getQualifiedName(com.vmware.vcenter.vm.hardware.Cdrom). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine or virtual CD-ROM device is not found.
  Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredState | if the virtual CD-ROM device is already disconnected.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the virtual machine is not powered on.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if the virtual machine is busy performing another operation.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in disconnect: 11
sub disconnect {
my ($self, %args) = @_;
my $vm = $args {vm};
my $cdrom = $args {cdrom};
$self->validate_args (method_name => 'disconnect',
method_args => \%args);
return $self->invoke (method_name => 'disconnect',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::get | ( |  | ) |

Returns information about a virtual CD-ROM device.

Parameters

  vm | [REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
  cdrom | [REQUIRED] Virtual CD-ROM device identifier. The value must be an identifier for the resource type getQualifiedName(com.vmware.vcenter.vm.hardware.Cdrom). . The value must be str.

Return values

  Information | about the specified virtual CD-ROM device. The return type will be Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Info

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine or virtual CD-ROM device is not found.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in get: 11
sub get {
my ($self, %args) = @_;
my $vm = $args {vm};
my $cdrom = $args {cdrom};
$self->validate_args (method_name => 'get',
method_args => \%args);
return $self->invoke (method_name => 'get',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::list | ( |  | ) |

Returns commonly used information about the virtual CD-ROM devices belonging to the 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

  List | of commonly used information about virtual CD-ROM devices. The return type will be Array of Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Summary

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine is not found.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in list: 10
sub list {
my ($self, %args) = @_;
my $vm = $args {vm};
$self->validate_args (method_name => 'list',
method_args => \%args);
return $self->invoke (method_name => 'list',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::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

  Blessed | object

Code:
click to view
# Number of lines of code in new: 11
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $stub_config = $args {stub_config};
my $api_provider = $args {api_provider};
my $self = $class->SUPER::new('stub_config' => $stub_config,
'api_provider' => $api_provider);
bless $self, $class;
return $self;
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cdrom::update | ( |  | ) |

Updates the configuration of a virtual CD-ROM device.

Parameters

  vm | [REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
  cdrom | [REQUIRED] Virtual CD-ROM device identifier. The value must be an identifier for the resource type getQualifiedName(com.vmware.vcenter.vm.hardware.Cdrom). . The value must be str.
  spec | [REQUIRED] Specification for updating the virtual CD-ROM device. . The value must be Com::Vmware::Vcenter::Vm::Hardware::Cdrom::UpdateSpec.

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the virtual machine or virtual CD-ROM device is not found.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if one or more of the fields specified in the `spec` parameter cannot be modified due to the current power state of the virtual machine or the connection state of the virtual CD-ROM device.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if the virtual machine is busy performing another operation.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in update: 12
sub update {
my ($self, %args) = @_;
my $vm = $args {vm};
my $cdrom = $args {cdrom};
my $spec = $args {spec};
$self->validate_args (method_name => 'update',
method_args => \%args);
return $self->invoke (method_name => 'update',
method_args => \%args);
}

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

- Com/Vmware/Vcenter/Vm/Hardware/Cdrom.pm