Red Hat Virtualization 4.1 RHEVM Shell Guide
Red Hat Virtualization 4.1 RHEVM Shell Guide
4.1
RHEVM Shell Guide
Installing and Using the Command Line Shell for Red Hat Virtualization
Installing and Using the Command Line Shell for Red Hat Virtualization
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0
Unported License. If you distribute this document, or a modified version of it, you must provide
attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat
trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert,
Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity
logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other
countries.
Linux ® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and
other countries.
Node.js ® is an official trademark of Joyent. Red Hat Software Collections is not formally related to
or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks
or trademarks/service marks of the OpenStack Foundation, in the United States and other countries
and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or
sponsored by the OpenStack Foundation, or the OpenStack community.
Abstract
This guide contains information for installing and using the Red Hat Virtualization Manager
Command Line Shell.
Table of Contents
Table of Contents
.Chapter
. . . . . . .1.. .Using
. . . . . the
. . . .CLI
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . .
1.1. Installing the CLI 2
1.2. TLS/SSL Certification 2
1.3. .ovirtshellrc Configuration 4
1.4. Running the CLI 5
1.5. Interacting with the CLI 7
1.6. Collections 9
.Chapter
. . . . . . .2.. .Quick
. . . . . Start
. . . . .Example
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
...........
2.1. Creating a Basic Virtualization Environment with the CLI 10
.Chapter
. . . . . . .3.. .Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
...........
3.1. Connecting to RHEVM 15
3.2. Resources 16
3.3. Other Commands 21
.Chapter
. . . . . . .4.. .Resource
. . . . . . . . .Types
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
...........
4.1. brick 27
4.2. cdrom 27
4.3. cluster 28
4.4. datacenter 30
4.5. disk 31
4.6. glustervolume 32
4.7. group 34
4.8. host 34
4.9. network 37
4.10. nic 38
4.11. permission 40
4.12. permit 41
4.13. quotas 42
4.14. role 42
4.15. snapshot 43
4.16. statistic 43
4.17. storageconnection 44
4.18. storagedomain 45
4.19. tag 48
4.20. template 48
4.21. user 54
4.22. vm 54
4.23. vmpool 60
4.24. vnicprofile 61
. . . . . . . .5.. .CLI
Chapter . . . Queries
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
...........
5.1. Query Syntax 63
5.2. Wildcards 63
1
RHEVM Shell Guide
Important
Version 4 of the Red Hat Virtualization Manager includes a build of version 3.6 of the CLI for Red Hat
Enterprise Linux 7. This version of the CLI uses version 3.6 of the Python SDK, and the version 3
compatibility mode of the REST API.
2. Register your system with the Content Delivery Network, entering your Customer Portal user name
and password when prompted:
# subscription-manager register
3. Find the Red Hat Virtualization subscription pool and note down the pool ID.
4. Use the pool identifiers located in the previous step to attach the Red Hat Virtualization
entitlement to the system:
The Red Hat Virtualization Manager API requires Hypertext Transfer Protocol Secure (HTTPS) [1] for secure
interaction with client software, such as the Manager's SDK and CLI components. This involves a process of
obtaining a certificate from the Red Hat Virtualization Manager and importing it into the certificate store of
your client.
2
Chapter 1. Using the CLI
Important
Obtain your certificate from the Red Hat Virtualization Manager using a secure network connection.
You can obtain a certificate from the Red Hat Virtualization Manager and transfer it to the client machine
using one of three methods:
1. Method 1 - Use a command line tool to download the certificate from the Manager. Examples of
command line tools include cURL and Wget, both of which are available on multiple platforms.
a. If using cURL:
b. If using Wget:
http://[manager-fqdn]/ovirt-engine/services/pki-resource?resource=ca-
certificate&format=X509-PEM-CA
Depending on the chosen browser, the certificate either downloads or imports into the browser's
keystore.
If the browser imports the certificate: export it from the browser's certification options and
save it as rhvm.cer.
3. Method 3 - Log in to the Manager, export the certificate from the truststore and copy it to your client
machine.
b. Export the certificate from the truststore using the Java keytool management utility:
c. Copy the certificate to the client machine using the scp command:
3
RHEVM Shell Guide
Each of these methods results in a certificate file named rhvm.cer on your client machine. An API user
imports this file into the certificate store of the client.
Importing a certificate to a client relies on how the client itself stores and interprets certificates. This guide
contains some examples on importing certificates. For clients not using Network Security Services (NSS)
or Java KeyStore (JKS), see your client documentation for more information on importing a certificate.
The configuration information of the .ovirtshellrc file falls under two section headings, [cli] and
[ovirt-shell]. These headings are necessary for the configuration file to be parsed.
# ovirt-shell
This ovirt-shell application is an interactive shell for Red Hat Virtualization environments.
The URL, user name, certificate authority file, and password for connecting to the Red Hat Virtualization
Manager can be configured in the .ovirtshellrc file. The ovirt-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 Virtualization Manager using the following
additional options.
server - The hostname or IP Address of the Red Hat Virtualization Manager. The CLI connects to the Red
Hat Virtualization Manager via the REST API.
user@domain - The user name and directory service domain for the user logging into Red Hat
Virtualization Manager.
The shell will prompt you for the password, and, if not already provided, the username and the URL for the
Red Hat 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 .ovirtshellrc 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.
-h, --help
-d, --debug
Enables debugging.
5
RHEVM Shell Guide
-l URL, --url=URL
-u USERNAME, --username=USERNAME
-K KEY_FILE, --key-file=KEY_FILE
-C CERT_FILE, --cert-file=CERT_FILE
-A CA_FILE, --ca-file=CA_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
-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'.
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
--kerberos
6
Chapter 1. Using the CLI
Note
Users with a non-interactive shell are able to connect to the Red Hat Virtualization Manager from
within the shell, where the --password option can be used.
The CLI is an interactive shell for controlling your Red Hat Virtualization environment from the command line.
Type the required command and any additional parameters.
To support the construction of command and parameter combinations, the CLI includes the functionality to list
and automatically complete commands and parameters by pressing the TAB key twice, similar to the bash
shell.
Choose a command and press double TAB to view the next set of available parameters for the command.
For the add command, this lists all resources.
7
RHEVM Shell Guide
Note that the double TAB also automatically formats na to the --name parameter, including the prefix.
If the incomplete parameter matches multiple parameters, double TAB lists them.
The CLI provides functions to run Linux commands using either the shell command or the bang (!)
character.
Similar to the Linux shell, the CLI can pipe data to other commands and sources.
[RHEVM shell (connected)]# list vms --show-all > list vms --show-all >
VM_List.txt
The CLI also contains an online help system to provide descriptions and syntax for each command via the
help command.
8
Chapter 1. Using the CLI
You can also connect to the Manager from the Linux shell to execute specific commands, in the form of
"command resource" and print them to STDIO
Use the --execute or -E parameter to connect to the Manager to execute the specific commands.
id : 9e6977f4-4351-4feb-bba0-dc7c22adec30
name : desktop-01
id : 60b12e28-7965-4296-86bf-c991aa32c2d5
name : server-01
id : 3598cdb9-d21b-49bd-9491-59faff89b113
name : Gluster
id : a0c384f9-0940-4562-9c42-4ceaadf8f1f1
name : Host-01
id : 593ec966-c3ea-4bdc-84ad-5dc3f9fe64c7
name : Host-03
1.6. Collections
Some command parameters require a collection. A collection is a set of sub-parameter data. Collections are
defined using the following syntax.
Sub-parameters for collections are listed after resource parameter listings on each resource page.
9
RHEVM Shell Guide
This chapter provides an example to demonstrate the CLI's ability to add a virtual machine within a basic Red
Hat Virtualization environment. This example uses the following prerequisites:
A networked and configured Red Hat Enterprise Linux host for use as a hypervisor;
An installation of the CLI on either the Red Hat Virtualization Manager or a client machine; and,
An ISO file containing a desired virtual machine operating system to install. This chapter uses Red Hat
Enterprise Linux Server 6 for our installation ISO example.
Note
Red Hat Virtualization Manager generates a globally unique identifier (GUID) for each resource.
Identifier codes in this example might appear different to the identifier codes in your Red Hat
Virtualization environment.
1. Load the CLI shell and connect to your Red Hat Virtualization Manager.
2. List all data centers in the environment. This example uses the Default data center.
id : 5e3b55d8-c585-11e1-a7df-001a4a400e0d
name : Default
description: The default Data Center
3. List all host clusters and note down the relevant cluster ID or cluster name, which will be required
when adding the host and for creating a virtual machine. This example uses the Default cluster to
group resources in your Red Hat Virtualization environment.
id : 99408929-82cf-4dc7-a532-9d998063fa95
name : Default
description: The default server cluster
10
Chapter 2. Quick Start Example
4. List all CPU profiles and note down the relevant CPU profile ID, which will be required when creating
a virtual machine. This example uses the Default CPU profile.
id : 0000001a-001a-001a-001a-00000000035e
name : Default
5. List all logical networks with the show-all option to view the details of the logical networks in the
environment. Red Hat Virtualization Manager creates a default logical network called ovirtmgmt for
management traffic. This example uses the ovirtmgmt logical network on the Default data center.
id : 00000000-0000-0000-0000-000000000009
name : ovirtmgmt
description : Management Network
data_center-id: 5e3b55d8-c585-11e1-a7df-001a4a400e0d
mtu : 0
required : True
status-state : operational
stp : False
usages-usage : VM
Note the data_center-id value matches the id for the Default data center.
6. Add the Red Hat Enterprise Linux host to the virtualization environment as a new hypervisor. The
host is activated automatically.
7. Add an NFS share as a data storage domain by creating, attaching, and activating the NFS share.
An NFS data storage domain is an exported NFS share attached to a data center. It provides storage
for virtual machines. Ensure to substitute storage-address and storage-path with the correct
values for the NFS server.
b. Verify that the created storage domain is available. The creation process might take several
minutes. Once the status-state is unattached, you can proceed to the next step.
11
RHEVM Shell Guide
c. Attach the data storage domain to the data center. The storage domain is activated
automatically.
Note
If the storage domain is not activated, activate it manually using the following
command:
8. Add an NFS share as the ISO storage domain by creating, attaching, and activating the NFS share.
An NFS ISO storage domain is an exported NFS share attached to a data center. It provides storage
for DVD/CD-ROM ISO and virtual floppy disk (VFD) image files. Ensure to substitute storage-
address and storage-path with the correct values for the NFS server.
b. Verify that the created storage domain is available. The creation process might take a while.
Once the status-state is unattached, you can proceed to the next step.
c. Attach the ISO storage domain to the data center. The storage domain is activated
automatically.
10. Use the add nic command to add a new network interface. Add the vm-identifier option to
attach the interface as a sub-resource of MyVM and a network-name option to connect to the
ovirtmgmt network.
12
Chapter 2. Quick Start Example
11. Use the add disk command to add a new virtual hard disk. Add the vm-identifier option to
attach the disk as a sub-resource of MyVM.
12. On the Manager, upload ISO images to the ISOStorage domain for the virtual machines to use. Red
Hat Virtualization Manager provides an ISO uploader tool that ensures images are uploaded into the
correct directory path with the correct user permissions.
13. In the CLI shell, use the list files command to list the available ISO files in the storage domain.
14. Add a virtual CD-ROM drive for your installation media. Add the vm-identifier option to attach
the CD-ROM as a sub-resource of MyVM.
15. Start the virtual machine. The virtual environment is complete and the virtual machine contains all
necessary components to function.
Note the use of the vm-os-boot option. This changes the boot device to cdrom for this initial boot
session. After installation, the virtual machine restarts and restores the boot device back to hd.
16. Use the list events with an additional query option to display specific event types. The start
action for the virtual machine adds several entries in the events collection.
id : 105
description: MyVM was started by admin (Host: MyHost).
The "type=153" query refers to events where a user starts a virtual machine.
17. Use the show event command to display comprehensive details of an event. This command can be
used to show events by type, name, and id.
13
RHEVM Shell Guide
id : 60
description : New Tag foo was created by admin@internal.
code : 432
correlation_id: 3e4d4350
custom_id : -1
flood_rate : 30
origin : oVirt
severity : normal
time : 2013-07-03 10:57:43.257000+03:00
user-id : fdfc627c-d875-11e0-90f0-83df133b58cc
Important
Ensure your client machine has a console application installed to match the virtual machine's
display-type. Protocols available include SPICE (default) and VNC.
14
Chapter 3. Commands
Chapter 3. Commands
The connect command connects to Red Hat Virtualization Manager. The URL, user name, certificate
authority file, and password for connecting to the Red Hat Virtualization Manager can be configured in the
.ovirtshellrc file. The connect command uses the parameters in this file to connect to the Manager, so
that the user does not need to specify options each time.
Syntax
connect [options]
Note
You do not need to specify additional options if you have configured your user name, password, URL,
and certificate authority file in the .ovirtshellrc file.
15
RHEVM Shell Guide
==========================================
>>> connected to RHEVM manager 4.0.0.0 <<<
==========================================
Note
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.
Syntax
disconnect
=======================================
>>> disconnected from RHEVM manager <<<
=======================================
3.2. Resources
Use the list command to display all resources of a specific type. Lists also include optional search queries
to filter results.
Syntax
Option Description
16
Chapter 3. Commands
Option Description
--show-all Displays all non-empty properties for each listed resource. Without this
option, only the id, name and description properties display.
--query [QUERY] Filters the list using a server-side query based upon Red Hat
Virtualization Manager query language.
--kwargs [QUERY] Filters the list using a client-side query.
--case_sensitive Match search queries using case sensitivity.
true|false
--max Maximum number of results for display.
Note
Options specific to resource types are listed in the definition pages for each resource type.
List users that match the specified user name across all domains with the use of a wildcard:
Syntax
17
RHEVM Shell Guide
Note
Options specific to resource types are listed in the definition pages for each resource type.
Syntax
Note
Options specific to resource types are listed in the definition pages for each resource type.
Create a user:
The add command can be made synchronous (if supported) by using the expect option:
Syntax
18
Chapter 3. Commands
Note
Options specific to resource types are listed in the definition pages for each resource type.
Syntax
Option Description
--async Perform an asynchronous removal of the resource.
--force Perform a force remove of the resource. This removes all database
entries and associations for a particular resource. This action applies
only to datacenter and vm resources.
Note
Options specific to resource types are listed in the definition pages for each resource type.
19
RHEVM Shell Guide
Use the action command to perform a special function relevant to resource type.
Syntax
Note
Options specific to resource actions are listed in the definition pages for each resource type.
The action command can be made synchronous (if supported) by using the async option:
Certain resources act as sub-resources of other resources. This means there is a dependent relationship
between the sub-resource and its parent resource. Use the --RESOURCE-identifier [name] option,
where RESOURCE is the parent resource type, to target a sub-resource part of a parent resource.
Note the use of the --vm-identifier RHEL6-Server option. This adds a NIC on the RHEL6-Server
virtual machine.
20
Chapter 3. Commands
Note the use of the --vm-identifier RHEL6-Server option. This adds a storage disk on the RHEL6-
Server virtual machine.
Use the EOF command to leave the CLI shell using a Ctrl+D sequence.
Syntax
EOF
Use the capabilties --features command to list all version capabilities and new features of the current
version.
Syntax
capabilities --features
Syntax
21
RHEVM Shell Guide
clear
Use the console command to open a graphical console to a virtual machine. This command opens either an
external VNC or SPICE client based upon the virtual machine's display-type parameter.
Syntax
console [vm-id|vm-name]
Use the echo command to print input to the screen. Use the $out variable to print the last shell command
output.
Syntax
echo [input]
Print input:
Syntax
22
Chapter 3. Commands
exit
Use the file command to run a CLI script file. A script is a plain text file that contains a list of commands for
execution.
Syntax
file [file-location]
Use the help command displays help for CLI command and resource combinations.
Syntax
23
RHEVM Shell Guide
Use the history command to display the history of user commands for the CLI shell.
Syntax
history
Display the first specified entries in the user command history with the --first n parameter:
Display the last specified entries in the user command history with the --last n parameter:
Use the info command to display environment connection details and version information.
Syntax
info
24
Chapter 3. Commands
Use the ping command tests the connection to your Red Hat Virtualization Manager. The command retrieves
a remote resource and ensures the URL, user name and password for the connection are correct.
Syntax
ping
Use the shell command to run a command from the Linux shell. This command helps with performing file
management tasks in conjunction with the Red Hat Virtualization Manager shell.
Syntax
shell [vm-id|vm-name]
Create a file:
Copy a file:
Note
The CLI offers an alternative to the shell using the bang (!) character. For example:
25
RHEVM Shell Guide
Use the status command to display the most recently run command status.
Syntax
status
Syntax
summary
hosts-active : 1
hosts-total : 2
storage_domains-active: 2
storage_domains-total : 3
users-active : 1
users-total : 1
vms-active : 1
vms-total : 1
26
Chapter 4. Resource Types
4.1. brick
The brick resource type groups all Gluster bricks in a Red Hat Virtualization environment.
The following table lists additional glustervolume options for resource-based commands.
Option Description
--cluster-identifier Reference to the cluster that contains a glustervolume sub-
resource.
--glustervolume- Adds the brick to a glustervolume as a sub-resource.
identifier
4.2. cdrom
The cdrom resource type groups all virtual CD-ROM drive resources in a Red Hat Virtualization
environment.
27
RHEVM Shell Guide
4.3. cluster
The cluster resource type groups all host cluster resources in a Red Hat Virtualization environment.
28
Chapter 4. Resource Types
29
RHEVM Shell Guide
4.4. datacenter
The datacenter resource type groups all data center resources in a Red Hat Virtualization environment.
30
Chapter 4. Resource Types
4.5. disk
The disk resource type groups all virtual hard disk resources in a Red Hat Virtualization environment.
31
RHEVM Shell Guide
The following table lists additional disk options for resource-based commands.
Option Description
--vm-identifier Adds the disk to a vm as a sub-resource.
--alias Identifies a disk name when using a show command. Use --alias
instead of the --name parameter for disk-specific queries.
Action Description
activate Activate a disk on a virtual machine.
deactivate Deactivate a disk on a virtual machine.
4.6. glustervolume
The glustervolume resource type groups all Gluster storage volume resources in a Red Hat Virtualization
environment.
32
Chapter 4. Resource Types
The --bricks-brick parameter is a collection that uses the sub-parameters in the following table.
The --transport_types parameter is a collection that uses the sub-parameters in the following table.
The --options-option parameter is a collection that uses the sub-parameters in the following table.
The following table lists additional glustervolume options for resource-based commands.
33
RHEVM Shell Guide
Option Description
--cluster-identifier Adds the Gluster volume to a cluster as a sub-resource.
Action Description
start Makes a Gluster volume available for use.
stop Deactivates a Gluster volume.
setOption Sets a Gluster volume option.
resetOption Resets a Gluster volume option to the default.
resetAllOptions Resets all Gluster volume options to defaults.
4.7. group
The group resource type defines all identity service groups for a Red Hat Virtualization environment.
4.8. host
The host resource type groups all host resources in a Red Hat Virtualization environment.
34
Chapter 4. Resource Types
35
RHEVM Shell Guide
Action Description
activate Activate a host.
approve Approve a host.
commitnetconfig Save the network configuration.
deactivate Deactivate a host.
fence Fence a host.
forceselectspm Select the host to be the Storage Pool Manager.
install Install VDSM on a host.
iscsidiscover Perform an iSCSI discover command.
iscsilogin Perform an iSCSI login command.
The following table lists additional options for the fence action.
Option Description
manual Manually fence the host. Use this action to confirm to the Manager that
the host became non-responsive and was manually rebooted.
restart Restart the host, implemented as stop, wait, status, start, wait, status.
start Power on the host.
stop Power off the host.
status Check the operational status of the host.
36
Chapter 4. Resource Types
4.9. network
The network resource type groups all logical network resources in a Red Hat Virtualization environment.
The --usages-usage parameter is a collection that uses the sub-parameters in the following table.
The following table lists additional network options for resource-based commands.
Option Description
--cluster-identifier Adds the network to a cluster as a sub-resource.
37
RHEVM Shell Guide
4.10. nic
The nic resource type groups network interface resources in a Red Hat Virtualization environment. These
resources acts as sub-resources for both host and vm resources but are defined differently for each. This
section contains two tables with parameters for each.
38
Chapter 4. Resource Types
The --bonding-slaves-host_nic parameter is a collection that uses the sub-parameters in the following
table.
The --bonding-options-option parameter is a collection that uses the sub-parameters in the following
table.
The following table lists additional NIC options for resource-based commands.
Option Description
--host-identifier Adds the NIC to a host as a sub-resource.
--vm-identifier Adds the NIC to a vm as a sub-resource.
39
RHEVM Shell Guide
Action Description
attach Attach a NIC to a host.
detach Detach a NIC from a host.
The following table lists actions for a virtual machine NIC resource.
Action Description
activate Activate a NIC on a virtual machine.
deactivate Deactivate a NIC on a virtual machine.
4.11. permission
The permission resource type groups all permission resources in a Red Hat Virtualization environment.
40
Chapter 4. Resource Types
The following table lists additional permission options for resource-based commands.
Option Description
--cluster-identifier Adds the permission to a cluster.
--correlation-id A tagging identifier for cross-system logging.
--cpuprofile-identifier Adds the permission to a CPU profile.
--datacenter-identifier Adds the permission to a data center.
--disk-identifier Adds the permission to a disk.
--diskprofile-identifier Adds the permission to a disk profile.
--host-identifier Adds the permission to a host.
--iscsibond-identifier Adds the permission to an iSCSI bond.
--network-identifier Adds the permission to a network.
--storagedomain- Adds the permission to a storage domain.
identifier
--template-identifier Adds the permission to a template.
--vm-identifier Adds the permission to a virtual machine.
--vmpool-identifier Adds the permission to a virtual machine pool.
--vnicprofile-identifier Adds the permission to a VNIC profile.
4.12. permit
The permit resource type groups all individual permits for roles in a Red Hat Virtualization environment.
41
RHEVM Shell Guide
The following table lists additional permit options for resource-based commands.
Option Description
--role-identifier Adds the permit to a role.
4.13. quotas
The quota resource type groups all datacenter quotas in a Red Hat Virtualization environment.
4.14. role
The role resource type groups all individual roles in a Red Hat Virtualization environment.
The --permits-permit parameter is a collection that uses the sub-parameters in the following table.
42
Chapter 4. Resource Types
4.15. snapshot
The snapshot resource type groups all virtual machine snapshot resources in a Red Hat Virtualization
environment.
The following table lists additional snapshot options for resource-based commands.
Option Description
--vm-identifier Adds the disk to a vm as a sub-resource.
The following table lists actions for a virtual machine snapshot resource.
Action Description
restore Restore a snapshot.
4.16. statistic
The statistic resource type groups statistics for resources in a Red Hat Virtualization environment.
Resource statistics are listed based on their resource identifier.
43
RHEVM Shell Guide
Option Description
--brick-identifier The resource identifier to view statistics for the specified brick.
--cluster-identifier The resource identifier to view statistics for the specified cluster.
--datacenter-identifier The resource identifier to view statistics for the specified data center.
--disk-identifier The resource identifier to view statistics for the specified virtual disk.
--glustervolume- The resource identifier to view statistics for the specified gluster
identifier volume.
--host-identifier The resource identifier to view statistics for the specified host.
--job-identifier The resource identifier to view statistics for the specified job.
--nic-identifier The resource identifier to view statistics for the specified NIC.
--numanode-identifier The resource identifier to view statistics for the specified NUMA node.
--step-identifier The resource identifier to view statistics for the specified step.
--storagedomain- The resource identifier to view statistics for the specified storage
identifier domain.
--vm-identifier The resource identifier to view statistics for the specified virtual
machine.
View the collection of statistics for each resource by using the list command and the relevant resource
identifier. The following example provides a list of the available statistics for the specified host:
The name or id of the provided statistics can be used with the show command and the resource identifier to
view further information on the specified statistic. The following example shows the details of the specified
statistic for the host:
4.17. storageconnection
The storageconnection resource type allows you to add, edit, and delete storage connections.
44
Chapter 4. Resource Types
4.18. storagedomain
45
RHEVM Shell Guide
The storagedomain resource type groups all storage domain resources in a Red Hat Virtualization
environment.
The --storage-logical_unit parameter is a collection that requires all sub-parameters in the following
table.
46
Chapter 4. Resource Types
Type Parameters
nfs --storage-address, --storage-path
iscsi or fcp --storage-address, --storage-logical_unit, --storage-
override_luns
glusterfs --storage-address, --storage-path, --storage-vfs_type
local --storage-path
posixfs --storage-path, --storage-vfs_type, --storage-address, --
storage-mount_options
The following table lists additional storagedomain options for resource-based commands.
Option Description
--datacenter-identifier Adds the storage domain to a datacenter as a sub-resource.
47
RHEVM Shell Guide
Action Description
activate Activate a storage domain on a data center.
deactivate Deactivate a storage domain on a data center.
4.19. tag
The tag resource type groups all tags in a Red Hat Virtualization environment.
[RHEVM shell (connected)]# add tag --name MyTag --description "A virtual
machine tag" --parent MyParentTag
4.20. template
The template resource type groups all virtual machine templates in a Red Hat Virtualization environment.
Only --vm-id|name and --name are required parameters. If the optional parameters are not specified, the
template will inherit the settings from the virtual machine used to make the template.
48
Chapter 4. Resource Types
49
RHEVM Shell Guide
50
Chapter 4. Resource Types
Important
-- boolea Set to true to enable data transport over a libvirt No Yes Yes
tunnel_migra n daemon. A tunneled transport uses a stronger
tion encryption algorithm but increases the data load
during transport.
-- int Defines the maximum number of milliseconds that No Yes Yes
migration_do the virtual machine can be down during live
wntime migration.
-- boolea Set to true to allow attaching a VirtIO console No Yes Yes
virtio_scsi- n device to the virtual machine.
enabled
-- boolea Set to true to enable sound cards. No Yes Yes
soundcard_en n
abled:
--vm-disks- collecti References to disks attached to the template. No Yes No
disk on
--id string The ID of the virtual machine template. No Yes Yes
-- boolea Set to true to copy the permissions of the source No Yes Yes
permissions- n virtual machine to the template.
clone
51
RHEVM Shell Guide
The --sso-methods-method parameter is a collection that uses the sub-parameters in the following table.
52
Chapter 4. Resource Types
The --os-boot parameter is a collection that uses the sub-parameters in the following table.
The --vm-disks-disk parameter is a collection that uses the sub-parameters in the following table.
The --cpu-cpu_tune-vcpu_pin parameter is a collection that uses the sub-parameters in the following
table.
The following table lists actions for a virtual machine template resource.
Action Description
export Export a template to an export storage domain.
53
RHEVM Shell Guide
Action Description
4.21. user
The user resource type groups all users in a Red Hat Virtualization environment.
4.22. vm
The vm resource type groups all virtual machine resources in a Red Hat Virtualization environment.
54
Chapter 4. Resource Types
55
RHEVM Shell Guide
56
Chapter 4. Resource Types
57
RHEVM Shell Guide
58
Chapter 4. Resource Types
The --os-boot parameter is a collection that uses the sub-parameters in the following table.
The --sso-methods-method parameter is a collection that uses the sub-parameters in the following table.
The --disks-disk parameter is a collection that uses the sub-parameters in the following table.
The --payloads-payload parameter is a collection that uses the sub-parameters in the following table.
The --cpu-cpu_tune-vcpu_pin parameter is a collection that uses the sub-parameters in the following
table.
59
RHEVM Shell Guide
Action Description
start Launch a virtual machine.
stop Stop a virtual machine.
shutdown Shut down a virtual machine.
suspend Suspend a virtual machine.
detach Detach a virtual machine from a pool.
migrate Migrate a virtual machine to another host.
cancelmigration Stop migration in progress.
export Export a virtual machine to an export storage domain.
move Move virtual disks to another storage domain.
ticket Create a ticket for console access.
logon Enable user logon for console access using third-party applications.
4.23. vmpool
The vmpool resource type groups all virtual machine pool resources in a Red Hat Virtualization
environment.
60
Chapter 4. Resource Types
4.24. vnicprofile
The vnicprofile resource type groups all VNIC (virtual network interface controller) profiles, also referred
to as VM (virtual machine) interface profiles, in a Red Hat Virtualization environment.
61
RHEVM Shell Guide
62
Chapter 5. CLI Queries
The CLI list command uses the --query attribute to perform server-side queries, which uses the same
format as Red Hat Virtualization Manager search query language:
5.2. Wildcards
This query would result in all virtual machines with names beginning with vm, such as vm1, vm2, vma or
vm-webserver.
This query would result in all virtual machines with names beginning with v and ending with 1, such as
vm1, vr1 or virtualmachine1.
63