Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1062434 - RHEV 3.3 rhevm-shell 'show vm' not returning all guest attributes
RHEV 3.3 rhevm-shell 'show vm' not returning all guest attributes
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli (Show other bugs)
3.3.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.4.0
Assigned To: Ravi Nori
Jiri Belka
infra
:
Depends On: 866448
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-06 17:51 EST by Dave Sullivan
Modified: 2016-02-10 14:23 EST (History)
14 users (show)

See Also:
Fixed In Version: av2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-12 10:03:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 24210 None None None Never
oVirt gerrit 24273 None None None Never

  None (edit)
Description Dave Sullivan 2014-02-06 17:51:49 EST
Description of problem:

Redhat RHEV 3.3 rhevm-shell 'show vm <guest name>' does not return all attributes / settings for the given guest. I have not expended the effort to catalog all that is missing, but the disparity between what is returned by 'show vm <guest>' and 'update vm <guest> --changing something' yields these: console-enabled, virtio_scsi-enabled, memory_policy-ballooning

[RHEVM shell (connected)]# info

backend version: 3.3
sdk version    : 3.3.0.21.*final-.1
cli version    : 3.3.0.13.*final-.1
python version : 2.6.6.final.0

entry point    : https://lb0160.acme.com/api

[RHEVM shell (connected)]# show vm lbvgrhevc0001

id                        : dfe8dd51-c34b-48f3-8c9a-da58a6b643b7
name                      : lbvgrhevc0001
cluster-id                : d165919e-6af2-47e9-811f-11006dad6d6c
cpu-topology-cores        : 2
cpu-topology-sockets      : 1
cpu_shares                : 0
creation_time             : 2014-01-23 22:58:54.742000-06:00
delete_protected          : False
display-address           : lb0145-rh1.acme.com
display-allow_override    : False
display-monitors          : 1
display-port              : 5900
display-single_qxl_pci    : False
display-smartcard_enabled : False
display-type              : vnc
high_availability-enabled : False
high_availability-priority: 1
host-id                   : 3ebf096e-a0e2-409d-84df-5e04c07454e2
memory                    : 4294967296
memory_policy-guaranteed  : 4294967296
origin                    : ovirt
os-boot-dev               : hd
os-boot-dev               : network
os-type                   : rhel_6x64
placement_policy-affinity : migratable
start_time                : 2014-02-03 21:02:41.611000-06:00
stateless                 : False
status-state              : up
template-id               : 00000000-0000-0000-0000-000000000000
type                      : server
usb-enabled               : False


[RHEVM shell (connected)]# update vm lbvgrhevc0001 --console-enabled True
id                        : dfe8dd51-c34b-48f3-8c9a-da58a6b643b7
name                      : lbvgrhevc0001
cluster-id                : d165919e-6af2-47e9-811f-11006dad6d6c
console-enabled           : True
cpu-topology-cores        : 2
cpu-topology-sockets      : 1
cpu_shares                : 0
creation_time             : 2014-01-23 22:58:54.742000-06:00
delete_protected          : False
display-allow_override    : False
display-monitors          : 1
display-single_qxl_pci    : False
display-smartcard_enabled : False
display-type              : vnc
high_availability-enabled : False
high_availability-priority: 0
memory                    : 4294967296
memory_policy-ballooning  : True
memory_policy-guaranteed  : 4294967296
origin                    : ovirt
os-boot-dev               : hd
os-boot-dev               : network
os-type                   : rhel_6x64
placement_policy-affinity : migratable
stateless                 : False
status-state              : down
template-id               : 00000000-0000-0000-0000-000000000000
type                      : server
usb-enabled               : False
virtio_scsi-enabled       : True

Hide Section - Tags


Version-Release number of selected component (if applicable):

see above 3.3.0 GA

How reproducible:

see above


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:

rhevm-shell 'show vm <guest name>' should show all available vm attributes

Additional info:
Comment 1 Juan Hernández 2014-02-07 05:18:40 EST
The reason for this is that when a resource is returned by the GET operation of the RESTAPI by default it only contains a basic set of information. To get the additional information the "All-Content: True" header has to be added to the request. Other operations, like PUT, automatically return all the information.

So to get the requested information in this case it should be enough with using the --all-content option in the command line. Unfortunately this won't work because the availability of the header isn't correctly advertised in the RSDL document. This is the bug.

To fix this we need to document the "All-Content" header in all the resources that support it. Something like this, but for all the relevant resources:

diff --git a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml b/backen
index cca493e..450e21a 100644
--- a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
+++ b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
@@ -24,6 +24,7 @@ actions:
     urlparams: {}
     headers:
       Filter: {value: true|false, required: false}
+      All-Content: {value: true|false, required: false}
 - name: /vms/{vm:id}|rel=delete
   description: deletes the virtual machine in the system for the given virtual machine id
   request:

Then we need to build the engine, regenerate the SDK, and modify the CLI so that it will support the --all-content option.
Comment 2 Michael Pasternak 2014-02-08 08:11:36 EST
Ravi,

to solve this bug you need two things:

1. add all_content meatdata in REST-API (RSDL)
2. fix Bug 866448

no extra coding in cli should be required for this as
it will be addressed automatically by the cli infra
Comment 3 Michael Pasternak 2014-02-08 09:22:21 EST
or to simplify:

