UNSOLVED

aureliandan

updated

12 years ago

A

aureliandan

1 Rookie

•

8 Posts

0

48939

June 5th, 2014 06:00

wwn format on New-SCServer command

Hi,


I tried to create a new server with two wwn's but I get an error ... wwn's are not properly formated

This is the command used:
New-SCServer -Connection $SCConn -Name "server5" -WorldWideNames "2001B8CA3A0A1D8A,2001B8CB2A039DC5" -SCOSType $SCOSType

where $SCOSType = Get-SCOSType -Connection $SCConn -Name "VMWare ESX 5.1"

I have an excel with 3 columns, first column is the name of the server and the others contain hosts WWN's

Because there are so many hosts, I would like to do a script to create all these servers, but I'm new to Powershell :) and I don't understant what is wrong on wwn's formatting

Thank you for any suggestion !

  • 833

    0

    Posted June 5th, 2014 07:00

    When specifying the -WorldWideNames parameter, since it expects an array, do it like this:

    New-SCServer -Connection $SCConn -Name "server5" -WorldWideNames "{2001B8CA3A0A1D8A,2001B8CB2A039DC5}" -SCOSType $SCOSType

    Then it should work.

    Good Luck!

  • 833

    0

    Posted June 5th, 2014 08:00

    Can you post your code that you used?  Make sure you have quotes around the brackets which contain the parameter array values:

    -WorldWideNames "{2001B8CA3A0A1D8A,2001B8CB2A039DC5}"

  • aureliandan

    1 Rookie

    •

    8 Posts

    833

    0

    Posted June 5th, 2014 08:00

    Thank you for your answer, I've tried that but I have the same warning:

    World Wide Name [{2001B8CA3A0A1D8A,2001B8CB2A039DC5}] does not appear to be in the correct format.

    This WWN will not be included in the server definition. Correct the format and use Add-SCServerPort to include it

    If I use the following command it works ok and will create a server with a single HBA

    New-SCServer -Connection $SCConn -Name "server5" -WorldWideNames "2001B8CB2A039DC5" -SCOSType $SCOSType

  • aureliandan

    1 Rookie

    •

    8 Posts

    833

    0

    Posted June 5th, 2014 09:00

    New-SCServer -Connection $SCConn -Name "Servername" -WorldWideNames "{2001B8CA3A0A1D8A,2001B8CB2A039DC5}" -SCOSType $SCOSType

    WARNING: World Wide Name [{2001B8CA3A0A1D8A,2001B8CB2A039DC5}] does not appear to be in the correct format. This WWN will not be included in the server definition. Correct the format and use Add-SCServerPort to include it


  • 833

    0

    Posted June 6th, 2014 13:00

    A couple of options ... Save your WWNs into an array variable:

    $wwns = @("2001B8CB2A039D14", "2001B8CB2A039D15")

    New-SCServer -Connection $conn -Name "MyServer" -WorldWideNames $wwns

    or do it in-line...

    New-SCServer -Connection $conn -Name "MyServer" -WorldWideNames @("2001B8CB2A039D14", "2001B8CB2A039D15")

  • aureliandan

    1 Rookie

    •

    8 Posts

    833

    0

    Posted June 26th, 2014 08:00

    Thanks