Hi,
How can I retrieve the mode of a virtual Disk? (Independent Yes/No, Persistent Yes/No, Compatibility Mode of a mapped Lun).
Regards,
Tobias
There is indeed a bug in the persistence mode in the Toolkit. See Carter's remark in .
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
$hd = Get-HardDisk -Vm/Snapshot/or Template $myVm
$hd.Persistence will give one of the followin: Persistent/NonPersistent/IndependentPersistent/IndependentNonpersistent/Undoable
Is this what are you looking for ?
Yes, thats what I'm looking for... But it doesn't work correctly.
Here is the code I execute and the output of it:
$hd = Get-VM -name epimetheus | Get-HardDisk
$totalcapacity = 0
$hd | foreach-object {
$totalcapacity += $_.CapacityKB
Write-Host $_.Name "" -nonewline
Write-Host $_.DiskType "" -nonewline
Write-Host $_.Persistence "" -nonewline
Write-Host $_.CapacityKB
}
Write-Host $totalcapacity
Output:
Hard Disk 1 Flat Persistent 10485760
Hard Disk 2 Raw Persistent 158334976
168820736
But, as you can see in the screenshot, "Hard Disk 2" is configured as IndependentPersistent. Is this a bug in VIM?
Another Question: How can I get the "Compatibility Mode" of the Raw Disk?
There is indeed a bug in the persistence mode in the Toolkit. See Carter's remark in .
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
So, I have to wait for an updated/bugfixed Tooolkit version =(