문서의 이전 판입니다!
RHV / oVirt Shell CLI
접속방법
[root@rhevm ~]# rhevm-shell -l "https://192.168.0.180:443/ovirt-engine/api" -u "admin@internal" -K "/etc/pki/ovirt-engine/private/ca.pem" -C "/etc/pki/ovirt-engine/certs/engine.cer" -A "/etc/pki/ovirt-engine/ca.pem" -I -D -c
Password:
====================================================================================================================================
>>> connected to RHEVM manager 3.6.12.0 <<<
====================================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Welcome to RHEVM shell
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[RHEVM shell (connected)]#
또는
[root@rhevm ~]# rhevm-shell
URL: [ENTER]
Username: [ENTER]
Password: [ENTER]
================================================================ ERROR =============================================================
missing configuration variable: url.
====================================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Welcome to RHEVM shell
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[RHEVM shell (disconnected)]#
[RHEVM shell (disconnected)]# connect --key-file /etc/pki/ovirt-engine/private/ca.pem --cert-file /etc/pki/ovirt-engine/certs/engine.cer --ca-file /etc/pki/ovirt-engine/ca.pem --url "https://rhevm.local.domain:443/ovirt-engine/api" --user "admin@internal" --password 'redhat'
====================================================================================================================================
>>> connected to RHEVM manager 3.6.12.0 <<<
====================================================================================================================================
[RHEVM shell (connected)]#
명령어
사용할 수 있는 명령어는 아래와 같다.
- action execute an action on an object
- add creates a new object or adds existent
- capabilities displaying system capabilities
- clear clear the screen
- connect connect to a RHEV manager
- console open a console to a VM
- disconnect disconnect from RHEV manager
- exit quit this interactive terminal
- help show help
- history displaying commands history
- info shows environment and application components info
- list list or search objects
- ping test the connection
- remove removes an object
- show show one object
- status shows last command status
- summary displaying the system status
- update update an object
아래 명령어로 상세 사용법을 확인할 수 있다.
[RHEVM shell (connected)]# help 명령어
또한 모든 명령어는 auto complete기능이 지원되므로 TAB키를 누르면 사용할 수 있는 명령어나 파라메터를 확인 할 수 있다.
예제
VM List
[RHEVM shell (connected)]# list vms id : fa75ece3-088c-4f18-9e5b-2799ab3a05f5 name : test
VM status
[RHEVM shell (connected)]# show vm test id : fa75ece3-088c-4f18-9e5b-2799ab3a05f5 name : test bios-boot_menu-enabled : False cluster-id : 84e4c9df-4f36-4216-a8f5-2740a2b33a02 cpu-architecture : X86_64 cpu-topology-cores : 1 cpu-topology-sockets : 1 cpu-topology-threads : 1 cpu_profile-id : 60d2ce90-c1b6-4718-8466-d8d9d8a13b3f cpu_shares : 0 creation_time : 2020-05-06 14:58:04.080000+09:00 delete_protected : False display-allow_override : True display-copy_paste_enabled : True display-disconnect_action : LOCK_SCREEN display-file_transfer_enabled : True display-monitors : 1 display-single_qxl_pci : False display-smartcard_enabled : False display-type : spice high_availability-enabled : False high_availability-priority : 1 initialization-custom_script : initialization-regenerate_ssh_keys: False io-threads : 0 large_icon-id : 3dda812c-3a6a-4f46-8c81-c89dbf286f03 memory : 1073741824 memory_policy-guaranteed : 1073741824 migration-auto_converge : inherit migration-compressed : inherit migration_downtime : -1 next_run_configuration_exists : False numa_tune_mode : interleave origin : ovirt os-boot-dev : hd os-type : other placement_policy-affinity : migratable small_icon-id : 7ff20b9d-f985-4c4f-a31f-d2891a1fa43f sso-methods-method-id : GUEST_AGENT start_paused : False stateless : False status-state : down stop_reason : stop_time : 2020-05-07 03:31:37.776000+09:00 template-id : 00000000-0000-0000-0000-000000000000 time_zone-name : Etc/GMT timezone : Etc/GMT type : server usb-enabled : False
Live Migration
[RHEVM shell (connected)]# action vm test migrate --host-name hyp2 host-name : hyp2 job-id : 5261cd99-93e9-4d29-9ac4-b6f9ba06c50a status-state: complete vm-id : fa75ece3-088c-4f18-9e5b-2799ab3a05f5
VM 정지
[RHEVM shell (connected)]# action vm test stop job-id : b64449eb-d2a9-4288-93bd-bb9462d6e9b4 status-state: complete vm-id : fa75ece3-088c-4f18-9e5b-2799ab3a05f5
VM 시작
[RHEVM shell (connected)]# action vm test start job-id : b64449eb-d2a9-4288-93bd-bb9462d6e9b4 status-state: complete vm-id : fa75ece3-088c-4f18-9e5b-2799ab3a05f5