SFCBD(Small Footprint CIM Broker)
안녕하세요. 오늘은 ESXi Host에서 실행되는 서비스 중 하나인 SFCB에 대해서 알아보도록 하겠습니다.
WBEM
WBEM은 Web-Based Enterprise Management의 약자로 원격으로 System 관리를 가능케 하는 기술
이에 대한 표준 기술로 CIM Infrastructure Schema, CIM-XML, CIM over HTTP, WS-Management, DMTF Open Standards 등이 있음
WBEM은 Client-Server 모델로, WBEM Client가 HTTP/HTTPS를 통해 WBEM Server로부터 필요한 정보를 CIM-XML Format으로 주고 받음
WBEM Server는 전달받은 CIM-XML Format의 데이터를 Decode하여 Hardware 장치로부터 정보를 얻어 이를 다시 CIM-XML Format으로 WBEM Client에게 전달
Hardware 장치로부터 정보를 얻기 위해 사용되는 WBEM Provider들은 Hardware Vendor로부터 제공 받음
WBME Server와 WBE Provider 간에 정보를 주고 받기 위해 CMPI Standard(Programming Interface) 사용
ESXi Host에서는 WBEM Server가 SFCBD 프로세스
CIM
CIM은 Common Information Model의 약자로 System이 관리하는 주요 Object를 정의하는데 사용
WBEM이 CIM을 사용하며 WBEM Provider가 곧 CIM Provider
ESXi SFCB
SFCBD는 /etc/init.d/sfcbd-watchdog script에 의해서 시작되고, 이 때 ProviderManger도 시작
# ps_-cPTgjstz.txt WID CID WorldName GID PGID SID PCID Type State Wait CPU Time Command 36805740 36805739 sfcb-ProviderMa 36805739 36795125 36795125 36795125 UX WAIT USIG 0-79 0.51 /bin/sfcbd |
ProviderManager는 /etc/sfcb 디렉토리에 위치한 sfcb.cfg 파일을 로드
/etc/sfcb/sfcb.cfg # Generated by sfcb-config.py. Do not modify this header. # VMware ESXi 6.5.0 # basicAuthLib: sfcBasicPAMAuthentication certificateAuthLib: sfcCertificateAuthentication cimXmlFdHardLimit: 1024 cimXmlFdSoftLimit: 512 doBasicAuth: true enableHttp: true enableHttps: true enableInterOp: true enabled:true httpLocalOnly: true httpPort: 5988 httpProcs: 2 httpsPort: 5989 httpsProcs: 4 intSockTimeout: 600 keepaliveMaxRequest: 10 keepaliveTimeout: 1 loglevel: warning maxFailureThreshold: 3 maxSemInitRetries: 5 provProcs: 16 providerTimeoutInterval: 120 rcvSocketTimeOut: 0 registrationDir: /var/lib/sfcb/registration requestQueueSize: 10 sslCertificateFilePath: /etc/vmware/ssl/rui.crt sslClientCertificate: ignore sslClientTrustStore: /etc/sfcb/client.pem sslKeyFilePath: /etc/vmware/ssl/rui.key threadPoolSize: 5 threadStackSize: 524288 useChunking: true wsman: true |
Provider Manager
Provider Manager는 ps command에서 아래 결과로 확인
# ps -Tcjstv | egrep "WID|sfcb-ProviderMa" WID CID WorldName GID Type State Wait CPU Time Command 2112056 2112056 sfcb-ProviderMa 2112056 User WAIT USOCKR 0-63 1.661601 /bin/sfcbd 2112066 2112065 sfcb-ProviderMa 2112065 User,Clone WAIT USIG 0-63 0.48 /bin/sfcbd 2112116 2112115 sfcb-ProviderMa 2112115 User,Clone WAIT USIG 0-63 0.53 /bin/sfcbd 2112123 2112122 sfcb-ProviderMa 2112122 User,Clone WAIT USIG 0-63 0.42 /bin/sfcbd 2112131 2112130 sfcb-ProviderMa 2112130 User,Clone WAIT USIG 0-63 0.36 /bin/sfcbd 2142843 2142843 egrep 2142843 User WAIT UPIPER 0-63 0.1856 egrep WID|sfcb-ProviderMa |
HTTP/HTTPS Daemon
ProviderManager는 sfcbd HTTP/HTTPS daemon을 시작
해당 daemon은 ps command에서 아래 결과로 확인
# ps -Tcjstv | egrep "WID|sfcb-HTTP" WID CID WorldName GID Type State Wait CPU Time Command 2112061 2112061 sfcb-HTTPS-Daem 2112061 User WAIT UPOL 0-63 0.82219 /bin/sfcbd 2112062 2112062 sfcb-HTTP-Daemo 2112062 User WAIT KTCP 0-63 1.818552 /bin/sfcbd 2112064 2112062 sfcb-HTTP-Daemo 2112062 User,Clone WAIT USIG 0-63 0.75557 /bin/sfcbd 2112074 2112061 sfcb-HTTPS-Daem 2112061 User,Clone WAIT USIG 0-63 0.333 /bin/sfcbd 2142746 2142746 egrep 2142746 User WAIT UPIPER 0-63 0.0 egrep WID|sfcb-HTTP |
Port Number는 /etc/sfcb/sfcb.cfg 에 설정되어 있으며, 5988은 HTTP, 5989는 HTTPS를 각각 Listening
# esxcli network ip connection list | grep 598 tcp 0 0 127.0.0.1:5988 127.0.0.1:16571 FIN_WAIT_2 2112062 newreno sfcb-HTTP-Daemo tcp 0 0 127.0.0.1:16571 127.0.0.1:5988 CLOSE_WAIT 2100901 newreno hostd-worker tcp 0 0 127.0.0.1:5988 127.0.0.1:11504 TIME_WAIT 0 tcp 0 0 0.0.0.0:5989 0.0.0.0:0 LISTEN 2112061 newreno sfcb-HTTPS-Daem tcp 0 0 127.0.0.1:5988 0.0.0.0:0 LISTEN 2112062 newreno sfcb-HTTP-Daemo |
WBEM Client와의 연결이 생성되는 경우, CIMXML-Processor 프로세스가 생성되고 이 후의 WBEM Client로부터의 요청은 CIMXML-Processor가 처리
CIMXML-Processor
CIMXML-Processor는 WBEM Client로부터의 CIM-XML 형태의 요청을 Parse
그리고 요청받은 정보에 대한 결과를 Return 하기 위해서 Provider Manager와 Provider로부터 정보를 수집
이 때 CIMXML-Processor는 획득한 정보를 다시 XML 형태로 변환하여 WBEM Client에게 전달
SFCBD 활성화
## SFCDB 활성화 여부 확인 : Enabled가 false로 설정(by default) # esxcli system wbem get Enabled: false WS-Management Service: true Enable HTTPS: true Authorization Model: password Port: 5989 HTTP Procs: 2 HTTPS Procs: 4 Provider Procs: 16 Keepalive Timeout: 1 Keepalive Max Requests: 10 Provider Sample Interval: 30 Provider Timeout Interval: 120 HTTP Max Content Length: 1048576 Max Message Length: 40000000 Thread Stack Size: 1048576 Provider Resource Pool Override: SSL Cipher List: !aNULL:kECDH+AESGCM:ECDH+AESGCM:RSA+AESGCM:kECDH+AES:ECDH+AES:RSA+AES Threadpool Size: 5 Readonly: false Log Level: warning Service Location Protocol PID: 0 WS-Management PID: 0 CIM Object Manager PID: 0 Enabled SSL Protocols: Enabled System SSL Protocols: tlsv1.2 Enabled Running SSL Protocols: ## SFCBD 활성화 # esxcli system wbem set --enable true ## SFCBD 활성화 여부 확인 : Enabled가 true로 변경 # esxcli system wbem get Enabled: true WS-Management Service: true Enable HTTPS: true Authorization Model: password Port: 5989 HTTP Procs: 2 HTTPS Procs: 4 Provider Procs: 16 Keepalive Timeout: 1 Keepalive Max Requests: 10 Provider Sample Interval: 30 Provider Timeout Interval: 120 HTTP Max Content Length: 1048576 Max Message Length: 40000000 Thread Stack Size: 1048576 Provider Resource Pool Override: SSL Cipher List: !aNULL:kECDH+AESGCM:ECDH+AESGCM:RSA+AESGCM:kECDH+AES:ECDH+AES:RSA+AES Threadpool Size: 5 Readonly: false Log Level: warning Service Location Protocol PID: 2100491 WS-Management PID: 2112099 CIM Object Manager PID: 2112130 Enabled SSL Protocols: Enabled System SSL Protocols: tlsv1.2 Enabled Running SSL Protocols: tlsv1.2 ## SFCBD 실행 여부 확인 # /etc/init.d/sfcbd-watchdog status sfcbd-init[2112145]: args ('status') sfcbd-init[2112145]: Getting Exclusive access, please wait... sfcbd-init[2112145]: Exclusive access granted. sfcbd is running |
SFCBD 연결 테스트
## SFCBD 포트 Listening 여부 확인 # esxcli network ip connection list | grep 5989 tcp 0 0 0.0.0.0:5989 0.0.0.0:0 LISTEN 2112061 newreno sfcb-HTTPS-Daem ## Client에서 ESXi Host의 5989 포트 연결 테스트 C:\Users\Administrator\Downloads\curl-8.0.1_8-win64-mingw\curl-8.0.1_8-win64-mingw\bin>curl -sv https://192.168.1.10:5989 * Trying 192.168.1.10:5989... * Connected to 192.168.1.10 (192.168.1.10) port 5989 (#0) * ALPN: offers h2,http/1.1 * TLSv1.3 (OUT), TLS handshake, Client hello (1): * CAfile: C:\Users\Administrator\Downloads\curl-8.0.1_8-win64-mingw\curl-8.0.1_8-win64-mingw\bin\curl-ca-bundle.crt * CApath: none * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (OUT), TLS alert, unknown CA (560): * SSL certificate problem: self-signed certificate in certificate chain * Closing connection 0 |
[참고 자료]
How to disable or enable the SFCB service (CIM Server) on the ESX/ESXi host (1025757)
https://kb.vmware.com/s/article/1025757
How to manage SSL and TLS Protocols for ESXi SFCB Daemon (2151279)
https://kb.vmware.com/s/article/2151279