Class List Method List File List

# Class: Com::Vmware::Vcenter::Vm::Hardware::Cdrom

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Vcenter::Vm::Hardware::Cdrom
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb

## Overview

The ``Com::Vmware::Vcenter::Vm::Hardware::Cdrom`` class provides methods for configuring the virtual CD-ROM devices of a virtual machine.

## Defined Under Namespace

Classes: BackingInfo, BackingSpec, BackingType, CreateSpec, DeviceAccessType, HostBusAdapterType, Info, Summary, UpdateSpec

## Constant Summary

RESOURCE_TYPE =

      'com.vmware.vcenter.vm.hardware.Cdrom'

## Instance Method Summary (collapse)

- - (Void) connect(vm, cdrom)

  Connects a virtual CD-ROM device of a powered-on virtual machine to its backing.

- - (String) create(vm, spec)

  Adds a virtual CD-ROM device to the virtual machine.

- - (Void) delete(vm, cdrom)

  Removes a virtual CD-ROM device from the virtual machine.

- - (Void) disconnect(vm, cdrom)

  Disconnects a virtual CD-ROM device of a powered-on virtual machine from its backing.

- - (Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Info) get(vm, cdrom)

  Returns information about a virtual CD-ROM device.

- - (Cdrom) initialize(config) constructor

  Constructs a new instance.

- - (Array<Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Summary>) list(vm)

  Returns commonly used information about the virtual CD-ROM devices belonging to the virtual machine.

- - (Void) update(vm, cdrom, spec)

  Updates the configuration of a virtual CD-ROM device.

## Constructor Details

### - (`Cdrom`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    631
    632
    633
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 631

    def initialize(config)
        super(config, @@service_info)
    end

## Instance Method Details

### - (`Void`) connect(vm, cdrom)

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 (`String`) —

  Virtual machine identifier.

- cdrom (`String`) —

  Virtual CD-ROM device identifier.

Returns:

- (`Void`)

Raises:

- (`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.

    825
    826
    827
    828
    829
    830
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 825

    def connect(vm, cdrom)
        invoke_with_info(@@connect_info, {
            'vm' => vm,
            'cdrom' => cdrom,
        })
    end

### - (`String`) create(vm, spec)

Adds a virtual CD-ROM device to the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- spec (`Com::Vmware::Vcenter::Vm::Hardware::Cdrom::CreateSpec`) —

  Specification for the new virtual CD-ROM device.

Returns:

- (`String`) —

  Virtual CD-ROM device identifier.

Raises:

- (`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 nil fields that default to guest-specific values.

    725
    726
    727
    728
    729
    730
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 725

    def create(vm, spec)
        invoke_with_info(@@create_info, {
            'vm' => vm,
            'spec' => spec,
        })
    end

### - (`Void`) delete(vm, cdrom)

Removes a virtual CD-ROM device from the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- cdrom (`String`) —

  Virtual CD-ROM device identifier.

Returns:

- (`Void`)

Raises:

- (`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.

    790
    791
    792
    793
    794
    795
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 790

    def delete(vm, cdrom)
        invoke_with_info(@@delete_info, {
            'vm' => vm,
            'cdrom' => cdrom,
        })
    end

### - (`Void`) disconnect(vm, cdrom)

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 (`String`) —

  Virtual machine identifier.

- cdrom (`String`) —

  Virtual CD-ROM device identifier.

Returns:

- (`Void`)

Raises:

- (`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.

    860
    861
    862
    863
    864
    865
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 860

    def disconnect(vm, cdrom)
        invoke_with_info(@@disconnect_info, {
            'vm' => vm,
            'cdrom' => cdrom,
        })
    end

### - (`Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Info`) get(vm, cdrom)

Returns information about a virtual CD-ROM device.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- cdrom (`String`) —

  Virtual CD-ROM device identifier.

Returns:

- (`Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Info`) —

  Information about the specified virtual CD-ROM device.

Raises:

- (`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.

    683
    684
    685
    686
    687
    688
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 683

    def get(vm, cdrom)
        invoke_with_info(@@get_info, {
            'vm' => vm,
            'cdrom' => cdrom,
        })
    end

### - (`Array<Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Summary>`) list(vm)

Returns commonly used information about the virtual CD-ROM devices belonging to the virtual machine.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

Returns:

- (`Array<Com::Vmware::Vcenter::Vm::Hardware::Cdrom::Summary>`) —

  List of commonly used information about virtual CD-ROM devices.

Raises:

- (`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.

    656
    657
    658
    659
    660
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 656

    def list(vm)
        invoke_with_info(@@list_info, {
            'vm' => vm,
        })
    end

### - (`Void`) update(vm, cdrom, spec)

Updates the configuration of a virtual CD-ROM device.

Parameters:

- vm (`String`) —

  Virtual machine identifier.

- cdrom (`String`) —

  Virtual CD-ROM device identifier.

- spec (`Com::Vmware::Vcenter::Vm::Hardware::Cdrom::UpdateSpec`) —

  Specification for updating the virtual CD-ROM device.

Returns:

- (`Void`)

Raises:

- (`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.

    758
    759
    760
    761
    762
    763
    764
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter/vm/hardware.rb', line 758

    def update(vm, cdrom, spec)
        invoke_with_info(@@update_info, {
            'vm' => vm,
            'cdrom' => cdrom,
            'spec' => spec,
        })
    end