lib/puppet/provider/vc_vm/default.rb
# Spec for creating virtualCdRom and attach iso if required
# it creates CDROM with iso image on the nfs_datastore each time creating new_vm
#
# @note iso needs to be detached before removing nfs_datastore
# @param datastore [RbVmomi::VIM.Datastore]
# @param cdrom [RbVmomi::VIM.VirtualCdrom] object of the existing cd_drive for edit operation
#
# @return [RbVmomi::VIM.VirtualDeviceConfigSpec]
Spec for creating virtualCdRom and attach iso if required
it creates CDROM with iso image on the nfs_datastore each time creating new_vm
Spec for creating virtualCdRom and attach iso if required it creates CDROM with iso image on the nfs_datastore each time creating new_vm
def cdrom_spec(datastore=nil, cdrom=nil)
    disk = RbVmomi::VIM.VirtualCdrom(
        :backing => cd_drive_backing_info(datastore),
        :connectable => virtualcd_connect_info(datastore),
        :controllerKey => cdrom ? cdrom.controllerKey : 201, 
        :key => cdrom ? cdrom.key : 999,
        :unitNumber => cdrom ? cdrom.unitNumber : 0
    )
   if cdrom
     config = {
         :device => disk,
         :operation => RbVmomi::VIM.VirtualDeviceConfigSpecOperation("edit")
     }
   else
     config = {
         :device => disk,
         :operation => RbVmomi::VIM.VirtualDeviceConfigSpecOperation("add")
     }
   end
    RbVmomi::VIM.VirtualDeviceConfigSpec(config)
  end
def cdrom_spec ( datastore = nil , cdrom = nil ) disk = RbVmomi :: VIM . VirtualCdrom ( :backing => cd_drive_backing_info ( datastore ) , :connectable => virtualcd_connect_info ( datastore ) , :controllerKey => cdrom ? cdrom . controllerKey : 201 , :key => cdrom ? cdrom . key : 999 , :unitNumber => cdrom ? cdrom . unitNumber : 0 ) if cdrom config = { :device => disk , :operation => RbVmomi :: VIM . VirtualDeviceConfigSpecOperation ( "edit" ) } else config = { :device => disk , :operation => RbVmomi :: VIM . VirtualDeviceConfigSpecOperation ( "add" ) } end RbVmomi :: VIM . VirtualDeviceConfigSpec ( config ) end
Spec for creating virtualCdRom and attach iso if required
it creates CDROM with iso image on the nfs_datastore each time creating new_vm
Spec for creating virtualCdRom and attach iso if required it creates CDROM with iso image on the nfs_datastore each time creating new_vm
#IDE Controllers start at 200 # edit cd_drive if vm is created and cd drive already exists else add cd_drive
None
RbVmomi::VIM.VirtualDeviceConfigSpec
datastore
cdrom
object of the existing cd_drive for edit operation
object of the existing cd_drive for edit operation
None
note
iso needs to be detached before removing nfs_datastore
iso needs to be detached before removing nfs_datastore