Hi All,
Thanks in Advance.
For creating build verification documents, I need to check if the particular VM is enabled with multi writer disk's or not .Any help much appreciated.
I need a report some thing like the following.
Header 1 | Header 2 | Header 3 | Header 2 |
---|---|---|---|
Capacity GB | StorageFormat | Filename | Multi-writer |
40 GB | EagerZeroedThick | [LUN-1]vmtest.vmdk | no |
60 GB | EagerZeroedThick | [LUN-1]vmtest_1.vmdk | yes |
In 6.5 the Backing property seems to work.
So it looks like in 6 one needs to check the VMX (I'll verify that in any case)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
On 6 the Backing seems to provide the multi-writer state as well.
Only until 5.5 do you need to access the VMX (through the Get-AdvancedSettings cmdlet).
The following script test the version, and retrieves the setting accordingly
Get-VM | Get-HardDisk | %{
$ctrl = Get-ScsiController -HardDisk $_
$_ | Select @{N='VM';E={$_.Parent.Name}},
Name,
StorageFormat,
FileName,
@{N='Multi-Writer';E={
if($_.Parent.VMHost.ApiVersion -le "5.5"){
$ctrl = Get-ScsiController -HardDisk $_
Get-AdvancedSetting -Entity $_.Parent -Name "scsi$($ctrl.ExtensionData.BusNumber):$($_.ExtensionData.UnitNumber).sharing" |
Select -ExpandProperty Value
}
else{
$_.ExtensionData.Backing.Sharing
}
}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Excellent, thanks a lot for your effort, its working as I expected.
Hi LuCD,
Hope you are doing good.
After long break coming back to same thread. You have provided me the script to get "Multiwriter" has been enabled for VM's. Thats works great too.
I just want to have the same kind of script to get same "Multiwriter" has been enabled for specific list of VM's. Which means I would be having the list of VM's in .csv format and providing this an input and it has to get whether those VM's are enabled with "Multiwriter" or not.
Can you please help me on this..
Thanks in advance
Sure, but I suggest you open a new thread for that.
That makes it easier for others to find it.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference