Monday, 17 July 2017

Automatically Adding Host Credentials to 7MTT via Batch File

It’s a “feature” of 7MTT (every version), that when your 7MTT server reboots, or when you restart the “NetApp 7-Mode Transition Tool” service, you lose all the cached credentials and have to re-input them. This is a bit of a pain if you’ve got lots of hosts in 7MTT. It’s doubly a pain since 7MTT (from 2.0 I think) schedules the 7 to C SnapMirror transfers, so all the transition SnapMirrors grind to a halt until you re-input those credentials.

The good news is that it’s perfectly possible to write a batch file, and re-add the credentials using this batch file. You could even set a scheduled task to run this batch file, to make sure the credentials are loaded. One issue scheduling this with a batch file is that we have to use plain text passwords (if anyone has a cunning solution around this, please let me know.)

Here’s an example batch file to show how it’s done (adding 2 host credentials). Save as say Add_7MTT_Credentials.bat and double-click to run.

echo "START"
echo mypassword | transition credentials add -h host1_IP_FQDN -u admin
echo mypassword | transition credentials add -h host2_IP_FQDN -u admin
echo "END"
pause

Nice and simple!

Note: Version of 7MTT was 3.2.0.

Image: 7MTT Transition Credentials Management Commands
 
Tip 1: As in the above screenshot, to make your DOS command prompt look nicer, check out this Scott Hanselman post.
Tip 2: Making the PowerShell prompt look nicer is simple:
PS> Function Prompt{"YOUR PROMPT DESIGN HERE"}

No comments:

Post a Comment