简介
在运行增强型XR(eXR)(也称为64位XR版本6.2.1及更高版本的聚合服务路由器9000(ASR9K)上,命令“show memory summary”不会显示相应数据表中记录的所有内部内存,这可能会让某些客户感到困惑。
问题详细资料
下面我们将使用运行6.4.2的ASR9901作为示例。
根据数据表,集成路由处理器(RP)具有32 GigaBytes(GB)的随机访问内存(RAM)。
RP/0/RSP0/CPU0:R1#show platform
Node Type State Config state
--------------------------------------------------------------------------------
0/RSP0/CPU0 ASR9901-RP(Active) IOS XR RUN NSHUT
0/FT0 ASR-9901-FAN OPERATIONAL NSHUT
0/FT1 ASR-9901-FAN OPERATIONAL NSHUT
0/FT2 ASR-9901-FAN OPERATIONAL NSHUT
0/0/CPU0 ASR9901-LC IOS XR RUN NSHUT
“Show memory summary”只显示约27GB,尽管系统在“admin show system resources”下识别总内存为32GB。
RP/0/RSP0/CPU0:R1#show memory summary
node: node0_RSP0_CPU0
------------------------------------------------------------------
Physical Memory: 27089M total (22185M available)
Application Memory : 27089M (22013M available)
Image: 4M (bootram: 0M)
Reserved: 0M, IOMem: 0M, flashfsys: 0M
Total shared window: 133M
RP/0/RSP0/CPU0:R1#admin show system resources
Node Physical Application Boot Partition CPUs Shmwin
Total Available Cached Total Available Cached Total Available
0/RSP0-Host 32415M^ 512M^ 135M 31655M^ 500M^ 132 923M 542M 4 N/A
0/RSP0-Admin 1940M 1072M 144M 1894M 1047M 141 2308M 1252M 1 N/A
0/RSP0-XR 27739M 22548M 999M 27089M 22020M 975 N/A N/A 2 6655M
<snip>
在其他ASR9K设备上也可观察到相同的行为,例如:带eXR 6.2.3的ASR9010
查看数据表A9K-RSP880-TR应具有16GB的RAM。
RP/0/RSP0/CPU0:R2#show platform
Node Type State Config state
-------------------------------------------------------------------------------
0/RSP0/CPU0 A9K-RSP880-TR(Active) IOS XR RUN NSHUT
0/FT0 ASR-9010-FAN-V2 OPERATIONAL NSHUT
0/FT1 ASR-9010-FAN-V2 OPERATIONAL NSHUT
0/1/CPU0 A9K-MOD400-TR IOS XR RUN NSHUT
0/1/0 A9K-MPA-20X10GE OK
0/1/1 A9K-MPA-1X100GE OK
0/PT0 A9K-AC-PEM-V3 OPERATIONAL NSHUT
0/PT1 A9K-AC-PEM-V3 OPERATIONAL NSHUT
“Show memory summary”显示12.5GB,“admin show system resource”显示16GB
RP/0/RSP0/CPU0:R2#show memory summary
node: node0_RSP0_CPU0
------------------------------------------------------------------
Physical Memory: 12496M total (8465M available)
Application Memory : 12496M (8287M available)
Image: 4M (bootram: 0M)
Reserved: 0M, IOMem: 0M, flashfsys: 0M
Total shared window: 128M
RP/0/RSP0/CPU0:R2#admin show system resou
Node Physical Application Boot Partition CPUs Shmwin
Total Available Cached Total Available Cached Total Available
0/RSP0-Host 16217M^ 276M^ 29M 15837M^ 271M^ 28 923M 592M 8 N/A
0/RSP0-Admin 1940M 1158M 78M 1894M 1131M 76 2308M 1451M 1 N/A
0/RSP0-XR 12796M 8488M 888M 12496M 8288M 867 N/A N/A 6 3071M
0/1-Host 24491M 11510M 127M 23917M 11241M 124 923M 592M 6 N/A
0/1-Admin 1008M 471M 90M 984M 460M 88 2308M 1528M 1 N/A
0/1-XR 10948M 5902M 2343M 10691M 5764M 2288 N/A N/A 5 3071M
但是,如果我们检查32位XR,则显示总物理内存,如数据表中所述:
RP/0/RSP0/CPU0:R3#show memory summary
Physical Memory: 16384M total (12600M available)
Application Memory : 16043M (12600M available)
Image: 100M (bootram: 100M)
Reserved: 224M, IOMem: 0, flashfsys: 0
Total shared window: 51M
RP/0/RSP0/CPU0:R3#show platform
Node Type State Config State
-----------------------------------------------------------------------------
0/RSP0/CPU0 A99-RSP-TR(Active) IOS XR RUN PWR,NSHUT,MON
0/RSP1/CPU0 A99-RSP-TR(Standby) IOS XR RUN PWR,NSHUT,MON
0/1/CPU0 A9K-MOD400-SE IOS XR RUN PWR,NSHUT,MON
0/1/0 A9K-MPA-20X10GE OK PWR,NSHUT,MON
0/1/1 A9K-MPA-2X100GE OK PWR,NSHUT,MON
0/2/CPU0 A99-8X100GE-SE IOS XR RUN PWR,NSHUT,MON
0/4/CPU0 A9K-MOD400-TR IOS XR RUN PWR,NSHUT,MON
0/4/0 A9K-MPA-8X10GE OK PWR,NSHUT,MON
0/4/1 A9K-MPA-2X40GE OK PWR,NSHUT,MON
分析
从版本6.2.1开始,ASR9K上的eXR将使用虚拟机(VM)虚拟化模型,从版本6.1.2和6.1.3中使用的Linux容器(LXC)模型切换而来。
与虚拟机(VM)相比,容器可将更多的应用程序装入单个物理服务器。
VM会占用很多系统资源。每个VM运行的不只是操作系统的完整副本,而是操作系统(OS)需要运行的所有硬件的虚拟副本。这可能会增加大量内存和CPU周期。相反,容器需要的只是操作系统、支持程序和库以及系统资源足以运行特定程序。但是,虚拟机可以更灵活地适应服务中软件升级(ISSU)等功能。
由于Linux Containers共享主机的物理资源和内核,而每个VM都需要其自己的操作系统和虚拟化硬件,这可以解释为什么每个VM从整个主机分配了特定数量的资源,从而导致show memory summary不显示eXR 6.2.1及更高版本上的总体物理内存总量。Linux容器也可以限制分配的内存,因为它显示在NCS5000和NCS5500平台上,并且在这些平台上观察到“show memory summary”CLI的相同行为。