Automation

 View Only
  • 1.  Retrieve Disk Mode

    Posted Jul 16, 2008 12:51 PM

    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



  • 2.  RE: Retrieve Disk Mode

    Posted Jul 16, 2008 02:07 PM

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



  • 3.  RE: Retrieve Disk Mode

    Posted Jul 17, 2008 09:10 AM

    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?



  • 4.  RE: Retrieve Disk Mode
    Best Answer

    Posted Jul 17, 2008 10:30 AM

    There is indeed a bug in the persistence mode in the Toolkit. See Carter's remark in .



  • 5.  RE: Retrieve Disk Mode

    Posted Jul 17, 2008 12:31 PM

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