lib/puppet/provider/vc_vm/default.rb
def configure_iso
    cdrom = vm.config.hardware.device.find { |hw| hw.class == RbVmomi::VIM::VirtualCdrom }

    if iso_file
      nfs_ds = add_nfs_datastore
      # attach iso from cd/DVD drive
      vm.ReconfigVM_Task(:spec => vm_reconfig_spec(nfs_ds, cdrom)).wait_for_completion
    else
      # removes only if iso is attached
      if cdrom_iso
        # detach iso from cd/DVD drive
        vm.ReconfigVM_Task(:spec => vm_reconfig_spec(nil, cdrom)).wait_for_completion
        Puppet.debug "detached Iso from cdrom"
        remove_nfs_datastore
        Puppet.debug("removed Nfs datastore from %s" % vm.name)
      end
    end
  end
# mount iso to cd drive or detach iso based on iso_file resource
# adds or removes nf data_store for mounting/unmounting  iso
mount iso to cd drive or detach iso based on iso_file resource
adds or removes nf data_store for mounting/unmounting  iso
mount iso to cd drive or detach iso based on iso_file resource adds or removes nf data_store for mounting / unmounting iso
def configure_iso
    cdrom = vm.config.hardware.device.find { |hw| hw.class == RbVmomi::VIM::VirtualCdrom }
    if iso_file
      nfs_ds = add_nfs_datastore
      vm.ReconfigVM_Task(:spec => vm_reconfig_spec(nfs_ds, cdrom)).wait_for_completion
    else
      if cdrom_iso
        vm.ReconfigVM_Task(:spec => vm_reconfig_spec(nil, cdrom)).wait_for_completion
        Puppet.debug "detached Iso from cdrom"
        remove_nfs_datastore
        Puppet.debug("removed Nfs datastore from %s" % vm.name)
      end
    end
  end
def configure_iso cdrom = vm . config . hardware . device . find { | hw | hw . class == RbVmomi :: VIM :: VirtualCdrom } if iso_file nfs_ds = add_nfs_datastore vm . ReconfigVM_Task ( :spec => vm_reconfig_spec ( nfs_ds , cdrom ) ) . wait_for_completion else if cdrom_iso vm . ReconfigVM_Task ( :spec => vm_reconfig_spec ( nil , cdrom ) ) . wait_for_completion Puppet . debug "detached Iso from cdrom" remove_nfs_datastore Puppet . debug ( "removed Nfs datastore from %s" % vm . name ) end end end
mount iso to cd drive or detach iso based on iso_file resource
adds or removes nf data_store for mounting/unmounting  iso
mount iso to cd drive or detach iso based on iso_file resource adds or removes nf data_store for mounting / unmounting iso
# attach iso from cd/DVD drive # removes only if iso is attached # detach iso from cd/DVD drive