(In reply to Michael Pasternak from comment #2)
> Ravi,
> 
> to solve this bug you need two things:
> 
> 1. add all_content meatdata in REST-API (RSDL)

this will expose all_content for LIST command

> 2. fix Bug 866448

2.1 add all_content arg in all codegen *get* templates
2.2 make auto-completion exposing sdk x.get() args as it does
    for other commands (this will expose --all-content and pass
    it to sdk x.get() when you trigger it)

> 
> no extra coding in cli should be required for this as
> it will be addressed automatically by the cli infra
Comment 4 Juan Hernández 2014-02-10 09:46:56 EST
First part of the fix, documenting the All-Content header in the RSDL, has been merged.
Comment 5 Sandro Bonazzola 2014-02-19 06:58:02 EST
all patches merged
Comment 6 Michael Pasternak 2014-02-19 07:22:41 EST
(In reply to Sandro Bonazzola from comment #5)
> all patches merged

this is not all patches, but same path (first part) that have been merged
to two different branches, please revert this change,

also it was not decided yet in which version this bug should be fixed
nor it was ack'ed,

i'd suggest letting maintainers moving bugs to MODIFY as usually they
have better view on what should be fixed and where and if patch/es attached
to BZ does/do the job.
Comment 7 Sandro Bonazzola 2014-02-19 07:26:35 EST
This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA
Comment 8 Michael Pasternak 2014-02-19 07:42:28 EST
(In reply to Sandro Bonazzola from comment #7)
> This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA

Sandro,

Did you saw Comment 6?

(btw please move this BZ to ovirt-engine-cli)
Comment 9 Sandro Bonazzola 2014-02-20 03:52:02 EST
(In reply to Michael Pasternak from comment #8)
> (In reply to Sandro Bonazzola from comment #7)
> > This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA
> 
> Sandro,
> 
> Did you saw Comment 6?

No, I didn't see it, changing BZs in batch.
BTW, Bug-Url should be used in commits when fixing the BZ, Related-To should be used when the patch is not fixing the BZ.
So there can't be mistake in thinking that a BZ is fixed.

Moving back to POST as per comment #6.

> 
> (btw please move this BZ to ovirt-engine-cli)

done
Comment 10 Michael Pasternak 2014-02-24 09:09:57 EST
Eli,

Please read last few comments above.
Comment 11 Juan Hernández 2014-02-26 07:23:01 EST
The merged changes are part of the solution, but the bug isn't completely solved yet. Please don't change the status.
Comment 12 Juan Hernández 2014-03-05 05:57:12 EST
The way to display all the VM content is the following:

  # show vm myvm --all_content true
Comment 13 Michael Pasternak 2014-03-05 06:57:11 EST
(In reply to Juan Hernández from comment #12)
> The way to display all the VM content is the following:
> 
>   # show vm myvm --all_content true

Juan,

How this is possible?, signatures for vms.list()/.get() are [1], if you added
this option manually to the command - it will be silently ignored 

(if cli does not expose it in auto-completion, - it not available)

[1]

    def get(self, name=None, id=None):
        '''
        [@param id  : string (the id of the entity)]
        [@param name: string (the name of the entity)]

    def list(self, query=None, case_sensitive=True, max=None, **kwargs):
        '''
        [@param **kwargs: dict (property based filtering)]
        [@param query: string (oVirt engine search dialect query)]
        [@param case_sensitive: boolean (true|false)]
        [@param max: int (max results)]
Comment 14 Juan Hernández 2014-03-05 07:05:10 EST
Michael, you are probably looking at the master branch, but the required change is in the 3.4 branch only, as the master branch wasn't recently regenerated:

http://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=src/ovirtsdk/infrastructure/brokers.py;h=876eb9fe0daba4a6ba0b8ec3fa16d76660206965;hb=refs/heads/sdk_3.4#l18913
Comment 15 Michael Pasternak 2014-03-05 07:14:23 EST
(In reply to Juan Hernández from comment #14)
> Michael, you are probably looking at the master branch, but the required
> change is in the 3.4 branch only, as the master branch wasn't recently
> regenerated:
> 
> http://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=src/ovirtsdk/
> infrastructure/brokers.py;h=876eb9fe0daba4a6ba0b8ec3fa16d76660206965;hb=refs/
> heads/sdk_3.4#l18913

Juan,

You should regenerate master branch first and only then backport the relevant
changes to other branches, otherwise you can end up with regressions (also you
not getting any benefit from community when outdated master been used)
Comment 16 Jiri Belka 2014-03-18 11:24:56 EDT
ok, av3.

[RHEVM shell (connected)]# show vm fff | egrep "console-enabled|virtio_scsi-enabled|memory_policy-ballooning"
  =================================================================================== ERROR ================================================================================
                                                                                       
  ==========================================================================================================================================================================

[RHEVM shell (connected)]# show vm fff --all_content true | egrep "console-enabled|virtio_scsi-enabled|memory_policy-ballooning"
console-enabled                   : False
memory_policy-ballooning          : True
virtio_scsi-enabled               : True

there's little side effect, broken output for 'initialization_configuration_data' value, BZ1077806
Comment 17 Itamar Heim 2014-06-12 10:03:50 EDT
Closing as part of 3.4.0

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