Application Integration
1828584 Members
2741 Online
109982 Solutions
New Discussion

Re: Powershell - New-NSVolume does not work

 
SOLVED
Go to solution
krisz2171
New Member

Powershell - New-NSVolume does not work

Hi All,

We have recently purchased Nimble and so far we are very happy with it. I was very happy when saw that there is a Powershell Module available so thank you for the great job to the community! I thought I am using powershell for setup the volumes but does not matter how and what I do the New-NSVolume always drops an error. Does not matter I just run the New-NSVolume cmdlet and add the attrbutes manually or just copy and paste the example command as is (New-NSVolume -Name testvol -Size 1tb -Description "powershell test" -PerformancePolicy default) I always get this error

> New-NSVolume -Name testvol -Size 10gb -Description "powershell test" -PerformancePolicy default

New-NSVolume : Error Creating volume testvol! code: SMeinval

At line:1 char:1

+ New-NSVolume -Name testvol -Size 10gb -Description "powershell test" -Performanc ...

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

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

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

and Nimble syslog drops this:

ErrorDR2-ARRAY01-A NMBL: Failed to create volume . Invalid argument

but does not tell unfortunately which argument is invalid.

My nimble is running on 2.2.5.0-197583-opt software and I have tried this on win8.1 powershell 3.0 as well as on a Win 2012 R2 server as well with the Nimble Powershell module version 1.1.20140407.1024.

Do I something wrong or could be a change in the Nimble software? I hope you can help me.

Many thanks

Krisz

29 REPLIES 29
aquaman27
New Member

Re: Powershell - New-NSVolume does not work

Krisz,

I just forwarded your issue to Justin who has written the PowerShell module.  Stay tuned for some help.

Ryan

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

I'm guessing you are on the newer firmware. If you take a look at the github repo there is a v2 branch. Download and try that.

It's still a work in progress but it should fix the new volume issue

brichardson15
Occasional Advisor

Re: Powershell - New-NSVolume does not work

I'm unable to download V2 when running this command...

iex (new-object System.Net.WebClient).DownloadString('https://github.com/jrich523/NimblePowerShell/tree/v2/Install.ps1')

I receive this error...

Exception calling "DownloadString" with "1" argument(s): "The request was aborted: The connection was closed unexpectedly."

At line:1 char:1

+ iex (new-object System.Net.WebClient).DownloadString('https://github.com/jrich52 ...

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

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : WebException

Am I attempting to download incorrectly?

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

I havent modified the installer to allow for options. right now it will only install the V1 version, you'll need to manually download the V2 branch and put it in your module folder.

Since I use that installer for a few things, I should probably make a more flexible version of it, but, i've got a long list of things to complete

brichardson15
Occasional Advisor

Re: Powershell - New-NSVolume does not work

Thanks for the reply...When I download version 2 and add it to my module directory I get this error when I try to run import-module Nimble

Import-Module : Could not load file or assembly 'file:///C:\Users\XXX\Documents\WindowsPowerShell\Modules\Nimble\NimbleGM.dll' or one of its dependencies. Operation is not supported.

(Exception from HRESULT: 0x80131515)

At line:3 char:5

+     Import-Module Nimble

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

    + CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException

    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

jrich52352
Trusted Contributor
Solution

Re: Powershell - New-NSVolume does not work

Chances are its because the file is blocked, you typically want to unblock the zip, but you can unblock in PS

Join-Path (split-path $profile) \modules\Nimble | gci | Unblock-File

something like that should work

brichardson15
Occasional Advisor

Re: Powershell - New-NSVolume does not work

I answer the pop up to unblock the file and allow it to run when I run the Install.ps1 file.  But I receive a 404 error within PowerShell when it tries to run...

Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."

At C:\Users\eng_bxr\Documents\WindowsPowerShell\Modules\Nimblev2\Install.ps1:27 char:59

+ (Import-LocalizedData -FileName Nimble.psd1).filelist | %{$wc.DownloadFile("http ...

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

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : WebException

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

no need to run the install, its just there because of the specialized install via the cmdline... you just need to import the module and connect

ipmo Nimble

connect-nsarray -system 1.2.3.4 -username admin -password whatever

brichardson15
Occasional Advisor

Re: Powershell - New-NSVolume does not work

Ok, then this just flat out doesn't work for me....I've run this unblock you recommended.

Join-Path (split-path $profile) \modules\Nimble | gci | Unblock-File


And copied the V2 module files from the Zip I downloaded into my profile module directory.  And after the import of the module I get the error I poster earlier.


Import-Module : Could not load file or assembly 'file:///C:\Users\XXX\Documents\WindowsPowerShell\Modules\Nimble\NimbleGM.dll' or one of its dependencies. Operation is not supported.

(Exception from HRESULT: 0x80131515)

At line:3 char:5

+     Import-Module Nimble

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

    + CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException

    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

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

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

Close powershell, delete the module file, download v2, DO NOT run the

install, just open ps and import it

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

The reason I ran the installer is because this is the error I got when I just imported the module:

PS C:\Users\terry> New-NSClone

New-NSClone : Unable to find type [snap]. Make sure that the assembly that contains this type is loaded.

At line:1 char:1

+ New-NSClone

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

    + CategoryInfo          : InvalidOperation: (snap:TypeName) [], RuntimeException

    + FullyQualifiedErrorId : TypeNotFound

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

Did you unblock the zip after downloading?

Terry Zolinski
Advisor

Re: Powershell - New-NSVolume does not work

It wasn't blocked. I just downloaded V2 again and it's not blocked.

jrich52352
Trusted Contributor

Re: Powershell - New-NSVolume does not work

If you run the install it will grab v1 and overwrite what you downloaded.