NETWORK ENGINEER BLOG

Tips and Reviews for Engineers

Cisco Nexus1000v インストール

Nexus1000v は、Cicso 社と Vmware 社が共同で開発したソフトウェアベースの仮想スイッチです。
Cisco CLI を利用し、仮想ネットワークの管理、ポートプロファイルの割り当てが可能となっています。
以下、インストールからセットアップについて紹介します。

システム要件
  • VMware vSphere Enterprise Plus バージョン 4.1 以降、VMware vSphere 5.0 をサポート
  • VMware vCloud Director 1.5 以降との互換性
  • Cisco Nexus 1000V シリーズ VSM:
    • VSM は VMware ESX/ESXi 3.5U2 以降、または ESX/ESXi 4.0 に仮想マシンとして導入可能
    • ハードディスク:3 GB
    • RAM:2 GB
    • 動作周波数 1.5 GHz の仮想 CPU x 1
  • Cisco Nexus 1000V シリーズ VEM
    • VMware ESX または ESXi 4.0 以降
    • ハードディスク空き容量:6.5 MB
    • RAM:150 MB
  • VSM と VEM 間のレイヤ 2 接続の VLAN の数:1
  • VMware ハードウェア互換性リストに掲載されているサーバ
  • アップストリーム物理スイッチとの互換性*1
  • VXLAN にはマルチキャスト(RFC 2236)をサポートする物理スイッチが必要

参考:Cisco Systems, Inc

インストール手順

VSM をホストする ESXi に vSwitch 及び、PortGroup「Control」「Packet」を作成します。
f:id:FriendsNow:20130127233920p:plain

vCenter のファイルから「OVF テンプレートのデプロイ」を実行します。
f:id:FriendsNow:20130127233927p:plain

VSM バイナリ(ova ファイル)を指定し[次へ]をクリックします。
f:id:FriendsNow:20130127233940p:plain

OVF テンプレートの詳細を確認し[次へ]をクリックします。
f:id:FriendsNow:20130127233943p:plain

エンドユーザー使用許諾契約書を確認後、「承諾」及び[次へ]をクリックします。
f:id:FriendsNow:20130127233953p:plain

仮想マシンの名前を入力し[次へ]をクリックします。
f:id:FriendsNow:20130127234006p:plain

デプロイの構成を選択し[次へ]をクリックします。
f:id:FriendsNow:20130127234014p:plain

仮想マシンのファイルを保存するストレージを選択し[次へ]をクリックします。
f:id:FriendsNow:20130127234214p:plain

ディスクのフォーマット形式*2を選択し[次へ]をクリックします。
f:id:FriendsNow:20130127234233p:plain

上記で作成した仮想マシンのポートグループを適用し[次へ]をクリックします。
f:id:FriendsNow:20130127234248p:plain

プロパティを設定し[次へ]をクリックします。
f:id:FriendsNow:20130127234301p:plain

「デプロイ後にパワーオン」をチェックし「終了」をクリックします。
f:id:FriendsNow:20130127234356p:plain

インストール完了後、VSM にログインし、初期設定を行います。

VSM# setup
  Enter HA role[standalone/primary/secondary]: standalone
  Enter the domain id<1-4095>: 1

Would you like to enter the basic configuration dialog (yes/no): yes
  Create another login account (yes/no) [n]:
  Configure read-only SNMP community string (yes/no) [n]:
  Configure read-write SNMP community string (yes/no) [n]:
  Enter the switch name : VSM
  Continue with Out-of-band (mgmt0) management configuration? (yes/no) [y]: y
    Mgmt0 IPv4 address : 192.168.1.200
    Mgmt0 IPv4 netmask : 255.255.255.0
  Configure the default gateway? (yes/no) [y]:
    IPv4 address of the default gateway : 192.168.1.2
  Configure advanced IP options? (yes/no) [n]:
  Enable the telnet service? (yes/no) [n]:
  Enable the ssh service? (yes/no) [y]:
    Type of ssh key you would like to generate (dsa/rsa) [rsa]:
    Number of rsa key bits <768-2048> [1024]:
  Enable the http-server? (yes/no) [y]:
  Configure the ntp server? (yes/no) [n]:
  Configure svs domain parameters? (yes/no) [y]:
    Enter SVS Control mode (L2 / L3) [L3]: L2
    Enter control vlan <1-3967, 4048-4093> : 260
    Enter packet vlan <1-3967, 4048-4093> : 261

