Hello,
I have two inquiries please:
1- I 'm creating a lot of VMDKs, and I need a simple command to enable "multi-writer" mode. I came across a complicated script that I have no time now to tune ot, so, I hope I get a simple command to achieve this.
2- I need to query the disks and list )select) their sharing mode, and current storage policy.
Thank you,
1. There is no cmdlet for that if that is what you mean by 'simple' command.
You need to call the API method
2. After a Get-HardDisk you can get the sharing mode via a calculated property
@{N='HDSharingMode';E={$_.ExtensionData.Backing.Sharing}}
You can find the storage policy for harddisks with the Get-SpbmEntityConfiguration cmdlet.
Get-SpbmEntityConfiguration
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
1. There is no cmdlet for that if that is what you mean by 'simple' command.
You need to call the API method
2. After a Get-HardDisk you can get the sharing mode via a calculated property
@{N='HDSharingMode';E={$_.ExtensionData.Backing.Sharing}}
You can find the storage policy for harddisks with the Get-SpbmEntityConfiguration cmdlet.
Get-SpbmEntityConfiguration
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Boss
Hi LucD!
This was very useful for me. I am trying to generate a list of all hosts which I need to patch (everything not presently running 7.0.3c) which contain VMs which have shared multi-writer disks. The following works:
Get-VMHost | Where-Object {$_.version -notmatch "7.0.3"} | get-vm -PipelineVariable vm | Get-HardDisk | Where-Object {$_.ExtensionData.Backing.Sharing -in 'sharingMultiWriter'} | Select Parent,@{N='VMHost';E={$vm.VMHost.Name}} | Out-Default
This only issue is that VMs which have mutliple shared disks appear in the output mulitple times. Is there a way to prune the output so that the result only appears once?
Thanks!
With Sort-Object and the Unique switch
Get-VMHost | Where-Object {$_.version -notmatch "7.0.3"} |
Get-VM -PipelineVariable vm |
Get-HardDisk |
Where-Object {$_.ExtensionData.Backing.Sharing -in 'sharingMultiWriter'} |
Select Parent,@{N='VMHost';E={$vm.VMHost.Name}} |
Sort-Object -Property Parent -Unique |
Out-Default
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference