Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 252940

Re: changing vm storage drs automation level

$
0
0

You will have to use the ConfigureStorageDrsForPod_Task method to change the settings for SDRS.

In the StorageDrsConfigSpec object you can disable this.

Combined with your Where-clause this could be something like this

 

 

$storMgr=Get-ViewStorageResourceManager
$pod
=Get-DatastoreCluster-Name$datastorecluster
$spec
=New-ObjectVMware.Vim.StorageDrsConfigSpec$pod.ExtensionData.PodStorageDrsEntry.StorageDrsConfig.VmConfig|where {(Get-View$_.VM|Select-ExpandPropertyName) -like"*_replica"} |%$entry=New-ObjectVMware.Vim.StorageDrsVmConfigSpec
  $entry.Operation="edit"
  $entry.Info=$_
 
$entry.Info.Enabled=$false
  $spec.vmConfigSpec+=$entry
}$storMgr.ConfigureStorageDrsForPod($pod.ExtensionData.MoRef,$spec,$true)

 

Note that the Get-DatastoreCluster cmdlet can be used to replace my function


Viewing all articles
Browse latest Browse all 252940

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>