29 Replies Latest reply: Jul 23, 2015 2:13 PM by Terry Zolinski RSS

    Powershell - New-NSVolume does not work

    Krisztian Kenderesi Newbie

      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

        • Re: Powershell - New-NSVolume does not work
          Wayfarer

          Krisz,

           

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

           

          Ryan

          • Re: Powershell - New-NSVolume does not work
            Justin Rich Adventurer

            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

              • Re: Powershell - New-NSVolume does not work
                Brad Richardson Newbie

                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?

                  • Re: Powershell - New-NSVolume does not work
                    Justin Rich Adventurer

                    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

                      • Re: Powershell - New-NSVolume does not work
                        Brad Richardson Newbie

                        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

                          • Re: Powershell - New-NSVolume does not work
                            Justin Rich Adventurer

                            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

                              • Re: Powershell - New-NSVolume does not work
                                Brad Richardson Newbie

                                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

                      • Re: Powershell - New-NSVolume does not work
                        Justin Rich Adventurer

                        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..

                          • Re: Powershell - New-NSVolume does not work
                            Brad Richardson Newbie

                            And....it started working.

                             

                            Thanks for humoring me...

                            • Re: Powershell - New-NSVolume does not work
                              Terry Zolinski Newbie

                              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

                                • Re: Powershell - New-NSVolume does not work
                                  Justin Rich Adventurer

                                  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)

                                    • Re: Powershell - New-NSVolume does not work
                                      Terry Zolinski Newbie

                                      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.

                                        • Re: Powershell - New-NSVolume does not work
                                          Terry Zolinski Newbie

                                          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.

                                            • Re: Powershell - New-NSVolume does not work
                                              Terry Zolinski Newbie

                                              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