3.2. Resources


3.2.1. List Resources in a Collection (list)

Use the list command to display all resources of a specific type. Lists also include optional search queries to filter results.
Syntax

list [collection] [options]

Expand
Table 3.2. list standard options
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 true|false Match search queries using case sensitivity.
--max Maximum number of results for display.

Note

Options specific to resource types are listed in the definition pages for each resource type.

Example 3.3. Examples for list

List virtual machines:
[RHEVM shell (connected)]# list vms
Copy to Clipboard Toggle word wrap
List virtual machines with all properties listed:
[RHEVM shell (connected)]# list vms --show-all
Copy to Clipboard Toggle word wrap
List virtual machines with a status of 'up':
[RHEVM shell (connected)]# list vms --query "status=up"
Copy to Clipboard Toggle word wrap
List users that match the specified user name across all domains with the use of a wildcard:
[RHEVM shell (connected)]# list users --query "usrname=jsmith@*"  --case_sensitive false
Copy to Clipboard Toggle word wrap
Get help with list search syntax:
[RHEVM shell (connected)]# list --help
Copy to Clipboard Toggle word wrap

3.2.2. Show a Resource (show)

Use the show command to display resource properties.
Syntax

show [resource] [id|name] [options]

Note

Options specific to resource types are listed in the definition pages for each resource type.

Example 3.4. Examples for show

Show virtual machines based upon id:
[RHEVM shell (connected)]# show vm fcadfd5f-9a12-4a1e-bb9b-2b9d5c2e04c3
Copy to Clipboard Toggle word wrap
Show virtual machines based upon name:
[RHEVM shell (connected)]# show vm RHEL6-Server
Copy to Clipboard Toggle word wrap

3.2.3. Add a Resource (add)

Use the add command to add a new resource.
Syntax

add [resource] [options]

Note

Options specific to resource types are listed in the definition pages for each resource type.

Example 3.5. Examples for add

Create a virtual machine:
[RHEVM shell (connected)]# add vm [vm-options]
Copy to Clipboard Toggle word wrap
Create a user:
[RHEVM shell (connected)]# add user [user-options]
Copy to Clipboard Toggle word wrap
The add command can be made synchronous (if supported) by using the expect option:
[RHEVM shell (connected)]# add vm [vm-options] --expect '201-created'
Copy to Clipboard Toggle word wrap

3.2.4. Update a Resource (update)

Use the update command to modify an existing resource.
Syntax

update [resource] [id|name] [options]

Note

Options specific to resource types are listed in the definition pages for each resource type.

Example 3.6. Examples for update

Update a virtual machine:
[RHEVM shell (connected)]# update vm RHEL6-Server [vm-options]
Copy to Clipboard Toggle word wrap

3.2.5. Remove a Resource (remove)

Use the remove command to remove a resource.
Syntax

remove [resource] [id|name] [options]

Expand
Table 3.3. remove standard options
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.

Example 3.7. Examples for remove

Remove a virtual machine:
[RHEVM shell (connected)]# remove vm RHEL6-Server
Copy to Clipboard Toggle word wrap
Asynchronous removal of a virtual machine:
[RHEVM shell (connected)]# remove vm RHEL6-Server --async true
Copy to Clipboard Toggle word wrap
Force remove virtual machine:
[RHEVM shell (connected)]# remove vm RHEL6-Server --force
Copy to Clipboard Toggle word wrap

3.2.6. Perform Action on a Resource (action)

Use the action command to perform a special function relevant to resource type.
Syntax

action [resource] [id|name] [action] [options]

Note

Options specific to resource actions are listed in the definition pages for each resource type.

Example 3.8. Examples for action

Start a virtual machine
[RHEVM shell (connected)]# action vm RHEL6-Server start
Copy to Clipboard Toggle word wrap
Stop a virtual machine:
[RHEVM shell (connected)]# action vm RHEL6-Server stop
Copy to Clipboard Toggle word wrap
The action command can be made synchronous (if supported) by using the async option:
[RHEVM shell (connected)]# action vm [vm-options] --async false
Copy to Clipboard Toggle word wrap

3.2.7. Using Sub-Resources (--RESOURCE-identifier)

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.

Example 3.9. Examples for creating sub-resources with add

Create a NIC on a virtual machine:
[RHEVM shell (connected)]# add nic --vm-identifier RHEL6-Server [nic-options]
Copy to Clipboard Toggle word wrap
Note the use of the --vm-identifier RHEL6-Server option. This adds a NIC on the RHEL6-Server virtual machine.
Create a storage disk on a virtual machine:
[RHEVM shell (connected)]# add disk --vm-identifier RHEL6-Server [user-options]
Copy to Clipboard Toggle word wrap
Note the use of the --vm-identifier RHEL6-Server option. This adds a storage disk on the RHEL6-Server virtual machine.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat