Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1091725 - [RHEVM-CLI] - show disk auto complete misfunctions
Summary: [RHEVM-CLI] - show disk auto complete misfunctions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
: 1109863 (view as bug list)
Depends On:
Blocks: rhev3.5beta rhev3.5beta3 1156165
TreeView+ depends on / blocked
 
Reported: 2014-04-27 15:39 UTC by Barak Dagan
Modified: 2016-02-10 19:14 UTC (History)
11 users (show)

Fixed In Version: rhevm-cli-3.5.0.5-1.el6ev
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-11 18:10:16 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0185 normal SHIPPED_LIVE rhevm-cli bug fix and enhancement update 2015-02-11 22:39:13 UTC
oVirt gerrit 24710 None None None Never
oVirt gerrit 32144 master MERGED cli: Support show by alias Never
oVirt gerrit 32413 cli_3.5 MERGED cli: Support show by alias Never
oVirt gerrit 33259 master MERGED cli: Explicitly document use of name in show Never
oVirt gerrit 33384 cli_3.5 MERGED cli: Explicitly document use of name in show Never

Description Barak Dagan 2014-04-27 15:39:52 UTC
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:

Comment 1 Tal Nisan 2014-04-28 07:43:34 UTC
Juan, is this a general REST problem or storage related so we should take it?

Comment 2 Juan Hernández 2014-04-28 13:28:12 UTC
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?

Comment 3 Barak Dagan 2014-04-29 07:21:54 UTC
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?

Comment 4 Juan Hernández 2014-04-29 08:14:51 UTC
Yes please, open a new bug for the that issue.

Comment 5 Juan Hernández 2014-05-20 13:18:24 UTC
This is a duplicate of upstream bug 866448. It will be fixed in the next 3.5 downstream release.

Comment 7 Petr Beňas 2014-07-29 15:37:56 UTC
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

Comment 8 Juan Hernández 2014-09-03 15:08:36 UTC
This will be fixed rebasing from upstream version 3.5.0.4 of the CLI.

Comment 9 Juan Hernández 2014-09-03 16:17:35 UTC
*** Bug 1109863 has been marked as a duplicate of this bug. ***

Comment 11 Antonin Pagac 2014-09-23 09:00:31 UTC
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]

Comment 12 Antonin Pagac 2014-09-23 09:08:09 UTC
(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.

Comment 13 Juan Hernández 2014-09-23 12:38:05 UTC
(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

Comment 15 Petr Beňas 2014-10-22 12:23:12 UTC
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]

Comment 18 errata-xmlrpc 2015-02-11 18:10:16 UTC
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


Note You need to log in before you can comment on or make changes to this bug.