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 1062434 - RHEV 3.3 rhevm-shell 'show vm' not returning all guest attributes
Summary: RHEV 3.3 rhevm-shell 'show vm' not returning all guest attributes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.4.0
Assignee: Ravi Nori
QA Contact: Jiri Belka
URL:
Whiteboard: infra
Depends On: 866448
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-06 22:51 UTC by Dave Sullivan
Modified: 2018-12-05 17:13 UTC (History)
14 users (show)

Fixed In Version: av2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-12 14:03:50 UTC
oVirt Team: Infra


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 24210 None None None Never
oVirt gerrit 24273 None None None Never

Description Dave Sullivan 2014-02-06 22:51:49 UTC
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 10:18:40 UTC
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 13:11:36 UTC
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 14:22:21 UTC
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 14:46:56 UTC
First part of the fix, documenting the All-Content header in the RSDL, has been merged.

Comment 5 Sandro Bonazzola 2014-02-19 11:58:02 UTC
all patches merged

Comment 6 Michael Pasternak 2014-02-19 12:22:41 UTC
(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 12:26:35 UTC
This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA

Comment 8 Michael Pasternak 2014-02-19 12:42:28 UTC
(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 08:52:02 UTC
(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 14:09:57 UTC
Eli,

Please read last few comments above.

Comment 11 Juan Hernández 2014-02-26 12:23:01 UTC
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 10:57:12 UTC
The way to display all the VM content is the following:

  # show vm myvm --all_content true

Comment 13 Michael Pasternak 2014-03-05 11:57:11 UTC
(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 12:05:10 UTC
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 12:14:23 UTC
(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 15:24:56 UTC
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 14:03:50 UTC
Closing as part of 3.4.0


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