VMware Cloud Community
tobru
Contributor
Contributor
Jump to solution

Retrieve Disk Mode

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

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
4 Replies
yboychev
Hot Shot
Hot Shot
Jump to solution

$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 ?

tobru
Contributor
Contributor
Jump to solution

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?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
tobru
Contributor
Contributor
Jump to solution

So, I have to wait for an updated/bugfixed Tooolkit version =(

0 Kudos