I'm a novice with Powershell, but have many years scripting experience, so hopefully you powershell gurus can help me out.
Not to get bogged down with the 'big picture', a quick synopsis - Running SMSAP backups, then using SnapMirror to destination filer, and SnapVault to a third.
I've got my scripts working fine, and have been for some time. We are now is getting them running with the scheduler - OPALIS. After a number of OPALIS vs Powershell issues were resolved, my SMSAP backup script is working. Now moving on to SnapMirror Update. As soon as the script hits the connect-nacontroller command, powershell silently dies, and a sucess return code is sent to the OPALIS agent.
Environment - Win 2008 R2 (64 bit), Powershell 2.0, Netapp toolkit 1.4, and OPALIS 1.55 (32 bit). Due to OPALIS being 32 bit, and to hide the lengthy command line from it, we call a batch script which calls Powershell fully pathed. By default this is invokes cmd.exe *32, hence the full path to Powershell *32. I don't believe this to be part of the issue, but trying to provide critical details. The Powershell scripts work from the command line (cmd & PS CLI) with both 32 and 64 bit PS.
bat file:
c:\windows\syswow64\WindowsPowerShell\v1.0\powershell.exe -Noninteractive "&'E:\SMSAPScripts\SmsapMirrorUpdate.ps1' %1; exit $LASTEXITCODE" <NUL
exit %ERRORLEVEL%
PS1 file (with extra comment output to find failure point, but functions, setup, arg validation, etc removed for clarity):
#Connect to filer
WriteLog "Connect to filer"
connect-nacontroller $Dst_controller
if ( ! $? )
{
write "Unable to connect to Filer: $($Dst_controller)"
exit 3
}
WriteLog "Connected to filer"
# Up the filer timeout to prevent errors on connections
# default fot toolkit v1.4 (current) is 10 seconds, 60 on v1.5
$global:CurrentNaController.TimeoutMsec = 60000
WriteLog "Starting update"
foreach ( $VolName in $mr_Volume_Names )
{
Invoke-NaSnapmirrorUpdate -Destination $VolName > $null 2>>$LogFile
if ( ! $? )
{
ErrorExit "Cannot start update of SnapVault source: $($VolName)" 20
}
}
WriteLog "Script SnapMirrorUpdate.ps1 completed"
Resultant log:
Starting Script SnapVaultUpdate.ps1 for SAP Database SE1, Thu Aug 25 12:11:35 2011
reading config file, Thu Aug 25 12:11:35 2011
Connect to filer, Thu Aug 25 12:11:35 2011
Does anyone have a clue why Powershell would silently die on the connect-nacontroller command?
I'm pretty much at a dead stop, without any leads at this point.
Thanks for any help!
John