Papires
Contributor
Contributor

"esxcli storage vmfs snapshot mount" em powercli?

Jump to solution

Hi!!!

Hello,

I need to run this command: esxcli storage vmfs snapshot mount -l "DATASTORE"

In powercli or ViJava ... Does anyone have the exact command for this command? Have looked and not found in the documentation ....

Thank you.

0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership

While looking better at the mount method, I see that it needs three parameters:

boolean mount(boolean nopersist, string volumelabel, string volumeuuid)

Can you try again with the following commands:

$esxcli = Get-EsxCli -VMHost "YourHost"
$esxcli.storage.vmfs.snapshot.mount($false,"TESTE-DATASTORE",$null)

Message was edited by: RvdNieuwendijk

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

View solution in original post

0 Kudos
9 Replies
RvdNieuwendijk
Leadership
Leadership

Welcome to the VMware VMTN Communities.

In PowerCLI you can try:

$esxcli = Get-EsxCli -VMHost "YourHost"
$esxcli.storage.vmfs.snapshot.mount.invoke("DATASTORE")

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

Tks for welcome RvdNieuwendijk....


So, I run this command. But, show an error in the argument. Do you know what the argument correct?


PowerCLI C:\> $esxcli = Get-EsxCli -VMHost "srvvmrackc01.cccsp.com.br"
PowerCLI C:\> $esxcli.storage.vmfs.snapshot.mount.invoke("TESTE-DATASTORE")
Exception calling "Invoke" with "1" argument(s): "A specified parameter was not  correct. argument[0]"
At line:1 char:43
+ $esxcli.storage.vmfs.snapshot.mount.invoke <<<< ("TESTE-DATASTORE")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

PowerCLI C:\>

0 Kudos
LucD
Leadership
Leadership

Which vSphere version are you running ?

The esxcli commands changed between vSphere 4 & 5


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

0 Kudos
RvdNieuwendijk
Leadership
Leadership

He is probably running vSphere 5 because there is no $esxcli.storage property in v4.

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

I am using VShere 5.0...

0 Kudos
RvdNieuwendijk
Leadership
Leadership

While looking better at the mount method, I see that it needs three parameters:

boolean mount(boolean nopersist, string volumelabel, string volumeuuid)

Can you try again with the following commands:

$esxcli = Get-EsxCli -VMHost "YourHost"
$esxcli.storage.vmfs.snapshot.mount($false,"TESTE-DATASTORE",$null)

Message was edited by: RvdNieuwendijk

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

View solution in original post

0 Kudos
Papires
Contributor
Contributor

Tks ALL.... for answer...

It's correct arguments...

0 Kudos
RvdNieuwendijk
Leadership
Leadership

Your question inspired me to create a blog post about how I came to the answer. The blog post also shows all the possible PowerCLI ESXCLI commands for vSphere 4 and vSphere 5. And it shows a PowerCLI function that generates the lists of PowerCLI ESXCLI commands. You can find the blog post here:

How to list all the PowerCLI ESXCLI commands

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

Congratulations for the article.
Hope you can help many people!!!

Smiley Happy

0 Kudos