订阅我们的博客

by Rob Locke (Red Hat)

One of the new features introduced in version 3.1 of Red Hat Enterprise Virtualization is a command line interface (CLI) to connect to the manager. The CLI also contains a scripting system, which helps system administrators perform periodic maintenance or repetitive tasks on their virtualization environment.

Communication with the RHEV Manager is secured through the use of a certificate that needs to be downloaded from the manager:

$ wget http://rhevm.pod0.example.com/ca.crt

Connect to the RHEV Manager using the rhevm-shell command (referring to the downloaded certificate):

$ rhevm-shell -l https://rhevm.pod0.example.com/api \
-u rhevadmin@example.com -A ca.crt -c
Password: redhat
... output omitted ...
[RHEVM shell (connected)]#

There are numerous subcommands that can be specified at the rhevm-shell prompt. Use help for a list of subcommands, then help subcommand to see what can be done:

[RHEVM shell (connected)]# help
... output omitted ...
[RHEVM shell (connected)]# help action
... output omitted ...

Those rhevm-shell subcommands can be entered interactively from the prompt above or embedded in a text file for automation from a standard shell prompt:

$ cat /tmp/rhel0.shutdown
action vm rhel0 shutdown
exit
$ rhevm-shell -l https://rhevm.pod0.example.com/api \
-u rhevadmin@example.com -A ca.crt -f /tmp/rhel0.shutdown -c
Password: redhat

Learn more about rhevm-shell and other methods of automation in our updated Red Hat Enterprise Virtualization (RH318) course.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.


关于作者

按频道浏览

automation icon

自动化

涵盖技术、团队和环境的最新自动化平台

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

cloud services icon

云服务

有关我们的托管云服务组合的更多信息

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Original series icon

原创节目

关于企业技术领域的创客和领导者们有趣的故事