lib/puppet/provider/vc_vm/default.rb
#  create virtual device config spec for disk
create virtual device config spec for disk
create virtual device config spec for disk
def disk_spec(file_name, size, unit)
    disk = RbVmomi::VIM.VirtualDisk(
      :backing => disk_backing(file_name),
      :controllerKey => 0,
      :key => 0,
      :unitNumber => unit,
      :capacityInKB => size
    )
    config = {
        :device => disk,
        :fileOperation => RbVmomi::VIM.VirtualDeviceConfigSpecFileOperation('create'),
        :operation => RbVmomi::VIM.VirtualDeviceConfigSpecOperation('add')
    }
    if vsan_data_store?(file_name) && resource[:vm_storage_policy]
      config[:profile] = [VIM::VirtualMachineDefinedProfileSpec(
          :profileId => profile(resource[:vm_storage_policy]).profileId.uniqueId
      )]
    end
    RbVmomi::VIM.VirtualDeviceConfigSpec(config)
  end
def disk_spec ( file_name , size , unit ) disk = RbVmomi :: VIM . VirtualDisk ( :backing => disk_backing ( file_name ) , :controllerKey => 0 , :key => 0 , :unitNumber => unit , :capacityInKB => size ) config = { :device => disk , :fileOperation => RbVmomi :: VIM . VirtualDeviceConfigSpecFileOperation ( 'create' ) , :operation => RbVmomi :: VIM . VirtualDeviceConfigSpecOperation ( 'add' ) } if vsan_data_store? ( file_name ) && resource [ :vm_storage_policy ] config [ :profile ] = [ VIM :: VirtualMachineDefinedProfileSpec ( :profileId => profile ( resource [ :vm_storage_policy ] ) . profileId . uniqueId ) ] end RbVmomi :: VIM . VirtualDeviceConfigSpec ( config ) end
create virtual device config spec for disk
create virtual device config spec for disk
file_name
size
unit