VMware Cloud Community
Herbert4711
Contributor
Contributor

How to find replicated volumes

Hi all,

I'm scripting with Powershell for preparing a desaster recovery scenario with vSphere 5.1.


I assume, that the primary datacenter is down and I have mapped the replicated volumes of

Compellent storage to a single ESXi-host in the DR-datacenter, which is not connected to vCenter.

If I use the GUI, I can see and add the volumes to the mounted drives without resignature them.


How can I find them with powershell and mount them?

I have found a lot of examples, which are all using "$dsView.QueryUnresolvedVmfsVolumes()"

I just have tested some more with this small script (I'm connected to the ESXi-Host):

$hostView = get-vmhost -name $ESXiIP | get-view

$dsView = get-view $hostView.ConfigManager.DatastoreSystem

$unBound = $dsView.QueryUnresolvedVmfsVolumes()

Her I get the following error-message:

Method invocation failed because [System.Object[]] doesn't contain a method named 'QueryUnresolvedVmfsVolumes'.

At C:\Tools\Powershell\FindVol.ps1:3 char:46

+ $unBound = $dsView.QueryUnresolvedVmfsVolumes <<<< ()

    + CategoryInfo          : InvalidOperation: (QueryUnresolvedVmfsVolumes:String) [], RuntimeException

    + FullyQualifiedErrorId : MethodNotFound


Is that method changed in vSpher 5.1?


I found another method via CLI to do that:


$esxcli = Get-EsxCli -VMHost (Get-VMHost -Name) and


$vmfs in $esxcli.storage.vmfs.snapshot.list()

Here I don't see the volume too; I can only see all volumes via $esxcli.storage.vmfs.extent.list()

but I can't mount that.


Is that the wrong way to do that or do I do that in a wrong way?


All help appriciated


Herbert

Tags (3)
0 Kudos
2 Replies
ssbkang
Enthusiast
Enthusiast

So have you mounted the replicated volume on the destination ESXi server?

Not sure what storage unit you use but this is what I do for the disaster recovery:

  1. Stop the replication between two sites (storage level vDisks)
  2. Map the target vDisk on the destination ESXi server
  3. Use esxcli storage vmfs snapshot list to check
  4. Mount the volume keeping the signature esxcli storage vmfs snapshot mount -l "VMFS name"
0 Kudos
Herbert4711
Contributor
Contributor

Hello ssbkang,

that's my problem. I can't mount it because I don't find it.

And I don't find it, because one method/statement seems to be wrong and the other (via ESXCLI) don't give me the correct answer.

I want to do it by powershell and not CLI, but what I believe is that the second method, which I have used

     $esxcli = Get-EsxCli -VMHost (Get-VMHost -Name $esxiip)

     $esxcli.storage.vmfs.snapshot.list()

is the same using CLI from within powershell.

And this statement doesn't show me the storage, which I can see in the GUI.

I don't think, it's a problem of the storage, it's a problem of vSphere.

I have rebuilt that scenario in my home lab with iscsi-storage from Freenas and have the same results.

Thank you

Regards

0 Kudos