1 Reply Latest reply on Feb 15, 2013 7:26 AM by RvdNieuwendijk

    Script to set memory reservation on all vm's

    crawfordm Expert
    vExpert

      I am trying to write a script that will set a memory reservation on all vm's to what the vm memory is.  This way all swap files will be 0.

       

      I am not sure of $_.MemoryMB will give me the correct setting.

       

       

      $vm = Get-VM
      foreach ($vm_single in $vm)
          {Get-VMResourceConfiguration | Set-VMResourceConfiguration -MemReservationMB $_.MemoryMB
          }
      Get-VMResourceConfiguration -VM $vm_Single | Select -ExpandProperty DiskResourceConfiguration
      Thanks
      Marc