Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

6.227.3. remoteviewerconnectionfile POST

remote-viewer 클라이언트와 호환되는 파일을 생성합니다.

다음 요청을 사용하여 그래픽 콘솔의 원격 뷰어 연결 파일을 생성합니다. 이 작업은 가상 머신이 실행 중인 경우에만 파일을 생성합니다.

POST /ovirt-engine/api/vms/123/graphicsconsoles/456/remoteviewerconnectionfile

remoteviewerconnectionfile 작업은 작업 특정 매개변수를 수행하지 않으므로 요청 본문에 빈 작업이 포함되어야 합니다.

<action/>

응답에는 remote-viewer 클라이언트와 함께 사용할 수 있는 파일이 포함되어 있습니다.

<action>
  <remote_viewer_connection_file>
    [virt-viewer]
    type=spice
    host=192.168.1.101
    port=-1
    password=123456789
    delete-this-file=1
    fullscreen=0
    toggle-fullscreen=shift+f11
    release-cursor=shift+f12
    secure-attention=ctrl+alt+end
    tls-port=5900
    enable-smartcard=0
    enable-usb-autoshare=0
    usb-filter=null
    tls-ciphers=DEFAULT
    host-subject=O=local,CN=example.com
    ca=...
  </remote_viewer_connection_file>
</action>

예를 들어, 원격 뷰어 연결 파일의 콘텐츠를 가져와서 임시 파일에 저장하려면 사용자는 다음과 같이 oVirt Python SDK를 사용할 수 있습니다.

# Find the virtual machine:
vm = vms_service.list(search='name=myvm')[0]

# Locate the service that manages the virtual machine, as that is where
# the locators are defined:
vm_service = vms_service.vm_service(vm.id)

# Find the graphic console of the virtual machine:
graphics_consoles_service = vm_service.graphics_consoles_service()
graphics_console = graphics_consoles_service.list()[0]

# Generate the remote viewer connection file:
console_service = graphics_consoles_service.console_service(graphics_console.id)
remote_viewer_connection_file = console_service.remote_viewer_connection_file()

# Write the content to file "/tmp/remote_viewer_connection_file.vv"
path = "/tmp/remote_viewer_connection_file.vv"
with open(path, "w") as f:
    f.write(remote_viewer_connection_file)

원격 뷰어 연결 파일을 만들 때 다음과 같이 가상 머신 그래픽 콘솔에 연결할 수 있습니다.

#!/bin/sh -ex

remote-viewer --ovirt-ca-file=/etc/pki/ovirt-engine/ca.pem /tmp/remote_viewer_connection_file.vv

표 6.720. 매개변수 요약

이름유형direction요약

remote_viewer_connection_file

문자열

out

remote-viewer 클라이언트와 호환되는 파일이 포함되어 있습니다.

6.227.3.1. remote_viewer_connection_file

remote-viewer 클라이언트와 호환되는 파일이 포함되어 있습니다.

사용자는 이 속성의 내용을 사용하여 원격viewer 클라이언트로 전달하여 가상 머신 graphical 콘솔에 연결할 수 있는 파일을 만들 수 있습니다.