import ovirtsdk4 as sdk
import paramiko
import subprocess
# create connection
connection = sdk.Connection(
url='https://xxx/ovirt-engine/api',
username='xxx',
password='xxx',
ca_file= 'cacert.pem',
)
This above is using the api format
# Get all hosts
hosts_service = connection.system_service().hosts_service()
hosts = hosts_service. list()
#By obtaining the fqdn of the host to perform ssh
In the engine web, you can restart the host and stop some operations. I thought that the
engine and node host may have been encrypted, so I found the engine_id_rsa key in
/etc/pki/ovirt-engine/
/etc/pki/ovirt-engine/keys/engine_id_rsa Use this secret-free key to ssh to the obtained
host