VMware Cloud Community
Papires
Contributor
Contributor
Jump to solution

"esxcli storage vmfs snapshot mount" em powercli?

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
9 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Jump to solution

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:\>

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Which vSphere version are you running ?

The esxcli commands changed between vSphere 4 & 5


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

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Reply
0 Kudos
Papires
Contributor
Contributor
Jump to solution

I am using VShere 5.0...

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Reply
0 Kudos
Papires
Contributor
Contributor
Jump to solution

Tks ALL.... for answer...

It's correct arguments...

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Reply
0 Kudos
Papires
Contributor
Contributor
Jump to solution

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

Smiley Happy

Reply
0 Kudos