Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

VLAN conversion

Previously, VLANs were configured by defining an association between a VLAN ID and a subnet (using a network address and a subnet mask). It is no longer possible to create subnet VLANS. This topic describes how to convert subnet-VLANs to use VLAN interfaces. Seek guidance from your support provider before attempting the conversion procedure.

The subnet VLANs are maintained by the vlan command. This command enables the NAS server to display and remove existing subnet VLANs. However, a script is also available to convert legacy subnet-based VLANs to the new static VLANs. The following procedure describes how to run the script and convert the VLANs.

The procedure has three stages:

  • Accessing the NAS Linux console
  • Retrieving and running the script
  • Converting a subnet VLAN

Accessing the NAS Linux console

The script does not run under the NAS CLI but is available on the NAS platform (from version 12.2), through the Linux console.

To access the NAS Linux console:

  1. SSH to the SMU IP address
  2. Enter q to drop to the operating system prompt of the SMU
  3. Enter ssh manager@<cluster node ip>
  4. Enter the password.
  5. Enter exit
  6. Enter su
  7. Enter the password.

Retrieving and running the script

On the NAS Linux console, the script is located at: /opt/mercury-utils/bin/vlan-convert-config.rb.

To obtain the script (from a NAS server named xyz) and copy it onto a local Linux client, enter the following command:

# scp manager@xyz:/opt/mercury-utils/bin/vlan-convert-config.rb .
manager@xyz's password:
vlan-convert-config.rb              00%   23KB  22.9KB/s   00:00
#

Either on the NAS Linux console or a local Linux client, run the script with the following parameters:

vlan-convert-config.rb [--user <user>] [--password <password>] <HNAS-server>

Where:

  • user <user> is the username required to access the server
  • password <password> is the password required to access the server
  • <hnas-server> is the hostname or address of the NAS server

NoteIf the user option is supplied without a corresponding password, the script prompts for the password without displaying the entered text.

On the NAS Linux console only

When executing the script on the NAS Linux console, the name localhost can be used to identify the NAS server. In this case it is normally not necessary to supply the username and password.

For example:

/opt/mercury-utils/bin/vlan-convert-config.rb localhost > /tmp/vlan-conv-commands

Converting a subnet VLAN

The script outputs the commands to run in order to perform the conversion. Review these changes before applying them to the system by running the following command:

cat /tmp/vlan-conv-commands

Apply the generated commands to the NAS by running the following command:

source /tmp/vlan-conv-commands

Keep a copy of the script output for reference in case a downgrade to a version of firmware below 12.0 is required, as this information is necessary in order to convert back.

Example VLAN conversion

This example demonstrates how to convert subnet-VLANs to use VLAN interfaces. A sample command and the vlan-conv commands generated by the script are shown below.

Enter a command as shown in the example below:

manager@hnas(bash):/opt/mercury-utils/bin$ ./vlan-convert-config.rb localhost > /tmp/vlan-conv-commands
manager@hnas(bash):/opt/mercury-utils/bin$ cat /tmp/vlan-conv-commands

#!/bin/sh
# These are the commands suggested to upgrade the VLAN configuration.
# Running this script will disrupt communications with the HNAS.
# Created for HNAS localhost at 2014-10-14T07:51:46-07:00 [Version 12.2.3750.00].

# Please review this generated script before using it.
# ====================================================
ssc   localhost <<SSC-EOS

# Disable any EVS that only contain addresses on a tagged VLAN before updating the configuration.
echo Disabling any EVS with tagged VLAN prior to re-configuration ...
# Disable EVS 1:HNAS-G3
evs disable -e 1 --confirm

# Remove all addresses in VLANs from still enabled EVS before updating the configuration.
# This applies to EVS with non-VLAN address assignments in order to minimise disruption to non-VLAN services.
echo Removing VLAN IP addresses from EVS prior to re-configuration ...
# Remove the address 172.31.61.61/24 on ag1 from EVS 2:evs2
evsipaddr -e 2 --remove --confirm --ip 172.31.61.61

# Remove existing (legacy) VLAN configuration.
vlan remove-all

# Create new VLAN interfaces.
# Processing address 172.31.62.62/24 for ag1-vlan0200.
vlan-interface-create --interface ag1 200
# Processing address 172.31.61.61/24 for ag1-vlan0100.
vlan-interface-create --interface ag1 100
echo Preparing to reconfigure IP addresses on VLANs ...
sleep 5

# Reconfigure IP addresses on VLANs.
# Move address to VLAN interface.
evsipaddr -e 1 --update --confirm --ip 172.31.62.62/24 --port ag1-vlan0200
# Restore previously removed address to VLAN interface.
evsipaddr -e 2 --add --ip 172.31.61.61/24 --port ag1-vlan0100

# Enable any EVS that were previously disabled.
echo Enabling the EVS that were previously disabled ...
evs enable -e 1 
SSC-EOS

After reviewing the vlan-conv commands, execute the generated file on the NAS server.

manager@hnas(bash):/tmp$ source ./vlan-convert-commands

NAS OS Console
MAC ID : 34-4E-9E-37-3B-F2

hnas:$
hnas:$ # Disable any EVS that only contain addresses on a tagged VLAN before updating the configuration.
hnas:$ echo Disabling any EVS with tagged VLAN prior to re-configuration ...
Disabling any EVS with tagged VLAN prior to re-configuration ...
hnas:$ # Disable EVS 1:HNAS-G3
hnas:$ evs disable -e 1 --confirm
hnas:$
hnas:$ # Remove all addresses in VLANs from still enabled EVS before updating the configuration.
hnas:$ # This applies to EVS with non-VLAN address assignments in order to minimise disruption to non-VLAN services.
hnas:$ echo Removing VLAN IP addresses from EVS prior to re-configuration ...
Removing VLAN IP addresses from EVS prior to re-configuration ...
hnas:$ # Remove the address 172.31.61.61/24 on ag1 from EVS 2:evs2
hnas:$ evsipaddr -e 2 --remove --confirm --ip 172.31.61.61
Warning: Removing IP address 172.31.61.61 while EVS is ONLINE
hnas:$
hnas:$ # Remove existing (legacy) VLAN configuration.
hnas:$ vlan remove-all
hnas:$
hnas:$ # Create new VLAN interfaces.
hnas:$ # Processing address 172.31.62.62/24 for ag1-vlan0200.
hnas:$ vlan-interface-create --interface ag1 200
Created ag1-vlan0200
hnas:$ # Processing address 172.31.61.61/24 for ag1-vlan0100.
hnas:$ vlan-interface-create --interface ag1 100
Created ag1-vlan0100
hnas:$ echo Preparing to reconfigure IP addresses on VLANs ...
Preparing to reconfigure IP addresses on VLANs ...
hnas:$ sleep 5
hnas:$
hnas:$ # Reconfigure IP addresses on VLANs.
hnas:$ # Move address to VLAN interface.
hnas:$ evsipaddr -e 1 --update --confirm --ip 172.31.62.62/24 --port ag1-vlan0200
hnas:$ # Restore previously removed address to VLAN interface.
hnas:$ evsipaddr -e 2 --add --ip 172.31.61.61/24 --port ag1-vlan0100
hnas:$
hnas:$ # Enable any EVS that were previously disabled.
hnas:$ echo Enabling the EVS that were previously disabled ...
Enabling the EVS that were previously disabled ...
hnas:$ evs enable -e 1
hnas:$ manager@hnas(bash):/tmp$

 

  • Was this article helpful?