EF/E-Series, SANtricity and Related Plug-ins

Creating new host with powershell

TrevorParfitt

Hi,

 

I am trying to copy the hosts I have in an E2860 to a new E5760.

I have extracted the information using get-nehost but am struggling with the format for the

new-nehost command

I get this error whether I use a variable or manually specify the value

new-nehost -Credential $NECred4 -SystemId 1 -name $name.name -Ports "20000025B50B003C" -HostType VmwTPGSALUA

New-NeHost : Cannot bind parameter 'Ports'. Cannot convert the "20000025B50B003C" value of type "System.String" to type "NetApp.PowerShell.TO.HostPortCreateRequest"

 

I get the same issue with hosttype.

The help page refers to the option as

 

-Ports [<List<HostPortCreateRequest>>]

 

But I have not found a way of doing this.

 

Has anyone done this and could give me an example of the correct syntax.

1 REPLY 1

eseries_trailblazer

After checking with some folks, you would need to create the correct object type and pass that in as the argument for the -Ports parameter. Here's an example:

 

$hostport = New-object -TypeName NetApp.Powershell.TO.HostPortCreateRequest # Use this as the argument

$hostport | Get-Member # to see the list of members that you can set

$hostport.Port = “WWPN” # 20000025B50B003C

 

Do the same for the host type if the it is looking for the same object type.

 

 

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public