Active IQ Unified Manager Discussions

VLAN interface names must adhere to the following format: "<port name>-<vlan id>" error in wfa

Rutul
2,153 Views

Issue with this is I want to give user input as Vlan Name which will be in format for ex. a0a-1111. 

 

When I try to execute the below command script in wfa it gives me the error as 

 

VLAN interface names must adhere to the following format: "<port name>-<vlan id>".

 

param (
[parameter(Mandatory=$true, HelpMessage="Name of the Storage VLAN ID.")]
[string]$VlanName,

[parameter(Mandatory=$true, HelpMessage="Name of the Storage Cluster")]
[string]$Cluster,

[parameter(Mandatory=$true, HelpMessage="Name of the Storage Node Name.")]
[string]$NodeName

)

Connect-WfaCluster $Cluster

$vlanname=$VlanName -Split "-"
$vlanname[0]
$vlanname[1]
New-NcNetPortVlan -Node $NodeName -ParentInterface $vlanname[0] -VlanId $vlanname[1]

 

 

But at the same time when I try to execute the last 4 lines of script in powershell It is working successfully. 

 

What can be the issue

2 REPLIES 2

abhit
2,113 Views

Hi Rutul:

 

Isn't the Powershell toolkit help clarifying your doubts.

I am copy pasting the same below.

It is also available at http://localhost/wfa/wfa_docs/PoSH/Modules/DataONTAP/webhelp.C/cmdlet_New-NcNetPortVlan.html

in the machine where WFA is installed.

Let us know if it clarifies?

  Cmdlet: New-NcNetPortVlan


NAME
New-NcNetPortVlan

SYNOPSIS
Create a new VLAN interface.

SYNTAX
New-NcNetPortVlan [-Node] <String> [-VlanName] <String> [-Controller <NcCont
roller[]>] [-ZapiRetryCount <Int32>] [<CommonParameters>]

New-NcNetPortVlan [-ParentInterface] <String> [-Node] <String> -VlanId <UInt
16[]> [-Controller <NcController[]>] [-ZapiRetryCount <Int32>] [<CommonParam
eters>]


DESCRIPTION
Create a new VLAN interface. The changes are persistent across reboots.


PARAMETERS
-Node <String>
The node that owns the port or ifgrp.

Required? true
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-VlanName <String>
Name of vlan interface. The name must be of the format <parent-inteface
>-<vlanid>.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Controller <NcController[]>
A clustered Data ONTAP controller to receive this cmdlet, as embodied by
an NcController object. This parameter is returned by the Connect-NcCo
ntroller cmdlet. If not specified, the value in the global variable Cur
rentNcController is used. In the latter case, if CurrentNcController co
ntains a collection of NcController objects, this cmdlet is invoked on e
ach controller in succession.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-ZapiRetryCount <Int32>


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ParentInterface <String>
The name of the port or ifgrp to modify.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-VlanId <UInt16[]>
The VLAN IDs to add. Range: [1..4094]

Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
DataONTAP.C.Types.Net.VlanInfo


NOTES


Category: net
API: net-vlan-create
Family: cluster

-------------- Example 1 --------------

C:\PS>New-NcNetPortVlan i0b -Node fas3070cluster01-02 -VlanId 1,2,3


Add VLAN tags 1,2,3 to ifgrp "i0b".


InterfaceName ParentInterface VlanID Node
------------- --------------- ------ ----
i0b-1 i0b 1 fas3070cluster01-02
i0b-2 i0b 2 fas3070cluster01-02
i0b-3 i0b 3 fas3070cluster01-02


-------------- Example 2 --------------

C:\PS>New-NcNetPortVlan i0b-4 fas3070cluster01-02


Create VLAN 'iob-4' to node 'fas3070cluster01-02'.


InterfaceName ParentInterface VlanID Node
------------- --------------- ------ ----
i0b-4 i0b 4 fas3070cluster01-02

 

 

Rutul
2,105 Views

Yes I have already referred that. But i found that more confusing. Example has not been given properly.  So I put another question on community on that and got resolved. This was the issue with Split function which i was using. That was creating some issue. But Then i found some alternative to that. 

 

Previously customer wanted to keep input as VlanName (e.g e0c-1111). So I had to split the VlanName to get the port(e0c) and Vlan ID(1111). But had an issue with splitting. It was not taking value as expected.

 

Instead of splitting i kept it simple as below and convinced the customer for keeping Port and Vlan ID seperate.

 

New-NcNetPortVlan -Node $NodeName -ParentInterface $PortName -VlanId $VlanId  -ErrorAction Stop

Public