Bug 1155678
Summary: | VM_NAME should be mandatory and validated when attempting to remove vm via rhevm-cli | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Tareq Alayan <talayan> | ||||||
Component: | ovirt-engine-sdk | Assignee: | Juan Hernández <juan.hernandez> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Pavol Brilla <pbrilla> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 3.5.0 | CC: | aberezin, ecohen, gklein, iheim, lsurette, mishka8520, rbalakri, Rhev-m-bugs, yeylon | ||||||
Target Milestone: | --- | Keywords: | Rebase | ||||||
Target Release: | 3.5.0 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | infra | ||||||||
Fixed In Version: | rhevm-sdk-python-3.5.0.8-1 | Doc Type: | Rebase: Bug Fixes and Enhancements | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2015-02-11 21:14:08 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Tareq Alayan
2014-10-22 15:28:34 UTC
This happens because before actually performing the remove the CLI performs a search to locate the VM, for example: GET /ovirt-engine/api/vms?search=name%3Dblablabla Filter: True But the RESTAPI server ignores the "search" parameter when the "Filter: True" header is used, it will instead return all the virtual machines that the user has permissions for. In this case it will return the information corresponding to the "testvm02" virtual machine: <vms> <vm id="77e1e939-3863-4dd5-adb4-66715516ff6e"> <-- This is the id of testvm02 <name>testvm02</name> ... </vm> ... </vms> The the CLI sends the DELETE request, to the resource returned in the previous step. the reasons for this issue are: 1. wrong behaviour of engine rest-api 2. cli that running in user mode, but assumes admin when filter=true, api should not return any object at all, as ?search is not supported in the user mode, as about cli, when filter=true, it should not use ?search to locate the resource by name, but listing of all resources via list() + kwargs filtering on client side so no obj will be returned if no kwargs match has found (unfortunately cli code was written way before user-api, thus it not addresses issue arise in this mode), so i'd split this BZ in two -> rest-api / cli Bug 1155967 tracks the issue in the RESTAPI. The complete fix for this bug should be adding support for the "search" parameter to the backend, but as that will take a long time, we will are introducing in the Python SDK an additional filtering of the results returned by the server, so that objects that don't match the name given by the user (or the alias, for disks) are discarded. This has been done in upstream release 3.5.0.8, so to fix this bug dowstream we will need to rebase. Created attachment 956267 [details]
Proposed patch to fix the bug
Created attachment 956676 [details]
Proposed patch to fix the bug
tested on vt12 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-0183.html |