Nutanix를 하드웨어 레벨에서 관리하려면 장비의 IPMI(Intelligent Platform Management Interface)툴을 사용 할 줄 알아야 합니다. 이 툴은 하드웨어를 원격으로 모니터링·제어하기 위한 클라이언트 소프트웨어로 실제 Nutanix 제품에서는 BMC(Baseboard Management Controller)이고, 여기에 IPMI 프로토콜로 접속하는 프로그램이 IPMI 툴이라고 보면 됩니다. 오늘은 이 툴 사용방법에 대해 알아보도록 할께요.
나도 처음엔 뉴타닉스(Nutanix) 클러스터 올리고 나서 관리 IP 잡는다고 엄청 헤맸다. 슈퍼마이크로(SuperMicro) 장비 쓰면서 매번 덜덜거리는 카트 끌고 서버실 들어가서 모니터 연결하고 키보드 꽂고... 진짜 원시인이 따로 없었지. 겨울엔 춥고 여름엔 시끄러운 그 지옥 같은 곳에서 고생할 필요가 전혀 없는데 말이다. AHV에 SSH로 접속해서 명령어 몇 줄만 툭툭 치면 끝날 일을 우리는 왜 그렇게 어렵게 했을까?
아니 도대체 ipmicfg랑 ipmitool, 뭐가 다른 건데?
구글링 좀 해본 사람들은 알 거다. 어떤 블로그는 ipmitool을 쓰라고 하고, 어디는 ipmicfg를 쓰라고 한다. 처음엔 진짜 헷갈린다. 깔끔하게 정리해 줄 테니까 머릿속에 박아둬라. ㅎ
ipmitool은 그냥 오픈소스 툴이다. HP든 델이든 벤더 안 가리고 다 먹히는 범용템.
특히 외부에서 LAN 타고 원격으로 아웃오브밴드(Out-of-band) 접속할 때 진짜
편하거든.
근데 우리가 지금 만지는 게 슈퍼마이크로 장비라면 얘기가 완전 달라진다. 이때는
무조건 ipmicfg를 써야 됨. 이건 슈마 전용으로 깎아 만든 독점 무기야. OS 안
가리고 인밴드(In-band)에서 쌩으로 돌릴 수 있고 따로 뭐 설치할 필요도 없다.
차이는 로그 디테일에서 확 벌어진다. 일반 Tool 로는 죽어도 안 보이는 전원 공급
장치(FRU) 상태나 세세한 하드웨어 에러 로그는 무조건 이걸로 까봐야 답이 나옴.
|
| ipmicfg 명령어 옵션들 |
새벽 3시 서버실, 게이트웨이 오타 내고 식은땀 흘린 썰
내가 사원 때 진짜 아찔했던 경험 하나 풀께. 야간 작업 중에 클러스터 관리망 IP 대역을 통째로 바꿔야 하는 미션이 떨어졌지. 한참 비몽사몽하던 새벽 3시에 멍때리다가 게이트웨이 끝자리를 .1이 아니라 .11로 오타를 낸 거다. 엔터 치는 순간 SSH 세션이 툭 끊어지는데 와... 진짜 등줄기에 땀이 비 오듯 쏟아지더라. 담당자 분한테 전화해서 '죄송합니다 서버 통신이 죽었습니다' 보고하고 짐 싸야 하나 오만가지 생각이 다 들었지.
패딩 하나 대충 걸치고 덜덜 떨리는 손으로 서버실 뛰어들어가서 크래시카트(이동식 모니터) 물려봤다. 다행히 AHV OS 자체는 멀쩡하게 돌아가고 있더라구. 바로 로컬 터미널 띄워서 다시 ipmicfg로 IP 잡아줬지. 그때 깨달았다. 네트워크 설정 꼬여서 원격 접속 날아가도 당황할 필요가 전혀 없다는 걸.
IP 설정했다고 제발 서버 껐다 켜지 마
이거 모르는 주니어들 진짜 많더라. 관리망 IP 세팅 새로 하면 무조건 장비
재부팅해야 적용되는 줄 아는 사람들.
ipmicfg로 IP 세팅하면 재부팅 진짜 필요 없다. 세팅값 날리고 한 2분 정도 커피 한
잔 타고 오면 지가 알아서 IPMI만 싹 재초기화됨. 다운타임 잡는다고 욕먹어가며
주말 야간작업 잡을 이유가 하나도 없다는 뜻이다.
/ipmicfg -dhcp off
/ipmicfg -m 192.168.0.10
/ipmicfg -k 255.255.255.0
/ipmicfg -g 192.168.0.1
그냥 저거 순서대로 AHV에서 때려. 설정 잘 먹었는지 쫄리면 뒤에 파라미터 빼고
-m만 쳐보면 바로 현재 세팅된 IP랑 MAC 주소가 딱 뜬다.
칼퇴를 부르는 클러스터 싹쓸이 패스워드 변경법
보안 감사 뜰 때마다 서버 10대, 20대 패스워드 바꿀 때 한 대씩 일일이 접속해서
바꾸고 있는 막내들 보면 진짜 눈물이 앞을 가린다. 뉴타닉스 클러스터로 다
묶여있잖아? hostssh 이거 하나면 한 방에 끝남.
hostssh "ipmitool user set password 2 <새로운패스워드>"
여기서 '2'가 ADMIN 계정 기본 아이디다. 조심할 건 슈마는 비밀번호 최대 길이가 19자고 ESXi 호스트는 15자라는 거. 작년에 우리 팀 막내가 이거 모르고 20자짜리 빡센 비밀번호 밀어 넣었다가 절반은 먹히고 절반은 튕겨서 클러스터 전체가 멘붕 온 적 있지.. 아 그때만 생각하면,, 아프다 마음이 ㅋ
그리고 패스워드에 특수문자 &;'"|*?˜<>()[]{}$\n\r 이런
거 넣으면 백퍼 에러 뱉어내니까 그냥 깔끔하게 가자. 느낌표(!)나 골뱅이(@)
정도만 섞어 쓰는 게 정신건강에 이롭다. 비번 싹 다 바꾸고 찝찝하면
hostssh "ipmitool mc reset cold" 날려서 BMC 펌웨어 리프레시 한 번
시원하게 해주고 퇴근하면 됨.
이 경험을 통해 알게 된 실무 전용 서버 관리 꿀팁
맨땅에 헤딩하면서 직접 터득한 진짜배기 정보들만 모아봤다. 이거 메모장에 꼭 적어놔.
-
상태 체크는 묻지도 따지지도 말고 요약본부터: AHV
접속하자마자 제일 먼저
/ipmicfg -summary부터 치는 버릇을 들여라. 여기서 BIOS 버전까지 한 큐에 확인되니까 괜히 다른 콘솔 가서 삽질할 필요가 없겠지. -
서버실 팬 소음 미쳐버릴 때 대처법: 조용하던 서버실에서
갑자기 비행기 이륙하는 소리 나면 등골이 싸늘해진다. 당황하지 말고
/ipmicfg -fan쳐서 현재 팬 모드부터 봐라. 보통 Standard(0)인데 어떤 이유로 Full(1)이나 Heavy IO(4)로 돌아가고 있을 수 있음.-fan 0날려주면 바로 다시 고요해진다. -
파워 나갔을 때 내 책임으로 덤터기 안 쓰는 법: 파워 쪽 알람
떴을 때 무작정 벤더 부르기 전에
/ipmicfg -pminfo(PMBus 상태)랑-psfruinfo(FRU 상태) 이거 두 개는 무조건 텍스트로 긁어놔라. 온도 몇 도 찍혔는지, 인풋 전압 정상인지 볼트(V), 암페어(A) 단위까지 싹 다 나온다. 이 로그 캡처해 놔야 나중에 하드웨어 불량 잡을 때 벤더사랑 기싸움에서 안 밀린다.
참고용: ipmicfg 전체 명령어 목록
실무에서 자주 쓰는 것들 말고도 어떤 기능이 있는지 전체 목록을 한 번 훑어보는 것도 도움이 된다. /ipmicfg -help를 치면 나오는 내용이다. 나중에 필요할 때 검색해서 쓰기 좋게 박스 안에 정리해 둔다.
[root@ahv1 ~]# /ipmicfg -help
IPMICFG Version 1.34.2 (Build 230224)
Copyright(c) 2023 Super Micro Computer, Inc.
Usage: IPMICFG params (Example: IPMICFG -m 192.168.1.123)
-help Display a list of commands
-m Shows IPv4 address and MAC.
-m <ip> Sets IPv4 address (format: ###.###.###.###).
-a <mac> Sets MAC (format: ##:##:##:##:##:##).
-k Shows Subnet Mask.
-k <mask> Sets Subnet Mask (format: ###.###.###.###).
-dhcp Gets the DHCP status.
-dhcp on Enables the DHCP.
-dhcp off Disables the DHCP.
-g Shows a Gateway IP.
-g <gateway> Sets a Gateway IP (format: ###.###.###.###).
-garp on Enables the Gratuitous ARP.
-garp off Disables the Gratuitous ARP.
-r Performs a BMC cold reset.
Detects if a BMC reset was successfully performed
on the IPMI device, use -d after -r.
-fd <option> Resets to the factory defaults without preserving
configurations.
option: 1 | Preserves User configurations
option: 2 | Restores to factory default and
default password
option: 3 | Sets user defaults to ADMIN/ADMIN
-fdl Resets IPMI to the factory default. (Clean LAN).
-fde Resets IPMI to the factory default. (Clean FRU &
LAN).
-d Detects if a BMC reset was successfully performed
on the IPMI device.
Note that this option can be only used after -r,
-fd, -fdl or -fde
-ver Gets firmware revision.
-vlan Gets VLAN status.
-vlan on [VLAN tag] Enables the VLAN and sets the VLAN tag.
If VLAN tag is not given, it uses the previously
saved value.
-vlan off Disables the VLAN.
-selftest Checks and reports the basic health status of the
BMC.
-raw Sends a RAW IPMI request and prints a response.
Format: NetFn/LUN Cmd [Data1 ... DataN]
-fru info Shows information of the FRU inventory area.
-fru list Shows all FRU values.
-fru cthelp Shows chassis type code.
-fru help Shows help of FRU Write.
-fru <field> Shows FRU field value.
-fru <field> <value> Writes FRU.
-fru backup <file> Backs up FRU to a file <Binary format>.
-fru restore <file> Restores FRU from a file <Binary format>.
-fru tbackup <file> Backs up FRU to a file <Text format>.
-fru trestore <file> Restores FRU from a file <Text format>.
-fru ver <v1> <v2> Gets/Sets the FRU version. (<v1> and <v2> are
BCD-format)
-sel info Shows SEL information.
-sel list Shows SEL records.
-sel del Deletes all SEL records.
-sel raw Shows SEL raw data.
-sdr [full] Shows SDR records and readings.
-sdr del <sdr id> Deletes the SDR record.
-sdr ver <v1> <v2> Gets/Sets the SDR version. (<v1> and <v2> are
BCD-format)
-nm nmsdr Displays NM SDR.
-nm seltime Gets SEL time.
-nm deviceid Gets the ID of the ME device.
-nm reset Reboots ME.
-nm reset2default Forces ME to reset to default settings.
-nm updatemode Forces ME to enter the update mode.
-nm selftest Gets self-test results.
-nm listimagesinfo Lists ME information of images.
-nm oemgetpower OEM Power command for ME.
-nm oemgettemp OEM Temp. command for ME.
-nm pstate Gets the maximum allowed CPU P-State.
-nm tstate Gets the maximum allowed CPU T-State.
-nm cpumemtemp Gets CPU/memory temperature.
-nm hostcpudata Gets the host CPU data.
-fan Gets the fan mode.
-fan <mode> Sets the fan mode.
-pminfo [full] Displays PMBus health information of power supply.
-psfruinfo Displays FRU health information of power supply.
-psbbpinfo Displays status of the backup battery.
-autodischarge <module> Sets auto discharge by days.
<day>
-discharge <module> Manually discharges a battery.
-user list Lists user privileges.
-user help Shows a user privilege code.
-user add <user id> <name> Adds a user.
<password> <privilege>
-user del <user id> Deletes users.
-user level <user id> Updates user privileges.
<privilege>
-user setpwd <user id> Updates a user password.
<password>
-conf download <file> Downloads IPMI configuration to a binary file.
-conf upload <file> Uploads IPMI configuration from a binary file.
<option> option: -p | Bypass warning message
-conf tdownload <file> Downloads IPMI configuration to a text file.
-conf tupload <file> Uploads IPMI configuration from a text file.
<option> option: -p | Bypass warning message
-clrint Clears chassis intrusion.
-reset <index> Resets system and forces to boot from the selected
device.
-soft <index> Initiates a soft-shutdown for OS and forces system
to boot from the selected device.
-ipv6 mode Shows the IPv6 mode.
-ipv6 mode <mode> Sets the IPv6 mode.
-ipv6 autoconfig Shows IPv6 auto configuration.
-ipv6 autoconfig on Enables IPv6 auto configuration.
-ipv6 autoconfig off Disables IPv6 auto configuration.
-ipv6 list Lists IPv6 static and dynamic addresses.
-ipv6 duid Shows IPv6 DUID.
-ipv6 dns [ip] Gets/Sets IPv6 DNS server.
-ipv6 add <id> <ip> Adds IPv6 static address.
<prefix>
-ipv6 remove <id> Removes IPv6 static address.
-ipv6 route Displays IPv6 static route.
-ipv6 route on Enables IPv6 static route.
-ipv6 route off Disables IPv6 static route.
-ipv6 route list Lists IPv6 static router information.
-ipv6 route <id> <prefix Sets IPv6 static router information.
value> <prefix length>
<ip>
-ipv6 route clear <id> Clears IPv6 static router information.
-nvme list Displays the existing NVME SSD list.
-nvme info Displays NVME SSD information.
-nvme rescan Rescans all devices by in-band.
-nvme insert <aoc> <group> Inserts SSD by out-of-band.
<slot>
-nvme locate <HDD name> Locates SSD. (in-band)
-nvme locate <aoc> <group> Locates SSD. (out-of-band)
<slot>
-nvme stoplocate <HDD Stops locateing SSD. (in-band)
name>
-nvme stoplocate <aoc> Stops locateing SSD. (out-of-band)
<group> <slot>
-nvme remove <HDD name> Removes NVME device. (in-band)
[option1] [option2] option1: 0 | Do eject after remove (Default)
option1: 1 | Do not eject after remove
option2:-p | Bypass warning message
-nvme remove <aoc> <group> Removes NVME device. (out-of-band)
<slot> [option] option: -p | Bypass warning message
-nvme smartdata [HDD name] NVME S.M.A.R.T data.
-tas info Gets TAS information.
-tas pause Pauses a TAS service.
-tas resume Resumes a TAS service.
-tas refresh Triggers TAS to recollect data.
-tas clear Clears collected TAS data in BMC.
-tas period <sec> Sets the time length of a TAS update <limit 1 to 60
sec>.
-tas exec <cmd> Executes a user's specified command.
-tp info Gets MCU information.
-tp info <type> Gets information of MCU type. (type: 1 - 3)
-tp nodeid Gets a node ID.
-tp systemname [value] Gets/Sets a system name.
-tp systempn [value] Gets/Sets a system P/N.
-tp systemsn [value] Gets/Sets a system S/N.
-tp chassispn [value] Gets/Sets a chassis P/N.
-tp chassissn [value] Gets/Sets a chassis S/N.
-tp backplanepn [value] Gets/Sets a backplane P/N.
-tp backplanesn [value] Gets/Sets a backplane S/N.
-tp nodepn [value] Gets/Sets node P/N.
-tp nodesn [value] Gets/Sets node S/N.
-summary Displays FW and BIOS information.
-hostname [value] Gets/Sets a host name.
-dcmi cap Lists information of DCMI capabilities.
-dcmi power Gets the DCMI power readings.
-dcmi ctl [value] Gets/Sets the DCMI management controller ID string.
-mel list Shows BMC maintenance event log.
-mel download <file> Downloads a BMC maintenance event log to a file.
-mel clear Clears a BMC maintenance event log.
-addrptl [option] Gets/Sets IP address protocol.
option: 1 | IPv4
option: 2 | IPv6
option: 3 | Dual
-lockdown Checks the system's lockdown mode.
-lani [option] Gets/Sets LAN interface.
-linkstatus Shows network link status.
아무튼 이런 저런 생각나는데로 떠들었는데, 기록하고 정리하는 습관이 최고다. 여기에 정리해놓으면 그냥 찍어 가더라 ㅋㅋ 그냥 수고스럽지만 혼자 공부할 수 있게 일부러 내가 떠드는거 알지 ?

0 댓글