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
List of all members
Com::Vmware::Vcenter::Iso::Image Class Reference
Inheritance diagram for Com::Vmware::Vcenter::Iso::Image:

## Avaliable Methods
public method | mount ()
public method | new ()
public method | unmount ()

## Detailed Description

Provides an interface to mount and unmount an ISO image on a virtual machine.

This is an API that will let its client mount or unmount an ISO image on a virtual machine as a CD-ROM.

## Member Function Documentation

public method Com::Vmware::Vcenter::Iso::Image::mount | ( |  | ) |

Mounts an ISO image from a content library on a virtual machine.

Parameters

  library_item | [REQUIRED] The identifier of the library item having the ISO image to mount on the virtual machine. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.
  vm | [REQUIRED] The identifier of the virtual machine where the specified ISO image will be mounted. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.

Return values

  The | identifier of the newly created virtual CD-ROM backed by the specified ISO image. 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::NotFound | If either `vm` or the `library_item` is not found.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | If no .iso file is present on the library item.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | When the operation is not allowed on the virtual machine in its current state.

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

public method Com::Vmware::Vcenter::Iso::Image::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::Iso::Image::unmount | ( |  | ) |

Unmounts a previously mounted CD-ROM using an ISO image as a backing.

Parameters

  vm | [REQUIRED] The identifier of the virtual machine from which to unmount the virtual CD-ROM. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
  cdrom | [REQUIRED] The device identifier of the CD-ROM. 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::NotFound | If the virtual machine identified by `vm` is not found or the `cdrom` does not identify a virtual CD-ROM in the virtual machine.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | When the operation is not allowed on the virtual machine in its current state.

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

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

- Com/Vmware/Vcenter/Iso/Image.pm