The following configuration will be applied:
  switchname VSM
  interface mgmt0
  ip address 192.168.1.200 255.255.255.0
  no shutdown
  vrf context management
  ip route 0.0.0.0/0 192.168.1.2
  no telnet server enable
  ssh key rsa 1024 force
  ssh server enable
  feature http-server
  svs-domain
    svs mode L2
    control vlan 260
    packet vlan 261
    domain id 1
vlan 260
vlan 261

Would you like to edit the configuration? (yes/no) [n]:
Use this configuration and save it? (yes/no) [y]:

Product License Registration にアクセスし「Get Demo」をクリックします。
f:id:FriendsNow:20130127234422p:plain

Nexus1000v を選択し、Host id を入力します。Host id は VSM の show コマンドで確認します。

VSM# show license host-id
License hostid: VDH=1089420446135932555

f:id:FriendsNow:20130127234550p:plain

ライセンスファイルをダウンロード後、FTP 等で VSM へ転送します。

VSM# copy ftp://192.168.1.10/N1KVDEMO201301270550362650.lic bootflash:
Enter vrf (If no input, current vrf 'default' is considered):
Enter username:
Password:
***** Transfer of file Completed Successfully *****

VSM# dir bootflash:
         22     Jan 27 22:26:13 2013  .ovfconfigured
        240     Jan 27 23:28:02 2013  N1KVDEMO201301270550362650.lic
      77824     Jan 27 22:25:51 2013  accounting.log
       4096     Dec 12 21:18:10 2012  core/
       4096     Dec 12 21:18:10 2012  log/
      16384     Dec 12 21:17:58 2012  lost+found/
        440     Jan 27 22:25:47 2013  mts.log
   19544576     Dec 12 21:18:03 2012  nexus-1000v-kickstart.4.2.1.SV1.5.2b.bin
   76982077     Dec 12 21:18:06 2012  nexus-1000v.4.2.1.SV1.5.2b.bin
       3907     Jan 27 22:26:06 2013  stp.log.1
       4096     Dec 12 21:18:37 2012  vdc_2/
       4096     Dec 12 21:18:37 2012  vdc_3/
       4096     Dec 12 21:18:37 2012  vdc_4/
   18077521     Dec 12 21:18:09 2012  vnmc-vsmpa.2.0.1b.bin

Usage for bootflash://sup-local
  229421056 bytes used
 1365454848 bytes free
 1594875904 bytes total

ライセンスファイル転送後、VSM へインストールします。

VSM# install license bootflash:///N1KVDEMO201301270550362650.lic
Installing license .....done

VSM# show license file N1KVDEMO201301270550362650.lic
N1KVDEMO201301270550362650.lic:
SERVER this_host ANY
VENDOR cisco
INCREMENT NEXUS1000V_LAN_SERVICES_PKG cisco 1.0 28-mar-2013 16 \
        HOSTID=VDH=1089420446135932555 \
        NOTICE="<LicFileID>20130127055036265</LicFileID><LicLineID>1</LicLineID> \
        <PAK></PAK>" SIGN=FB9FD088FFE4

VSM# show license usage neXUS1000V_LAN_SERVICES_PKG
----------------------------------------
Feature Usage Info
----------------------------------------
       Installed Licenses : 16
    Default Eval Licenses : 0
   Max Overdraft Licenses : 16
Installed Licenses in Use : 0
Overdraft Licenses in Use : 0
  Default Eval Lic in Use : 0
   Default Eval days left : 239
       Licenses Available : 32
          Shortest Expiry : 28 Mar 2013
----------------------------------------

