Description of problem: 1) Doesn't work with disk name [RHEVM shell (connected)]# show disk None-identifier id snapshot-identifier template-identifier datacenter-identifier name storagedomain-identifier vm-identifier [RHEVM shell (connected)]# show disk --name vm0_disk1 error: option "--name" is not supported, see help for more details. 2) not clear error message for parents [RHEVM shell (connected)]# show disk None-identifier id snapshot-identifier template-identifier datacenter-identifier name storagedomain-identifier vm-identifier [RHEVM shell (connected)]# show disk vm-identifier vm0 unknown error: get() got an unexpected keyword argument 'name' 3) According to help, only id is valid: [RHEVM shell (connected)]# help show disk USAGE - show <type> - show <type> <id> [parent identifiers] [command options] DESCRIPTION Shows an object by type 'disk'. See 'help show' for generic help on showing objects. ATTRIBUTE OPTIONS The following options are available for objects with type 'disk': * [--id :string(theidoftheentity)] * [--alias: string] Version-Release number of selected component (if applicable): av6.1 How reproducible: 100% Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Juan, is this a general REST problem or storage related so we should take it?
This is a general CLI behavior. The first few lines of the help for the "show" command explain that the object can be identified using the name or the unique identifier: ---8<--- Retrieve an object and display information about it. The following arguments are required: * type The type of object to retrieve * id The object identifier Objects can be identified by their name and by their unique id. --->8--- We could modify this as follows, to make clearer that "id" corresponds to the name of the identifier: ---8<--- * id The name or identifier of the object --->8--- Would that help?
No, it won't. 1st, the autocompletion provides unsupported options (name, parent's identifier) - so it could be nice to provide the supported option 2nd, in this case (show disk) the identifier is the only working option. [RHEVM shell]# list disks id : 633946ed-8353-48b8-a9e3-02580d728e98 name : VM-0_Disk1 [RHEVM shell ]# show disk VM-0_Disk1 unknown error: get() got an unexpected keyword argument 'name' [RHEVM shell ]# show disk 633946ed-8353-48b8-a9e3-02580d728e98 id : 633946ed-8353-48b8-a9e3-02580d728e98 name : VM-0_Disk1 actual_size : 15482358784 alias : VM-0_Disk1 bootable : True ... btw, I envoutered this issue, trying to create VM with disk / attach an existing disk to an exiting VM - without any luck, is it possible or should I open a new bug?
Yes please, open a new bug for the that issue.
This is a duplicate of upstream bug 866448. It will be fixed in the next 3.5 downstream release.
Maybe it's my fault, but it seems to me the logic here does not make sense. Why there is the vm-identifier option? If user can't search for disks just by using the vm-identifier because the disk identifier has to be always present, I don't see any reason why we keep the vm-identifier option. Disk can be present in on VM at a time, right? Furthermore, when 'vm-identifie' is used instead of '--vmidentifier' (We should probably autocomplete the '--'), "get() got an unexpected keyword argument 'name'" is printed out (no change in behavior since bug report). My impressio is only the "name" is no more autocompleted, but I still find the disk querying using CLI confusing and user unfriendly. [oVirt shell (connected)]# show disk alias id storagedomain-identifier vm-identifier datacenter-identifier snapshot-identifier template-identifier [oVirt shell (connected)]# show disk --vm-identifier ====================================================== ERROR ==================================================== disk identifier required. ================================================================================================================= [oVirt shell (connected)]# show disk --vm-identifier testtesttest ====================================================== ERROR ==================================================== disk identifier required. ================================================================================================================= [oVirt shell (connected)]# show disk vm-identifier testtesttest ================================================== UNKNOWN ERROR ================================================ get() got an unexpected keyword argument 'name' ================================================================================================================= [oVirt shell (connected)]# exit ================================================================================================================= >>> disconnected from oVirt manager <<< ================================================================================================================= [root@pb-rh35 yum.repos.d]# rpm -qa ovirt-engine-cli ovirt-engine-cli-3.5.0.2-1.20140710.git52d7a57.el6.noarch
This will be fixed rebasing from upstream version 3.5.0.4 of the CLI.
*** Bug 1109863 has been marked as a duplicate of this bug. ***
Version: rhevm-cli-3.5.0.4-1.el6ev Please look at point 3, otherwise verified. 1. [VERIFIED] disk name: The auto-complete now doesn't show 'name' as a valid parameter to show disk: [RHEVM shell (connected)]# show disk alias snapshot-identifier vm-identifier datacenter-identifier storagedomain-identifier id template-identifier Option '--name' isn't supported: [RHEVM shell (connected)]# show disk --name fed20_Disk1 ============ ERROR ============================ option "--name" is not supported, see help for more details. =============================================== As written in 'help show', I can query disk by name or by id: [RHEVM shell (connected)]# show disk fed20_Disk1 id : 75a4679f-ea50-4de6-835b-32b72d262fc6 name : fed20_Disk1 actual_size : 1256615936 alias : fed20_Disk1 bootable : True disk_profile-id : e671884c-3f06-48ec-8dcd-9dc52aa59d7b format : raw image_id : e35bb543-40db-4973-86c3-ecc713b0e43a interface : virtio propagate_errors : False provisioned_size : 5368709120 shareable : False size : 5368709120 sparse : True status-state : ok storage_domains-storage_domain-id: 95abe240-78bc-4e89-9591-f0f2d7959b9b wipe_after_delete : False [RHEVM shell (connected)]# show disk 75a4679f-ea50-4de6-835b-32b72d262fc6 id : 75a4679f-ea50-4de6-835b-32b72d262fc6 name : fed20_Disk1 actual_size : 1256615936 alias : fed20_Disk1 bootable : True disk_profile-id : e671884c-3f06-48ec-8dcd-9dc52aa59d7b format : raw image_id : e35bb543-40db-4973-86c3-ecc713b0e43a interface : virtio propagate_errors : False provisioned_size : 5368709120 shareable : False size : 5368709120 sparse : True status-state : ok storage_domains-storage_domain-id: 95abe240-78bc-4e89-9591-f0f2d7959b9b wipe_after_delete : False 2. [VERIFIED] error messages: [RHEVM shell (connected)]# show disk alias snapshot-identifier vm-identifier datacenter-identifier storagedomain-identifier id template-identifier [RHEVM shell (connected)]# show disk vm-identifier ===================== ERROR ======================== disk vm-identifier does not exist. ==================================================== [RHEVM shell (connected)]# show disk --vm-identifier ===================== ERROR ======================== disk identifier required. ==================================================== [RHEVM shell (connected)]# show disk --vm-identifier vm0 ===================== ERROR ======================== disk identifier required. ==================================================== 3. [FAILED] According to help, only id is valid: [RHEVM shell (connected)]# help show disk USAGE - show <type> - show <type> <id> [parent identifiers] [command options] ... Could we change the line: - show <type> <id> [parent identifiers] [command options] to maybe this: - show <type> <id|name> [parent identifiers] [command options]
(In reply to Petr Beňas from comment #7) > Maybe it's my fault, but it seems to me the logic here does not make sense. > Why there is the vm-identifier option? If user can't search for disks just > by using the vm-identifier because the disk identifier has to be always > present, I don't see any reason why we keep the vm-identifier option. Disk > can be present in on VM at a time, right? > > Furthermore, when 'vm-identifie' is used instead of '--vmidentifier' (We > should probably autocomplete the '--'), "get() got an unexpected keyword > argument 'name'" is printed out (no change in behavior since bug report). > > My impressio is only the "name" is no more autocompleted, but I still find > the disk querying using CLI confusing and user unfriendly. > > [oVirt shell (connected)]# show disk > alias id storagedomain-identifier > vm-identifier > datacenter-identifier snapshot-identifier template-identifier > > [oVirt shell (connected)]# show disk --vm-identifier > > ====================================================== ERROR > ==================================================== > disk identifier required. > > ============================================================================= > ==================================== > > [oVirt shell (connected)]# show disk --vm-identifier testtesttest > > ====================================================== ERROR > ==================================================== > disk identifier required. > > ============================================================================= > ==================================== > > [oVirt shell (connected)]# show disk vm-identifier testtesttest > ================================================== UNKNOWN ERROR > ================================================ > get() got an unexpected keyword argument > 'name' > > ============================================================================= > ==================================== > > [oVirt shell (connected)]# exit > > > > ============================================================================= > ==================================== > >>> disconnected from oVirt manager > <<< > > ============================================================================= > ==================================== > > [root@pb-rh35 yum.repos.d]# rpm -qa ovirt-engine-cli > ovirt-engine-cli-3.5.0.2-1.20140710.git52d7a57.el6.noarch Hi Petr, the 'vm-identifier' and/or 'template-identifier' parameters could be useful if you need to confirm that disk with given ID belongs to vm with given identifier. [RHEVM shell (connected)]# show disk fed20_Disk1 id : 75a4679f-ea50-4de6-835b-32b72d262fc6 name : fed20_Disk1 actual_size : 1256615936 alias : fed20_Disk1 bootable : True disk_profile-id : e671884c-3f06-48ec-8dcd-9dc52aa59d7b format : raw image_id : e35bb543-40db-4973-86c3-ecc713b0e43a interface : virtio propagate_errors : False provisioned_size : 5368709120 shareable : False size : 5368709120 sparse : True status-state : ok storage_domains-storage_domain-id: 95abe240-78bc-4e89-9591-f0f2d7959b9b wipe_after_delete : False [RHEVM shell (connected)]# show disk fed20_Disk1 --template-identifier fed20-temp id : 75a4679f-ea50-4de6-835b-32b72d262fc6 name : fed20_Disk1 actual_size : 1256615936 alias : fed20_Disk1 bootable : True disk_profile-id : e671884c-3f06-48ec-8dcd-9dc52aa59d7b format : raw image_id : e35bb543-40db-4973-86c3-ecc713b0e43a interface : virtio propagate_errors : False provisioned_size : 5368709120 shareable : False size : 5368709120 sparse : True status-state : ok storage_domains-storage_domain-id: 95abe240-78bc-4e89-9591-f0f2d7959b9b template-id : 7db1f0fb-a408-4a8f-864d-0d978d3d27eb wipe_after_delete : False [RHEVM shell (connected)]# show disk fed20_Disk1 --template-identifier rhel6.5-temp ==================== ERROR ======================== disk fed20_Disk1 does not exist. =================================================== I am not aware of any other means how to do this, so I think the parameters are valid and should be left there.
(In reply to Antonin Pagac from comment #11) > Could we change the line: > - show <type> <id> [parent identifiers] [command options] > to maybe this: > - show <type> <id|name> [parent identifiers] [command options] Yes, we can do that: http://gerrit.ovirt.org/33259
In comment 11, Antonin has requested "show <type> <id|name> " for help show disk, which does not make sence since the name is not available for disk any more. Verfified it's shown in help show, but not in help show disk. Consider the bug verified. [RHEVM shell (connected)]# help show show <type> <id|name> [parent identifiers] [command options] [RHEVM shell (connected)]# help show disk - show <type> <id> [parent identifiers] [command options]
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0185.html