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:
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.
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
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
First part of the fix, documenting the All-Content header in the RSDL, has been merged.
all patches merged
(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.
This bug is referenced in ovirt-engine-3.4.0-beta3 logs. Moving to ON_QA
(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)
(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
Eli, Please read last few comments above.
The merged changes are part of the solution, but the bug isn't completely solved yet. Please don't change the status.
The way to display all the VM content is the following: # show vm myvm --all_content true
(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)]
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
(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)
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
Closing as part of 3.4.0