VSM# copy running-config startup-config
[########################################] 100%

VSM に HTTP アクセスし、cisco_nexus1000v_extension.xml ファイルをダウンロードします。
f:id:FriendsNow:20130128225300p:plain

vCenter のプラグインマネージャーを起動し、右クリック→新規プラグインの登録を行います。
f:id:FriendsNow:20130128225334p:plain

「参照」をクリックし、cisco_nexus1000v_extension.xml ファイルを指定します。
f:id:FriendsNow:20130128225354p:plain

「使用可能なプラグイン」に Cisco_Nexus_1000vが追加されます。
f:id:FriendsNow:20130128225414p:plain

次のコマンドを実行し、VSM を vCenter Server へ接続します。

VSM(config)# svs connection VC
VSM(config-svs-conn)# vmware dvs datacenter-name DataCenter
VSM(config-svs-conn)# protocol vmware-vim
VSM(config-svs-conn)# remote  ip address 192.168.1.10
VSM(config-svs-conn)# connect

VSM# show svs connections
connection VC:
    ip address: 192.168.1.10
    remote port: 80
    protocol: vmware-vim https
    certificate: default
    datacenter name: DataCenter
    admin:
    max-ports: 8192
    DVS uuid: c7 d7 0a 50 19 a7 01 7e-ab b0 e4 0a b0 5b ed 60
    config status: Enabled
    operational status: Connected
    sync status: Complete
    version: VMware vCenter Server 5.0.0 build-804277
    vc-uuid: 89EC083C-E9CB-40C2-863F-13A579BD1779

vCenter へ Nexus1000v スイッチが登録されます。
f:id:FriendsNow:20130128230559p:plain

VSM と VEM 間通信用のアップリンクポートプロファイルを定義します。

VSM(config)# port-profile type ethernet System-Uplink
VSM(config-port-prof)# vmware port-group
VSM(config-port-prof)# switchport mode trunk
VSM(config-port-prof)# switchport trunk allowed vlan 260-261
VSM(config-port-prof)# no shutdown
VSM(config-port-prof)# system vlan 260-261
VSM(config-port-prof)# state enabled

仮想マシン用のアップリンクポートプロファイルを定義します。

VSM(config-vlan)# vlan 10
VSM(config-vlan)# vlan 20
VSM(config-vlan)# port-profile type ethernet VM-Uplink
VSM(config-port-prof)# vmware port-group
VSM(config-port-prof)# switchport mode trunk
VSM(config-port-prof)# switchport trunk allowed vlan 10,20
VSM(config-port-prof)# no shutdown
VSM(config-port-prof)# state enabled

仮想マシンが、トラフィックを伝送するために使用するデータポートプロファイルを定義します。

VSM(config)# port-profile v10
VSM(config-port-prof)# switchport mode access
VSM(config-port-prof)# switchport access vlan 10
VSM(config-port-prof)# vmware port-group
VSM(config-port-prof)# no shutdown
VSM(config-port-prof)# state enabled

VSM(config)# port-profile v20
VSM(config-port-prof)# switchport mode access
VSM(config-port-prof)# switchport access vlan 20
VSM(config-port-prof)# vmware port-group
VSM(config-port-prof)# no shutdown
VSM(config-port-prof)# state enabled

VSM# copy run startup-config
[########################################] 100%

(オプション)VMware vCenter Update Manager をインストールしておきます。
f:id:FriendsNow:20130128230856p:plain

Nexus1000v へ ESXi ホストを追加します。
f:id:FriendsNow:20130128230905p:plain

System-Uplink*3及び VM-Uplink*4を vmnic へ関連付けます。
f:id:FriendsNow:20130128231127p:plain

vSwitch / dvSwitch に適用済みの vmnic は、「移行しない」を選択し「次へ」をクリックします。
f:id:FriendsNow:20130128231410p:plain

設定が反映されている事を確認し「終了」をクリックします。
f:id:FriendsNow:20130128231421p:plain
VMware Update Manager がインストールされている場合は、ESXi ホストへ VEM がインストールされます。

VSM で以下のコマンドを実行し、VSM が VEM を認識しているか確認します。

VSM# show module
Mod  Ports  Module-Type                       Model               Status
---  -----  --------------------------------  ------------------  ------------
1    0      Virtual Supervisor Module         Nexus1000V          active *
3    248    Virtual Ethernet Module           NA                  ok
4    248    Virtual Ethernet Module           NA                  ok

Mod  Sw                  Hw
---  ------------------  ------------------------------------------------
1    4.2(1)SV1(5.2b)     0.0
3    4.2(1)SV1(5.2b)     VMware ESXi 5.0.0 Releasebuild-623860 (3.0)
4    4.2(1)SV1(5.2b)     VMware ESXi 5.0.0 Releasebuild-623860 (3.0)

Mod  MAC-Address(es)                         Serial-Num
---  --------------------------------------  ----------
1    00-19-07-6c-5a-a8 to 00-19-07-6c-62-a8  NA
3    02-00-0c-00-03-00 to 02-00-0c-00-03-80  NA
4    02-00-0c-00-04-00 to 02-00-0c-00-04-80  NA

Mod  Server-IP        Server-UUID                           Server-Name
---  ---------------  ------------------------------------  --------------------
1    192.168.1.200    NA                                    NA
3    192.168.1.11     564d5290-6ade-e7aa-6558-ba8bad535fa5  NA
4    192.168.1.12     564d3ab5-a40d-8440-7ea5-59a2a4260db3  NA

* this terminal session

VSM# show module vem mapping
Mod     Status          UUID                                    License Status
---     -----------     ------------------------------------    --------------
3       powered-up      564d5290-6ade-e7aa-6558-ba8bad535fa5    licensed
4       powered-up      564d3ab5-a40d-8440-7ea5-59a2a4260db3    licensed

試験用に以下の VM を作成し、仮想 NIC に VSM で作成した Port-Profile を適用します。
vyatta_v10 [172.16.1.11/16] : PortProfile=v10
f:id:FriendsNow:20130128233643p:plain

vyatta_v10 [172.16.1.12/16] : PortProfile=v10
f:id:FriendsNow:20130128233647p:plain

vyatta_v20 [172.16.1.13/16] : PortProfile=v20
f:id:FriendsNow:20130128233656p:plain

vyatta_v20 [172.16.1.14/16] : PortProfile=v20
f:id:FriendsNow:20130128233709p:plain

VSM で仮想インターフェースが up する事を確認します。

VSM# show interface brief

--------------------------------------------------------------------------------
Port     VRF          Status IP Address                            Speed    MTU
--------------------------------------------------------------------------------
mgmt0    --           up     192.168.1.200                         1000     1500

--------------------------------------------------------------------------------
Ethernet      VLAN   Type Mode   Status  Reason                   Speed     Port
Interface                                                                   Ch #
--------------------------------------------------------------------------------
Eth3/5        1      eth  trunk  up      none                       1000
Eth4/5        1      eth  trunk  up      none                       1000
Eth4/6        1      eth  trunk  up      none                       1000

--------------------------------------------------------------------------------
Vethernet     VLAN   Type Mode   Status  Reason                   Speed
--------------------------------------------------------------------------------
Veth1         10     virt access up      none                       auto
Veth2         10     virt access up      none                       auto
Veth3         20     virt access up      none                       auto
Veth4         20     virt access up      none                       auto

--------------------------------------------------------------------------------
Port     VRF          Status IP Address                            Speed    MTU
--------------------------------------------------------------------------------
control0 --           up     --                                    1000     1500

各 VM にアクセスし、VSM で定義した VLAN が有効になっている事を確認します。

尚、VM を vMotion で別ホストへ移行した場合、vEther(Policy)が追従します。
vMotion 前は、vethernet 1 が module 4 で Active となっています。

VSM# show interface vethernet 1
Vethernet1 is up
  Port description is 1_11_vyatta_v10, Network Adapter 1
  Hardware: Virtual, address: 0050.568a.4a57 (bia 0050.568a.4a57)
  Owner is VM "1_11_vyatta_v10", adapter is Network Adapter 1
  Active on module 4
  VMware DVS port 32
  Port-Profile is v10
  Port mode is access
  5 minute input rate 24 bits/second, 0 packets/second
  5 minute output rate 16 bits/second, 0 packets/second
  Rx
    19 Input Packets 0 Unicast Packets
    4 Multicast Packets 15 Broadcast Packets
    1308 Bytes
  Tx
    15 Output Packets 0 Unicast Packets
    2 Multicast Packets 13 Broadcast Packets 15 Flood Packets
    1000 Bytes
    0 Input Packet Drops 0 Output Packet Drops

vMotion 後、自動で Active Module が 3 へ移行します。

VSM# show interface vethernet 1
Vethernet1 is up
  Port description is 1_11_vyatta_v10, Network Adapter 1
  Hardware: Virtual, address: 0050.568a.4a57 (bia 0050.568a.4a57)
  Owner is VM "1_11_vyatta_v10", adapter is Network Adapter 1
  Active on module 3
  VMware DVS port 32
  Port-Profile is v10
  Port mode is access
  5 minute input rate 0 bits/second, 0 packets/second
  5 minute output rate 0 bits/second, 0 packets/second
  Rx
    23 Input Packets 0 Unicast Packets
    4 Multicast Packets 19 Broadcast Packets
    1548 Bytes
  Tx
    15 Output Packets 0 Unicast Packets
    2 Multicast Packets 13 Broadcast Packets 15 Flood Packets
    1000 Bytes
    0 Input Packet Drops 0 Output Packet Drops

以上

*1:すべての Cisco Nexus、Cisco CatalystR スイッチ、および他のベンダー製のイーサネット スイッチを含む

*2:2012/3/19 追記:thin は未サポートのようです。

*3:VSM と VEM 間通信用のアップリンクポートプロファイル

*4:仮想マシン用のアップリンクポートプロファイル