philoub
Contributor
Contributor

VMFS resignature in VSphere

Hi,

I want to resign the VMFS with ResignatureUnresolvedVmfsVolume_Task method.

This post contains the a part of the solution: http://communities.vmware.com/thread/229925?tstart=0.

How do I get the device path for each

volumet return by QueryUnresolvedVmfsVolume method.

Thanks.

PB

0 Kudos
5 Replies
RvdNieuwendijk
Leadership
Leadership

PB,

you can try:

Get-VMhost | Get-VMHostStorage | Format-List *

This gives you the id's you need for the QueryUnresolvedVmfsVolume method.

Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
philoub
Contributor
Contributor

Hi Robert,

I know how I get the Id of QueryUnresolvedVmfsVolume method.

My problem is to retrive the devicepath in the result of the method.

In a Powercli Shell, I get only these values

$_this = Get-View -Id 'HostStorageSystem-storageSystem-30'

$_this.QueryUnresolvedVmfsVolume()

Extent : {4b98c31d-4744effd-6dc9-0026b975fa23}

VmfsLabel : VMFS-Data_4

VmfsUuid : 4b98c31d-4744effd-6dc9-0026b975fa23

TotalBlocks : 511744

ResolveStatus : VMware.Vim.HostUnresolvedVmfsVolumeResolveStatus

DynamicType :

DynamicProperty :

But when I invoke the same method in Manager Object Browser, in the return value extent of type HostUnresolvedVmfsExtent[], I get the devicepath (see image in attachment)

PB

0 Kudos
LucD
Leadership
Leadership

The extent property points to an array of HostUnresolvedVmfsExtent objects.

With these lines you list the diskName and devicePath.

$esxName = <esx-name>

$storSys = Get-View (Get-VMHost $esxName | Get-View).ConfigManager.StorageSystem
$result = $storSys.QueryUnresolvedVmfsVolume()
$result.extent | %{
	Write-Host $_.device.diskName $_.DevicePath
}

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
philoub
Contributor
Contributor

Hi LucD,

I just started last week in powershell.

You are a great help in learning with your various contributions.

I try your script and I get the same result with null values.

I modify a little bit your script and if you can understand my problem:

The modified script:

$esxName = ....

$_.device.diskName $_.DevicePath

C:\Scripts>

I dont' understand why I can't get the same results like in Manger Object Browser?.

Thanks for your help

0 Kudos
kthomas45
Contributor
Contributor

I am a powercli novice but am experiencing a similar issue resignaturing disk. I run the commands below and the second paragraph shows the error/message.  Can someone tell me what I need within the () if anything?

$storSys = Get-View (Get-VMHost $esxhost | Get-View).ConfigManager.StorageSystem$result = $storSys.QueryUnresolvedVmfsVolume()

$result = $storSys.QueryUnresolvedVmfsVolume()

Error
Exception calling "QueryUnresolvedVmfsVolume" with "0" argument(s): "The operation has timed out" t line:1 char:45
$result = $storSys.QueryUnresolvedVmfsVolume <<<< ()
   + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
   + FullyQualifiedErrorId : DotNetMethodException

0 Kudos