- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Boss
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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