Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1187181

Summary: Engine APIs doesn't provide host information for local domains
Product: Red Hat Enterprise Virtualization Manager Reporter: Simone Tiraboschi <stirabos>
Component: ovirt-engine-restapiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED NOTABUG QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: bazulay, ecohen, gklein, iheim, lsurette, rbalakri, Rhev-m-bugs, stirabos, yeylon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-29 14:45:34 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:
Bug Depends On:    
Bug Blocks: 1097789    

Description Simone Tiraboschi 2015-01-29 13:40:08 UTC
Description of problem:
engine-iso-uploader can upload an iso via ssh to a domain that is a 'local domain on a remote host'.
Knowing the domain name it should be possible to get information about the host which the domain is local to.

Example:

from ovirtsdk.api import API

api = API(
    url='https://myhost/ovirt-engine/api',
    username='admin@internal',
    password='******',
    ca_file='myca.crt',
)
isol = api.storagedomains.get('isol')
uuid = isol.get_id()
storage = isol.get_storage()
sdtype = isol.get_type()
stype = storage.get_type()
sdhost = isol.get_host()
shost = storage.get_host()
saddr = storage.get_path()
print(uuid)
print(sdtype)
print(stype)
print(sdhost)
print(shost)
print(saddr)

Results in:
5dc0fdee-bca5-44c3-b611-4b1f998ec39d
iso
localfs
None
None
/mnt/iso


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

How reproducible:
100%

Steps to Reproduce:
1. create a local iso domain a specific host
2. from another host try to get information about that host via the engine APIs (try with the above script)
3.

Actual results:
get_host() returns none.

Expected results:
get_host() on local storage domain should return the host to witch the domain is local to.

Additional info:

Comment 1 Juan Hernández 2015-01-29 14:33:53 UTC
The "host" attribute of the storage domain entity is only relevant when creating or deleting a storage domain. The confusion this causes is one of the side effects of the violation of the REST principles that mixing resource representation with actions is. For the sake of correctness this "host" attribute should be removed, maybe in 4.0.

The way to find the hosts that are connected to a storage domain is to use a query:

  GET /hosts?search=storage%3Diso1

With the Python SDK you can do that, and then get the address of the hosts like this:

  sd = "iso1"
  hosts = api.hosts.list(query="storage=%s" % sd)
  for host in hosts:
    print(host.get_address())

In the particular case of a local storage domain there will always be only one host in this result set.

Please check if this works for you and close the bug as NOTABUG if it does.

Comment 2 Simone Tiraboschi 2015-01-29 14:45:34 UTC
Yes, it works as expected. Thanks.