1.4. Running the CLI

Start the CLI application with the following command:
# rhevm-shell
This rhevm-shell application is an interactive shell for Red Hat Enterprise Virtualization environments.
The URL, user name, certificate authority file, and password for connecting to the Red Hat Enterprise Virtualization Manager can be configured in the .rhevmshellrc file. The rhevm-shell command uses the parameters in this file to connect to the Manager, so that the user does not need to specify options each time.
Alternatively, users can connect automatically to Red Hat Enterprise Virtualization Manager using the following additional options.
# rhevm-shell -c -l "https://[server]/api" -P [port] -u "[user@domain]" -A "[certificate]"
Ensure to replace the following values:
  • server - The hostname or IP Address of the Red Hat Enterprise Virtualization Manager. The CLI connects to the Red Hat Enterprise Virtualization Manager via the REST API.
  • user@domain - The user name and directory service domain for the user logging into Red Hat Enterprise Virtualization Manager.
  • certificate - The path name of the Certificate Authority file.
The shell will prompt you for the password, and, if not already provided, the username and the URL for the Red Hat Enterprise Virtualization Manager.

Note

You do not need to specify additional options if you have configured your user name, password, URL, and certificate authority file in the .rhevmshellrc file.

Note

The certificate is the only obligatory option as the others used in this example will be prompted by the shell. Instead of specifying the certificate you can use the '--insecure' option to connect without certification, however this is not recommended as it may allow man-in-the-middle (MITM) attackers to spoof the identity of the server.

Options for rhevm-shell

-h, --help
Show help for rhevm-shell.
-d, --debug
Enables debugging.
-l URL, --url=URL
Specifies the API entry point URL.
-u USERNAME, --username=USERNAME
Connect as this user.
-K KEY_FILE, --key-file=KEY_FILE
Specify key file.
-C CERT_FILE, --cert-file=CERT_FILE
Specify certificate file.
-A CA_FILE, --ca-file=CA_FILE
Specify server Certificate Authority file.
-I, --insecure
Allow the CLI to connect via SSL without certification. Use this option with caution because it can allow man-in-the-middle (MITM) attackers to spoof the identity of the server.
-F, --filter
Enable filtering based upon user permissions.
-P PORT, --port=PORT
Specify port.
-T TIMEOUT, --timeout=TIMEOUT
Specify timeout.
-c, --connect
Automatically connect.
-e, --extended-prompt
Enables the extended prompt option for the shell. This option displays the hostname of the environment in the command prompt. Default is 'false'.
-E "command resource", --execute-command="command resource"
Connects to the Manager to execute only the given commands, in the form of "command resource;command resource" and prints the output to STDIO.
-f FILE, --file=FILE
Read commands from FILE instead of stdin.
--kerberos
Use a valid Kerberos ticket to authenticate connection to the shell.

Note

Users with a non-interactive shell are able to connect to the Red Hat Enterprise Virtualization Manager from within the shell, where the --password option can be used.