Example VLAN conversion

Network Administration Guide for Hitachi NAS Platform

Version
15.1.x
Audience
anonymous
Part Number
MK-92HNAS008-33

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$