Application Integration
1752584 Members
4098 Online
108788 Solutions
New Discussion юеВ

Re: Powershell - New-NSVolume does not work

 
SOLVED
Go to solution
jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

What version of powershell are you using? and is it 32 or 64 bit?

brichardson15
Occasional Advisor

Re: Powershell - New-NSVolume does not work

64bit 4.0

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

hmm make sure the DLL is unblocked, nothing else comes to mind. if it was an older version of PS (1 or 2) or 32bit i could see it being a problem, but you should be good..

brichardson15
Occasional Advisor

Re: Powershell - New-NSVolume does not work

And....it started working.

Thanks for humoring me...

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

I'm using Powershell 4.0, Nimble Module v2, Nimble Version 2.2.5.0-197583-opt and am trying to clone a snapshot from a replica volume.

I upgraded to v2 per above, but I'm getting Error Creating Volume NIMBLE-SERVER-D-NAME! code: SMeinval.

After going through variations of inputs on New-NSClone, changing the length of the names, using different names, etc. I cannot get this to work unless I use the same name for the Snapshot and Clone volume.

     New-NSClone -Name test -Volume NIMBLE-SERVER-D-NAME -Snap test

     New-NSClone -Name BilboBaggins -Volume NIMBLE-SERVER-D-NAME -Snap BilboBaggins

     New-NSClone -Name Bilbo-Baggins -Volume NIMBLE-SERVER-D-NAME -Snap Bilbo-Baggins

What doesn't work is any variation using the actual clone name I want and any of the snapshots created by the Nimble.

     New-NSClone -Name NIMBLE-SERVER-D-NAME-RECENTMONTHLY -Volume NIMBLE-SERVER-D-NAME - Snap FileServerVCenter-DAILY-2015-04-30::01:00:00.000

     New-NSClone -Name BilboBaggins2 -Volume NIMBLE-SERVER-D-NAME -Snap Bilbo-Baggins

To me it seems as though the clone name must match the snapshot name, otherwise you get SMeinval. I've also noticed you can't use a colon in the volume name. So, if you use a time stamp in your snapshot using the Nimble naming convention, you can't create a volume with the same name as the snapshot.

This isn't ideal for my scenario, since there is no relation between the time stamped snapshot name and the scheme I want to use of VOLUMENAME-RECENTMONTHLY for the clone name.

Thanks in advance, Terry

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

yeah so try doing Get-NSSnapshot, see how it returns the names, also you might want to quote it because : is in many cases special.

also, you can pipe the snapshot to the new-nsclone (i think, if i recall right)

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

Let me clarify, I do not want my volume to have the same name as the snapshot. I was just listing this as an example.

No matter what I do, unless the snapshot has the same name as the clone I am creating, this doesn't work.

         

This example works:

          New-NSClone -Name test -Volume NIMBLEVOL -Snap test


This example does not work:

          New-NSClone -Name test2 -Volume NIMBLEVOL -Snap test


Whether it's a volume or a volume replica, this only works when I use the same name for the clone as I do the snapshot.


Also, you can't create a volume with a : via the GUI, must be an illegal character.

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

OK, to fix this I had to completely blow away all of the Nimble powershell files, copy them again, then run install.ps1.


I guess it was holding onto some old dlls or something.

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

Nope, it's not fixed. Here is my actual code:

PS C:\Users\terry> $vol = "terrytest"

PS C:\Users\terry> $cloneVol = Get-NSVolume -Name $vol

PS C:\Users\terry> $strClonevol = $vol + "-RECENTMONTHLY"

PS C:\Users\terry> $snap = Get-NSSnapShot | where {($_.name -match "test")}

PS C:\Users\terry> New-NSClone -Name $strClonevol -Volume $cloneVol -Snap $snap

New-NSClone : Error Creating volume terrytest-RECENTMONTHLY! code: SMeinval

At line:1 char:1

+ New-NSClone -Name $strClonevol -Volume $cloneVol -Snap $snap

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

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

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

So now I try just putting a string for the name of the volume:

PS C:\Users\terry> New-NSClone -Name test2 -Volume $cloneVol -Snap $snap

New-NSClone : Error Creating volume test2! code: SMeinval

At line:1 char:1

+ New-NSClone -Name test2 -Volume $cloneVol -Snap $snap

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

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

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

Now I change the snap to use a string:

PS C:\Users\terry> New-NSClone -Name test2 -Volume $cloneVol -Snap test

New-NSClone : Error Creating volume test2! code: SMeinval

At line:1 char:1

+ New-NSClone -Name test2 -Volume $cloneVol -Snap test

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

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

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

Now I am using strings to identify everything:

PS C:\Users\terry> New-NSClone -Name test2 -Volume terrytest -Snap test

New-NSClone : Error Creating volume test2! code: SMeinval

At line:1 char:1

+ New-NSClone -Name test2 -Volume terrytest -Snap test

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

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

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

Quoted:

PS C:\Users\terry> New-NSClone -Name "test2" -Volume "terrytest" -Snap "test"

New-NSClone : Error Creating volume test2! code: SMeinval

At line:1 char:1

+ New-NSClone -Name "test2" -Volume "terrytest" -Snap "test"

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

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

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

Using the same name for the new clone as the snapshot:

PS C:\Users\terry> New-NSClone -Name "test" -Volume "terrytest" -Snap "test"

Name Online ReadOnly MultiInit Clone PerfPolicy Size(GB) Compressed(GB) Uncompressed(GB) Ratio Connections

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

test True   False    False     True  default           1              0                0                 0

I am connected to a different array when I ran the above. It's at version 2.1.7.0-151109-opt

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

Further to my previous, initially this is the code I tried to get working, which also failed.

    

          $vol = terrytest

          $cloneVol = Get-NSVolume -Name $vol

          $strClonevol = $vol + "-RECENTMONTHLY"

          $snap = Get-NSSnapShot | where {($_.Volume -eq $vol) -and ($_.LocalCreationTime.Day -eq "1") -and ($_.localCreationTime.Month -like $today.Month) -and ($_.localCreationTime.Year -like $today.year)} | select -first 1

          New-NSClone -Name $strClonevol -Volume $cloneVol -Snap $snap

Thanks