Bug 1792209
| Summary: | Datacenters service 'list' ignores search query for 'Default' cluster | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine-sdk-python | Reporter: | HSS Admins <hss-rhn> |
| Component: | General | Assignee: | Ori Liel <oliel> |
| Status: | CLOSED NOTABUG | QA Contact: | meital avital <mavital> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.3.0 | CC: | bugs, juan.hernandez, mperina, rbarry |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-01-20 12:05:49 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: | |||
|
Description
HSS Admins
2020-01-17 10:02:38 UTC
I think we need to narrow down the problem some
more. The following 4.4 python sdk script works for me.
It prints the default datacenter as expected. So I don't
think theproblem is with the search:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ovirtsdk4 as sdk
import ovirtsdk4.types as types
# Create the connection to the server:
connection = sdk.Connection(
url='http://localhost:8080/ovirt-engine/api',
username='admin@internal',
password='letmein!',
debug=True,
log=logging.getLogger(),
)
# Get datacenters associated with 'Default' Cluster
datacenters_service = connection.system_service().data_centers_service()
datacenters = datacenters_service.list(
search='Clusters.name=Default',
case_sensitive=False,
)
for datacenter in datacenters:
print('%s: %s' % (datacenter.name, datacenter.id))
connection.close()
@Ori Liel,
thanks for taking a look. I tried the script and it worked. Also adding the steps done in the ovirt_nic module did not change the result.
It turns out that the user we've been using with the module seems to be missing some permissions.
The module works correctly with a full fledged user.
The permissions of the user were as follows (with 'User' set to the role as Account Type):
* System -> Configure System -> Login Permissions
* VM -> Basic Operations
* Reboot, Stop, Shut Down and Run VM
* VM -> Provisioning Operations -> Create
* Disk -> Provisioning Operations
* Create, Attach
* Disk -> Disk Profile -> Attach Disk Profile
Creating a new role with 'Admin' as Account Type and the same permissions as above the ovirt_nic module correctly executes.
Shall we close the bug then? I suppose we can close it. I'm not sure whether perhaps there should be a warning about missing permissions? I'm still not sure what permissions exactly were missing. The module worked successfully on a RHEVM with only one Cluster and Datacenter. Problem only occured when multiple Datacenters existed. |