Automation

 View Only
  • 1.  SDRS recommendations executing one at a time

    Posted Nov 24, 2021 12:56 PM

    Hi,

    Have a Storage array that doesn't do well with multiple concurrent storage vmotions.

    Would like to run SDRS recommendation one at a time as to not overload it.
    Found plenty of code to apply all the recommendations (like below from  ) but my powershell is not strong enough to figure out how to have it execute synchronously

    If anyone could help I'd be very grateful 

     

    $dscName = 'MyDSC'

    $dsc = Get-View -ViewType StoragePod -Filter @{'Name'=$dscName}

    $si = Get-View ServiceInstance

    $storMgr = Get-View -Id $si.Content.StorageResourceManager

    $storMgr.RefreshStorageDrsRecommendation($dsc.MoRef)

    $dsc.UpdateViewData()

    if($dsc.PodStorageDrsEntry.Recommendation){

        $dsc.PodStorageDrsEntry.Recommendation | %{

            $storMgr.ApplyStorageDrsRecommendationToPod_Task($dsc.MoRef,$_.Key)

        }

    }



  • 2.  RE: SDRS recommendations executing one at a time

    Posted Nov 24, 2021 01:12 PM

    Change the method ApplyStorageDrsRecommendationToPod_Task to ApplyStorageDrsRecommendationToPod, then it will run synchronously.