Hi guys,
I found the below article, and found it very useful for me to audit guest datastore settings across our vCenters.
Script to check for VM Automation Level in a Datastore Cluster
However, I noticed a large chunk of machines were regularly missing from:
$dsc.Extensiondata.PodStorageDrsEntry.StorageDrsConfig.VmConfig
Some datastores were returning zero results, even with VMs in there!
Upon further investigation, I found I have to manually right click, edit settings, and click "OK" (vic not webclient) on the datastore cluster.
This creates a "Configure Storage DRS" event & populates the missing machines within in VmConfig.
After doing this, I noticed some machines started migrating using SDRS! I believe SDRS will not function properly for the machines that are missing config.
I have seen this on the following:
- vCenter Server 6.0.0 3339084 - Populated with hosts running ESXi 6.0.0 3380124
- vCenter Server 6.0.0 5318203 - Populated with hosts running ESXi 6.0.0 5050593
I made a quick powercli script to highlight these bugged datastore clusters:
Get-DatastoreCluster | ForEach {
$SDRSVMs = $_.Extensiondata.PodStorageDrsEntry.StorageDrsConfig.VmConfig
$VMs = Get-DatastoreCluster -id $_.id | get-vm
$CountVMs = ($VMs.Count)
$CountMissingVMs = ($VMs | where {$_.ID -notin $SDRSVMs.Vm}).count
if ($CountMissingVMs -gt 0) {
Write-Host $_.Name 'contains' $CountVMs 'VMs, with' $countMissingVMs 'VMs missing config'
}
}
Results are a bit crazy across our vCenters:
xxx contains 177 VMs, with 172 VMs missing config
xxx contains 66 VMs, with 66 VMs missing config
xxx contains 37 VMs, with 37 VMs missing config
xxx contains 10 VMs, with 10 VMs missing config
xxx contains 5 VMs, with 5 VMs missing config
xxx contains 59 VMs, with 51 VMs missing config
xxx contains 61 VMs, with 61 VMs missing config
xxx contains 41 VMs, with 41 VMs missing config
xxx contains 32 VMs, with 32 VMs missing config
xxx contains 20 VMs, with 6 VMs missing config
xxx contains 65 VMs, with 64 VMs missing config
xxx contains 25 VMs, with 25 VMs missing config
xxx contains 9 VMs, with 9 VMs missing config
xxx contains 16 VMs, with 16 VMs missing config
xxx contains 42 VMs, with 8 VMs missing config
xxx contains 35 VMs, with 32 VMs missing config
xxx contains 55 VMs, with 22 VMs missing config
xxx contains 32 VMs, with 32 VMs missing config
xxx contains 91 VMs, with 78 VMs missing config
xxx contains 1 VMs, with 1 VMs missing config
Can anyone else verify this behavior on their platforms & advise?
I'm not sure if this is a known bug, or if a VMware representative wants to have a look?
I think you might be missing the fact the if a VM is not in that list, it will take the global DSC settings.
See also StorageDrsConfigInfo
So if SDRS is not behaving as you expect it, you should probably look into the DSC global settings.
The VMs you mention explicitely are those that you do not want to use the global SDRS settings on the DSC.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I think you might be missing the fact the if a VM is not in that list, it will take the global DSC settings.
See also StorageDrsConfigInfo
So if SDRS is not behaving as you expect it, you should probably look into the DSC global settings.
The VMs you mention explicitely are those that you do not want to use the global SDRS settings on the DSC.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks, that makes sense.
It still doesn't explain the strange behavior I saw.
SDRS started trying to move VMs with Physical SCSI controllers after clicking "Ok" (they didn't move but it tried)
I know SDRS looks at SDRS rules when considering svMotions, but I'm not sure it actually looks at the controller to check if it is physically or virtually being shared.
I guess the svMotion will just fail.
I don't have a vSphere 6 handy anymore, so I'm afraid I can test right now.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference