NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

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

Creating new host with powershell

TrevorParfitt
2,945 Views

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
2,880 Views

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.

 

 

Public