1. 程式人生 > >Nexus-配置VDC

Nexus-配置VDC

1、配置資源模板
This example shows how to configure a VDC resource template:

vdc resource template TemplateA
  limit-resource port-channel minimum 4 maximum 128
  limit-resource span-ssn minimum 1 maximum equal-to-min
  limit-resource vlan minimum 32 maximum 1024
  limit-resource vrf minimum 32 maximum 1000
 
通過命令show vdc resource template TemplateA 檢視,可以看到和如下類似結果:

2、建立VDC

This example shows how to create and initialize a VDC:
switch# config t
switch(config)# vdc test
Note:Creating VDC,one moment please…
switch(config-vdc)# allocate interface ethernet 2/46
Moving ports will cause all config associated to them in source vdc to be removed. Are you sure you want to move the ports? [yes] yes
//通過show vdc N7K membership檢視分配的介面


switch(config-vdc)# exit
switch(config)# switchto vdc test
---- System Admin Account Setup ----
Do you want to enforce secure password standard (yes/no) [y]: y
Enter the password for "admin":<password>
Confirm the password for "admin":<password>
---- Basic System Configuration Dialog ----
This setup utility will guide you through the basic configuration of
the system. Setup configures only enough connectivity for management
of the system.
Please register Cisco Nexus7000 Family devices promptly with your
supplier. Failure to register may affect response times for initial
service calls. Nexus7000 devices must be registered to receive
entitled support services.
Press Enter at anytime to skip a dialog. Use ctrl-c at anytime
to skip the remaining dialogs.
Would you like to enter the basic configuration dialog (yes/no): yes

Create another login account (yes/no) [n]: n
Configure read-only SNMP community string (yes/no) [n]: n
Configure read-write SNMP community string (yes/no) [n]: n
Enter the switch name : Test
Continue with Out-of-band (mgmt0) management configuration? (yes/no) [y]:
Mgmt0 IPv4 address : 10.10.5.5
Mgmt0 IPv4 netmask : 255.255.254.0
Configure the default gateway? (yes/no) [y]: y
IPv4 address of the default gateway : 10.10.5.1
Configure advanced IP options? (yes/no) [n]:
Enable the telnet service? (yes/no) [y]:
Enable the ssh service? (yes/no) [n]: y
Type of ssh key you would like to generate (dsa/rsa/rsa1) : rsa
Number of key bits <768-2048> : 768
Configure the ntp server? (yes/no) [n]:
Configure default switchport interface state (shut/noshut) [shut]:
Configure default switchport trunk mode (on/off/auto) [on]:
The following configuration will be applied:
switchname Test
interface mgmt0
ip address 10.10.5.5 255.255.254.0
no shutdown
exit
vrf context management
ip route 0.0.0.0/0 10.10.5.1
exit
telnet server enable
ssh key rsa 768 force
ssh server enable
system default switchport shutdown
system default switchport trunk mode on
Would you like to edit the configuration? (yes/no) [n]:
Use this configuration and save it? (yes/no) [y]:
[########################################] 100%
Cisco Data Center Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2007, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software may be covered under the GNU Public
License or the GNU Lesser General Public License. A copy of
each such license is available at
http://www.gnu.org/licenses/gpl.html and
http://www.gnu.org/licenses/lgpl.html
switch-test# exit
switch

來自 <https://www.cisco.com/c/en/us/td/docs/switches/datacenter/sw/nx-os/virtual_device_context/configuration/guide/b-7k-Cisco-Nexus-7000-Series-NX-OS-Virtual-Device-Context-Configuration-Guide/creating-vdc.html>

檢視VDC可能是如下情況:

3、限制VDC資源使用

DC2-N7K-1(config)#vdc DC2-N7K-3
DC2-N7K-1(config-vdc)#template TemplateA

可以通過show vdc DC2-N7K-1 resource檢視

4、限制VDC關聯模組

DC2-N7K-1(config)#vdc DC2-N7K-3
DC2-N7K-1(config-vdc)#limit-resource module-type m1xl f2e
This wil cause all ports of unallowed types to be removed from this vdc.Continue(y/n)[yes]yes

通過show vdc檢視對應VDC關聯的模組限制

5、配置啟動順序

預設的啟動順序為1,具有相同的啟動順序時,VDC ID越小的越優先啟動,default VDC,admin VDC 總是第一個啟動!
DC2-N7K-1(config)#vdc DC2-N7K-3
DC2-N7K-1(config-vdc)#boot-order 2 >>>>範圍1-9

6、檢視VDC高可用性的預設配置
雙引擎:
Bringdown,讓VDC進入failed狀態
Restart,將重啟啟動程序,報錯shut所有的介面,停止虛擬化服務程序,然後重新啟動儲存了的服務,配置,那些沒有儲存在startup config的配置會丟失
Switchover,初始化一個引擎模組切換

單引擎:
Bringdown,讓VDC進入failed狀態
Reload,重啟引擎模組
Restart,將重啟啟動程序,報錯shut所有的介面,停止虛擬化服務程序,然後重新啟動儲存了的服務,配置,那些沒有儲存在startup config的配置會丟失

DC2-N7K-1#show vdc DC2-N7K-33 detail
Swtichwide mode is m1 f1 m1xl f22 m2xl f2e f3
vdc id:3
vdc name:DC2-N7K-3
vdc state:active
vdc mac address:01:e1:a3:3c:45:a3
vdc ha policy:RESTART
vdc dual-sup ha policy:SWITCHOVER
vdc boot Order:2
CPU share:10
CPU share Percentage:22%
vdc create time:Thu Oct 23 21:13 55 2017
vdc reload count:0
vdc uptime:0 day(s),8 hour(s),5 minute(s),20 second(s)
vdc restart count:0
vdc type:Ethernet
vdc supported linecards:m1xl f2e

修改配置
DC2-N7K-1(config)#vdc DC2-N7K-3
DC2-N7K-1(config-vdc)#ha-policy singe-sup bringdown
DC2-N7K-1(config-vdc)#ha-policy dual-sup restart

DC2-N7K-1#show vdc DC2-N7K-33 detail
Swtichwide mode is m1 f1 m1xl f22 m2xl f2e f3
vdc id:3
vdc name:DC2-N7K-3
vdc state:active
vdc mac address:01:e1:a3:3c:45:a3
vdc ha policy:BRINGDOWN
vdc dual-sup ha policy:RESTART
vdc boot Order:2
CPU share:10
CPU share Percentage:22%
vdc create time:Thu Oct 23 21:13 55 2017
vdc reload count:0
vdc uptime:0 day(s),8 hour(s),5 minute(s),20 second(s)
vdc restart count:0
vdc type:Ethernet
vdc supported linecards:m1xl f2e

7、建立管理VDC、VDC之間的切換、繫結主機名

DC2-N7K-1(config)#system admin-vdc migrate DC2-N7K-5
default vdc切換為admin vdc,限制default vdc裡面的網路配置遷移到DC2-N7K-5


DC2-N7K-1(config)# switchto vdc test
---- System Admin Account Setup ----
Do you want to enforce secure password standard (yes/no) [y]: no
Enter the password for "admin":
Confirm the password for "admin":
---- Basic System Configuration Dialog VDC:2 ----
Would you like to enter the basic configuration dialog(yes/no):no

DC2-N7K-1-test(config)#switchback

DC2-N7K-1(config)#no vdc combined-hostname
DC2-N7K-1(config)# switchto vdc test
test(config)#