HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Application Integration
cancel
Showing results for 
Search instead for 
Did you mean: 

Possible Bug in Powershell Module: No Duplicate Snapshot Names

 
ccolht99
Advisor

Possible Bug in Powershell Module: No Duplicate Snapshot Names

I'm trying to create snapshots on a set of volumes, all with the same snap name. This is part of a dr script that clones replica volumes using a snapshot created at the primary site. Through the web UI, I can use the same snapshot name on any volumes but through the Powershell module, only one instance of a snap name is allowed.

Here's my one-liner and result:

> Get-NSVolume | ?{$_.name -match 'cloneme'} | %{New-NSSnapshot -name testing -Volume  $_.name}

Name Volume LocalCreationTime ScheduleName compressed(GB) Ratio Online Writable

---- ------ ----------------- ------------ -------------- ----- ------ --------

testing XXXXX1-cloneme 9/18/2014 7:41 AM 0        False    False

New-NSSnapshot : Snap testing is already in use

At line:1 char:61

+ Get-NSVolume | ?{$_.name -match 'cloneme'} | %{New-NSSnapshot -name ...

+ ~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-NSSnapshot

There are two volumes that match. Only the first snapshot is created.

I've tested this against v1.4 and v2.0. Also tried the latest module from Github and used Powershell v3 and v4.

I would like to trigger a volume collection replication but the New-NSSnapshot cmdlet doesn't offer that option. Feature request?

2 REPLIES
jwhyte119
Advisor

Re: Possible Bug in Powershell Module: No Duplicate Snapshot Names

Hi Chuck,

Could you provide examples of the volume names that match the query?

From a testing perspective, you could try running the command twice with more specific search strings and post back the results.

e.g.

Get-NSVolume | ?{$_.name -match 'cloneme-vol1'} | %{New-NSSnapshot -name testing -Volume  $_.name}

Get-NSVolume | ?{$_.name -match 'cloneme-vol2'} | %{New-NSSnapshot -name testing -Volume  $_.name}

Try running the command with a search string that only matches the second volume and see if that succeeds without having first created a snapshot on the first volume.

Also tagging Justin Rich, who wrote the cmdlet to see if he might have any insights to share.

Cheers,

John

ccolht99
Advisor

Re: Possible Bug in Powershell Module: No Duplicate Snapshot Names

I don't need the functionality right now as I found a better way for this particular project but it is still interesting.

Here you go:

PS C:\Users\myuser> Import-Module nimble

PS C:\Users\myuser> connect-nsarray 192.xxx.13.2

cmdlet Connect-NSArray at command pipeline position 1

Supply values for the following parameters:

Password: nimblepassword

Logged into array @ nbl-grp01

PS C:\Users\myuser> Get-NSVolume | ?{$_.name -match 'cloneme-vol1'} | %{New-NSSnapshot -name testname -Volume $_.name}

Name     Volume        LocalCreationTime ScheduleName compressed(GB) Ratio Online Writable

----     ------        ----------------- ------------ -------------- ----- ------ --------

testname cloneme-vol1 10/7/2014 10:47 AM                           0        False    False

PS C:\Users\myuser> Get-NSVolume | ?{$_.name -match 'cloneme-vol2'} | %{New-NSSnapshot -name testname -Volume $_.name}

New-NSSnapshot : Snap testname is already in use

At line:1 char:53

+ Get-NSVolume | ?{$_.name -match 'cloneme-vol2'} | %{New-NSSnapshot -name testnam ...

+                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-NSSnapshot