소개
이 문서에서는 HTTP 서버의 도움을 받아 APIC를 리이미징하는 방법에 대해 설명합니다.
문제
APIC 클러스터가 중단되거나 L2/M2에서 L4/M4로 하드웨어 마이그레이션이 발생하는 경우, 개별 APIC 디바이스에서 기능을 복원하려면 이미지를 다시 생성해야 할 수 있습니다. 이 절차에서는 HTTP 서버를 사용하여 APIC를 하나씩 리이미징하는 간소화된 접근 방식을 통해 중단을 최소화하면서 클러스터 복구 속도를 높일 수 있습니다.
재이미징이 필요한 각 APIC 디바이스에 대해 순차적으로 프로세스를 반복합니다. 모든 APIC가 다시 이미지화되면 필요에 따라 클러스터 컨피그레이션을 복원하고 철저한 테스트를 통해 기능을 검증합니다.
이 간결한 절차를 통해 효율적인 APIC 복구가 가능하므로 관리자가 클러스터 고장을 신속하게 해결하고 네트워크 운영을 효과적으로 복원할 수 있습니다.
전제 조건
- CIMC는 OOB IP 주소로 구성해야 합니다.
- APIC Release notes(APIC 릴리스 노트)를 확인하고 어떤 APIC 소프트웨어 이미지를 리이미징해야 하는지 확인합니다.
- software.cisco.com에서 소프트웨어 이미지 가져오기
- 이미지의 MD5 체크섬이 Cisco.com에 게시된 것과 일치하는지 확인합니다.
- HTTP 서버에 APIC 이미지를 업로드합니다.
솔루션
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)
3단계. 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)
4단계. Cisco Integrated Management Controller에 대한 SSH/콘솔
# ssh admin@cimc_ip
여기서 cimc_ip는 CIMC IP 주소입니다. 예를 들면 다음과 같습니다.
# ssh admin@x.x.x.x
admin@x.x.x.x's password:
system#
-
범위를 Virtual Media로 변경합니다.
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
Map-Status(맵 상태)가 OK(확인)로 표시되어야 합니다.
예를 들면 다음과 같습니다.
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 #
-
SOL에 연결하여 설치 프로세스를 모니터링합니다.
system /vmedia # connect host
CISCO Serial Over LAN:
Press Ctrl+x to Exit the session
5단계. 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 키를 누른 후
참고: Opportunity를 놓쳐 적절한 시점에 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-Mapped 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)
6단계. CIMC CLI로 돌아가 "Connect Host"의 출력을 모니터링합니다.
CIMC cli를 모니터링하여 "To speed up the install, enter iso url in next 10 minutes" 메시지를 얻은 다음 APIC 이미지가 있는 http 서버 URL을 입력합니다.
++ 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단계: 올바른 인터페이스 확인
인터페이스를 입력한 후 http 서버에 ping을 시도하고 선택한 인터페이스가 올바르면 패킷 손실이 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단계: PowerOff 후 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(시스템 전원 켜기)을 선택하여 컨트롤러 및 Lunch KVM을 켜면 APIC Initial Configuration(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)