简介
本文档介绍如何使用HTTP服务器对APIC进行重新映像。
问题
如果APIC集群发生故障或硬件从L2/M2迁移到L4/M4,则各个APIC设备可能需要重新映像才能恢复功能。此过程概述一种简化的方法,该方法使用HTTP服务器逐一重新映像APIC,从而以最少的中断促进更快的集群恢复。
对需要重新映像的每个APIC设备依次重复此过程。对所有APIC重新映像后,根据需要恢复集群配置,并进行彻底测试以验证功能。
此简明的过程可实现高效的APIC恢复,使管理员能够及时解决集群故障并有效恢复网络运营。
前提条件
- CIMC必须配置OOB IP地址。
- 检查APIC版本说明,并确认需要重新映像哪个APIC软件映像。
- 从software.cisco.com获取软件映像
- 确认映像的MD5校验和与在Cisco.com上发布的版本匹配
- 上传APIC映像到HTTP服务器。
解决方案
要使用HTTP服务器重新映像APIC,需要执行以下步骤。
第1步:首先,您需要从Cisco网站下载固件。
打开software.cisco.com/download。
第2步:输入APIC并在此处为ACI选择适当的版本。在此选择4.2(7f)。
例如:
![来自CCO的图像列表](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-00.png)
第三步:将APIC软件.iso映像复制到HTTP服务器
示例:- http://x.x.x.x/iso/
![来自HTTP服务器的映像列表](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-01.png)
第四步:通过SSH/控制台连接到思科集成管理控制器
# ssh admin@cimc_ip
其中cimc_ip是CIMC IP地址。例如:
# ssh admin@x.x.x.x
admin@x.x.x.x's password:
system#
system# scope vmedia
system /vmedia #
system /vmedia # map-www volume_name http://http_server_ip_and_path iso_file_name
其中:
- volume_name是卷的名称。
- http_server_ip_and_path是HTTP服务器的IP地址和.iso文件位置的路径。
- iso_filename是.iso文件的名称。
注意:http_server_ip_and_path与iso_filename之间存在空格
例如:
system /vmedia # map-www apic http://x.x.x.x/iso/ aci-apic-dk9.4.2.7f.iso
Server username: admin
Server password:
Confirm password:
注意: /*如果此处不需要身份验证,请按Enter键
system /vmedia # show mappings detail
映射状态必须显示为正常。
例如:
system /vmedia # show mappings detail
Volume apic:
Map-Status: OK
Drive-Type: CD
Remote-Share: http://x.x.x.x/iso/
Remote-File: aci-apic-dk9.4.2.7f.iso
Mount-Type: www
Mount-Options: noauto,username=admin,password=********3
system /vmedia #
system /vmedia # connect host
CISCO Serial Over LAN:
Press Ctrl+x to Exit the session
第五步:从CIMC GUI的KVM控制台重新通电
选择Power(电源)> Power Cycle System (cold boot)以重启控制器
![CIMC重新通电](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-02.png)
从SOL控制台:在引导过程中观察屏幕,准备在适当的时间按F6以进入引导选择菜单。
例如:
![引导菜单](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-03.png)
按F6之后
注意:如果错过机会并且无法在适当的时刻按F6,请返回第5步对控制器重新通电并重复此过程,直到可以按F6进入引导选择菜单。
![进入引导菜单](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-04.png)
您还必须输入BIOS密码。默认密码是password
![CIMC密码](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-05.png)
在引导选择菜单中,选择Cisco CIMC映射的vDVD1.22选项作为一次性引导设备。
![CIMC映射vDVD](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-06.png)
第六步:返回CIMC CLI并监控“连接主机”的输出结果。
监控CIMC cli时,收到消息“要加速安装,请在接下来的10分钟内输入iso url”,然后输入http服务器URL和APIC映像。
++ grep /run/install/repo
++ cut -f 1 -d ' '
++ tr -d '[:digit:]'
+ usbdevice=/dev/sr
+ mkdir /mnt/usbdata
+ mount /dev/sr2 /mnt/usbdata
mount: special device /dev/sr2 does not exist
+ true
+ '[' -f /mnt/usbdata/ifabric.iso ']'
+ mountpoint -q /mnt/usbdata
+ true
+ echo 'INFO: found second partition on install media but did not find ifabric.iso. '
INFO: found second partition on install media but did not find ifabric.iso.
+ echo 'Continuing on to ISO URL prompt.'
Continuing on to ISO URL prompt.
+ '[' 0 -eq 0 ']'
+ read_iso_url
+ true,,
+ echo 'To speed up the install, enter iso url in next ten minutes: ' << Enter the http server URL with apic image >>
To speed up the install, enter iso url in next ten minutes:
+ read -t 600 -p '? ' url
?
http://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso 5:program-log << Enter the http server details >>
[anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
注意:http_server_ip_and_path与iso_filename之间没有空格。
第7步:输入HTTP URL后,引导过程将继续。
注意:如果选择静态选项,系统将提示您输入接口名称、管理IP地址和网关。
+ '[' 0 -eq 0 ']'
+ read_iso_url
+ true
+ echo 'To speed up the install, enter iso url in next ten minutes: '
To speed up the install, enter iso url in next ten minutes:
+ read -t 600 -p '? ' url
?
[ahttp://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso 5:program-log
++ awk -F '/|:' '{print $4}'
+ urlip=x.x.x.x
+ '[' -z http://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso ']'
+ '[' -z x.x.x.x ']'
+ break
+ '[' -n http://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso ']'
+ set +e
+ configured=0
+ '[' 0 -eq 0 ']'
+ echo 'Configuring network interface'
Configuring network interface
+ echo 'type static, dhcp, bash for a shell to configure networking, or url to re-enter the url: '
>>
<< Type static and configure the APIC OOB IP address with it’s gateway>>
type static, dhcp, bash for a shell to configure networking, or url to re-enter the url:
+ read -p '? ' ntype
? static. << Enter the static to configure the networking >>
[anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
注:键入静态命令后,它将列出CIMC接口,选择正确的接口。如果选择了错误的接口,则丢包率为100%,然后ping尝试三次失败后,它将再次要求选择正确的接口,直到丢包率为0。如果您不知道接口,请依次选择所有接口。
例如:
+ case $ntype in
+ configure_static
+ echo 'Available interfaces'
Available interfaces
+ ls -l /sys/class/net
total 0
lrwxrwxrwx. 1 root root 0 May 3 07:08 enp11s0 -> ../../devices/pci0000:00/0000:00:03.0/0000:06:00.0/0000:07:01.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/net/enp11s0
lrwxrwxrwx. 1 root root 0 May 3 07:08 enp12s0 -> ../../devices/pci0000:00/0000:00:03.0/0000:06:00.0/0000:07:01.0/0000:09:00.0/0000:0a:01.0/0000:0c:00.0/net/enp12s0
lrwxrwxrwx. 1 root root 0 May 3 07:08 enp1s0f0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0f0
lrwxrwxrwx. 1 root root 0 May 3 07:08 enp1s0f1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.1/net/enp1s0f1
lrwxrwxrwx. 1 root root 0 May 3 07:08 lo -> ../../devices/virtual/net/lo
+ read -p 'Interface to configure: ' interface
Interface to configure: enp1s0f0 << select the correct interface >>
[anaconda] 1:main* 2:shell 3:log 4:storage-lo>
第8步:检查正确的接口
进入接口后,它将尝试ping http服务器,如果所选接口正确,则数据包丢失率必须为0%,并开始从http服务器获取映像。
例如:在输入正确的接口后,数据包丢失率为0%。
+ read -p 'Interface to configure: ' interface
Interface to configure: enp1s0f0
+ read -p 'address: ' addr
address: x.x.x.x/24
+ read -p 'gateway: ' gw
gateway: x.x.x.x
+ ip addr add x.x.x.x/24 dev enp1s0f0
+ ip link set enp1s0f0 up
+ ip route add default via x.x.x.x
++ seq 1 2
+ for count in '$(seq 1 2)'
+ ping -c 1 x.x.x.x
PING x.x.x.x (x.x.x.x) 56(84) bytes of data.
64 bytes from x.x.x.x: icmp_seq=1 ttl=64 time=55.0 ms
--- x.x.x.x ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 55.056/55.056/55.056/0.000 ms
+ configured=1
+ break
+ '[' 1 -eq 0 ']'
+ echo 'Fetching http://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso'
Fetching http://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso >> started fetching the apic image from HTTP server
+ wget -o /dev/null -O /tmp/cdrom.iso http://x.x.x.x/iso/aci-apic-dk9.4.2.7f.iso
如果您选择了错误的接口,则数据包将丢失100%,在三次尝试ping失败后,它将再次要求选择正确的接口。
例如:在进入错误接口后,100%的数据包丢失
+ read -p 'Interface to configure: ' interface
Interface to configure: enp11s0
+ read -p 'address: ' addr
address: x.x.x.x/24
+ read -p 'gateway: ' gw
gateway: x.x.x.x
+ ip addr add x.x.x.x/24 dev enp11s0
+ ip link set enp11s0 up
+ ip route add default via x.x.x.x
++ seq 1 2
+ for count in '$(seq 1 2)'
+ ping -c 1 x.x.x.x
PING x.x.x.x (x.x.x.x) 56(84) bytes of data.
From x.x.x.x icmp_seq=1 Destination Host Unreachable
--- x.x.x.x ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
+ sleep 20
+ for count in '$(seq 1 2)'
+ ping -c 1 x.x.x.x
PING x.x.x.x (x.x.x.x) 56(84) bytes of data.
From x.x.x.x icmp_seq=1 Destination Host Unreachable
--- x.x.x.x ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
+ sleep 20
+ '[' 0 -eq 0 ']'
+ echo 'Configuring network interface'
Configuring network interface
+ echo 'type static, dhcp, bash for a shell to configure networking, or url to re-enter the url: ' <<Asking again to select the interface after selecting the type i,e static >>
type static, dhcp, bash for a shell to configure networking, or url to re-enter the url:
+ read -p '? ' ntype
?
保持监控CIMC CLI并等待约40-50分钟,您将在cli上获得以下输出。
[anaconda] 1:main* 2:shell 3:log 4:storage-lo> Switch tab: Alt+Tab | Help: F1
[ OK ] Started Show Plymouth Power Off Screen.
[ OK ] Stopped Availability of block devices.
Stopping Logout off all iSCSI sessions on shutdown...
Stopping LVM2 metadata daemon...
[ OK ] Stopped LVM2 metadata daemon.
[ OK ] Stopped Logout off all iSCSI sessions on shutdown.
[ OK ] Stopped target Network.
[ OK ] Stopped Remount Root and Kernel File Systems.
Stopping Remount Root and Kernel File Systems...
[ OK ] Started Restore /run/initramfs.
[ OK ] Reached target Shutdown.
dracut Warning: Killing all remaining processes
Powering off.
reboot: Power down
第9步:关闭电源后退出SOL
等待,直到您在SOL控制台中看到消息poweroff,然后按下Ctrl和x(Ctrl+x)退出SOL,再次登录CIMC并再次更改范围。
(i) Change the scope to virtual media again:
system# scope vmedia
system /vmedia #
(ii) Unmap the .iso image that you mapped in 2.c:
system /vmedia # unmap volume_name
At the Save mapping prompt, enter yes if you want to save the mapping or no if you do not want to save the mapping. For example:
system /vmedia # unmap apic
Save mapping? Enther 'yes' or 'no' to confirm (CTRL-C to cancel) → yes
system /vmedia #
(iii) Connect back to SOL again:
system /vmedia # connect host
第10步:初始配置
从KVM控制台:依次选择Power(电源)> Power on System(开机系统),打开控制器和Sunch KVM的电源,系统将要求APIC初始配置
![APIC设置](/c/dam/en/us/support/docs/cloud-systems-management/application-policy-infrastructure-controller-apic/222040-steps-to-re-image-apic-controller-via-ht-07.png)