HPE Storage Users Group

A Storage Administrator Community




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Can't connect to array with PowerShell ?
PostPosted: Tue Dec 08, 2015 5:28 pm 

Joined: Tue Dec 08, 2015 5:17 pm
Posts: 1
Hi
I am new to 3 Par. I downloaded the 3 Par PowerShell Toolkit. version 2.0

But I can't get the new-sanconnection command to work... it says cmdlet not found.

I can't get the new-sshconnection command to work either.. it says access denied.

The documentation is kind of sketchy.

Does anyone have a quick example of the best way to connect to the array with Powershell?

Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: Can't connect to array with PowerShell ?
PostPosted: Fri Feb 12, 2016 12:31 pm 

Joined: Tue Apr 22, 2014 12:20 pm
Posts: 7
Here are the basics. you will need plink, and also need to generate ssh keys with puttygen or something. have fun!

function plink
{
[CmdletBinding()]
PARAM
(
[Parameter(Mandatory=$True)]
[ValidateNotNullOrEmpty()]
[string] $remoteHost,

[Parameter(Mandatory=$True)]
[ValidateNotNullOrEmpty()]
[string] $ppk,

[Parameter(Mandatory=$True)]
[ValidateNotNullOrEmpty()]
[string] $command)

& .\plink.exe $remoteHost -i $ppk $command
return
}

$logfile = "logfile.txt"
$remoteHost = "[user]@[array]"
$ppk = "[private_key].ppk"

$command1 = "removevlun -f [volume_name] [LUN_ID] [Host or Set]"
$command2 = "updatevv -ro -f [volume_name]"
$command3 = "createvlun -f [volume_name] [LUN_ID] [Host or Set]"

try
{
plink $remoteHost $ppk $command1
}
catch
{
"Error: $($_.Exception.Message)" >> $logfile
[send an email or something]
break
}

try
{
plink $remoteHost $ppk $command2
}
catch
{
"Error: $($_.Exception.Message)" >> $logfile
[send an email or something]
break
}

try
{
plink $remoteHost $ppk $command3
}
catch
{
"Error: $($_.Exception.Message)" >> $logfile
[send an email or something]
break
}


Top
 Profile  
Reply with quote  
 Post subject: Re: Can't connect to array with PowerShell ?
PostPosted: Fri Feb 12, 2016 12:38 pm 

Joined: Tue Apr 22, 2014 12:20 pm
Posts: 7
Also, you need to make sure that you set up a user on the array, set the acl's for that user, and set the public ssh key for that user.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | DVGFX2 by: Matt