| 양쪽 이전 판 이전 판 다음 판 | 이전 판 |
| sushy-tools_redfish-vbmc_설정하기 [2025/04/23 03:54] – koov | sushy-tools_redfish-vbmc_설정하기 [2025/04/23 10:11] (현재) – [인증] koov |
|---|
| ===== 인증 ===== | ===== 인증 ===== |
| ''sushy-tools''에 인증을 적용하려면 설정파일의 ''SUSHY_EMULATOR_AUTH_FILE'' 지시자를 설정 한다. | ''sushy-tools''에 인증을 적용하려면 설정파일의 ''SUSHY_EMULATOR_AUTH_FILE'' 지시자를 설정 한다. |
| ''SUSHY_EMULATOR_AUTH_FILE = '/etc/sushy/sushy_authfile''' | ''SUSHY_EMULATOR_AUTH_FILE = '/etc/sushy/sushy-authfile''' |
| |
| 인증정보를 ''htpasswd''형식 파일로 생성한다. | 인증정보를 ''htpasswd''형식 파일로 생성한다. 이때 주의해야할 점은 ''htpasswd''는 기본적으로 ''MD5 Hash''를 이용하는데 ''sushy-tools''에서는 반드시 ''bcrypt''함수를 이용해서 암호문자열을 생성해야 한다. 따라서 ''htpasswd'' 사용시 ''-B'' 옵션을 이용해야 한다. |
| ''/etc/sushy/sushy_authfile'' | ''/etc/sushy/sushy-authfile'' |
| <WRAP prewrap> | <WRAP prewrap> |
| <code vim /etc/sushy/sushy_authfile> | <code vim /etc/sushy/sushy-authfile> |
| # 예: /etc/sushy/sushy_authfile 파일에 'admin' 사용자 추가 | # 예: /etc/sushy/sushy_authfile 파일에 'admin' 사용자 추가 |
| sudo mkdir -p /etc/sushy | sudo mkdir -p /etc/sushy |
| sudo htpasswd -c /etc/sushy/sushy_authfile admin | sudo htpasswd -B -c /etc/sushy/sushy-authfile admin |
| # New password: <비밀번호 입력> | New password: <비밀번호 입력> |
| # Re-type new password: <비밀번호 다시 입력> | Re-type new password: <비밀번호 다시 입력> |
| | </code> |
| | </WRAP> |
| | |
| | ===== 설정파일 예제 ===== |
| | |
| | ''/etc/sushy/sushy-emulator.conf'' |
| | <WRAP prewrap> |
| | <code vim /etc/sushy/sushy-emulator.conf> |
| | # sushy emulator configuration file built on top of Flask application |
| | # configuration infrastructure: http://flask.pocoo.org/docs/config/ |
| | |
| | # Listen on all local IP interfaces |
| | SUSHY_EMULATOR_LISTEN_IP = '0.0.0.0' |
| | |
| | # Bind to TCP port 8000 |
| | SUSHY_EMULATOR_LISTEN_PORT = 8000 |
| | |
| | # If authentication is desired, set this to an htpasswd file. |
| | SUSHY_EMULATOR_AUTH_FILE = '/etc/sushy/sushy-authfile' |
| | |
| | # The libvirt URI to use. This option enables libvirt driver. |
| | SUSHY_EMULATOR_LIBVIRT_URI = u'qemu:///system' |
| | </code> |
| | </WRAP> |
| | |
| | <WRAP prewrap> |
| | <code bash> |
| | curl -u "admin:admin" http://localhost:8000/redfish/v1/Systems |
| | |
| | [root@kvm33 sushy]# curl -u "admin:admin" http://localhost:8000/redfish/v1/Systems |
| | { |
| | "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection", |
| | "Name": "Computer System Collection", |
| | "Members@odata.count": 3, |
| | "Members": [ |
| | |
| | { |
| | "@odata.id": "/redfish/v1/Systems/96cc2716-4670-4b0b-ae66-5a68febc9525" |
| | }, |
| | |
| | { |
| | "@odata.id": "/redfish/v1/Systems/02a6ecfe-cf95-4138-9467-545e9f380a45" |
| | }, |
| | |
| | { |
| | "@odata.id": "/redfish/v1/Systems/92241405-6e50-4c44-af0b-864e52bd6d45" |
| | } |
| | |
| | ], |
| | "@odata.context": "/redfish/v1/$metadata#ComputerSystemCollection.ComputerSystemCollection", |
| | "@odata.id": "/redfish/v1/Systems", |
| | "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright." |
| | </code> |
| | </WRAP> |
| | |
| | ==== 서버 정보 조회 ==== |
| | <WRAP prewrap> |
| | <code bash> |
| | curl -k -u "{username}:{password}" http://localhost:8000/redfish/v1/Systems/{vm_uuid} | jq . |
| | # ex) |
| | curl -k -u "admin:admin" http://localhost:8000/redfish/v1/Systems/ee5cb7b7-84d0-4e62-9a42-5a8b9282d8fa |
| | </code> |
| | </WRAP> |
| | |
| | ==== 전원 상태 확인 ==== |
| | <WRAP prewrap> |
| | <code bash> |
| | curl -k -u "{username}:{password}" http://localhost:8000/redfish/v1/Systems/{vm_uuid} | jq '.PowerState' |
| | </code> |
| | </WRAP> |
| | |
| | ==== 전원 켜기 ==== |
| | <WRAP prewrap> |
| | <code bash> |
| | curl -k -u "{username}:{password}" \ |
| | -X POST \ |
| | -H "Content-Type: application/json" \ |
| | -d '{"ResetType": "On"}' \ |
| | http://localhost:8000/redfish/v1/Systems/{vm_uuid}/Actions/ComputerSystem.Reset |
| | |
| | # ex) |
| | curl -k -u "admin:admin" \ |
| | -X POST \ |
| | -H "Content-Type: application/json" \ |
| | -d '{"ResetType": "On"}' \ |
| | http://localhost:8000/redfish/v1/Systems/ee5cb7b7-84d0-4e62-9a42-5a8b9282d8fa/Actions/ComputerSystem.Reset |
| | </code> |
| | </WRAP> |
| | |
| | ==== 전원 끄기 ==== |
| | * 강제 종료 |
| | <WRAP prewrap> |
| | <code bash> |
| | curl -k -u "{username}:{password}" \ |
| | -X POST \ |
| | -H "Content-Type: application/json" \ |
| | -d '{"ResetType": "ForceOff"}' \ |
| | http://localhost:8000/redfish/v1/Systems/{vm_uuid}/Actions/ComputerSystem.Reset |
| | </code> |
| | </WRAP> |
| | |
| | * 정상 종료 |
| | <WRAP prewrap> |
| | <code bash> |
| | curl -k -u "{username}:{password}" \ |
| | -X POST \ |
| | -H "Content-Type: application/json" \ |
| | -d '{"ResetType": "GracefulShutdown"}' \ |
| | http://localhost:8000/redfish/v1/Systems/{vm_uuid}/Actions/ComputerSystem.Reset |
| </code> | </code> |
| </WRAP> | </WRAP> |
| ===== 참조링크 ===== | ===== 참조링크 ===== |
| * https://docs.openstack.org/sushy-tools/latest/ | * https://docs.openstack.org/sushy-tools/latest/ |
| * | |
| |