이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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 Enterprise 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.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat