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

Bug 1069530

Summary: REST API fails to return the host ID of VM which is in unknown state due to node crash
Product: Red Hat Enterprise Virtualization Manager Reporter: Mahendra Takwale <mahendra_takwale>
Component: ovirt-engine-restapiAssignee: jniederm
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: high    
Version: 3.5.0CC: adahms, bazulay, ecohen, gklein, juwu, lbopf, lsurette, mahendra_takwale, mgoldboi, michal.skrivanek, rbalakri, Rhev-m-bugs, sgordon, yeylon
Target Milestone: ---   
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1144938 (view as bug list) Environment:
Last Closed: 2015-08-17 13:31:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1144938    
Bug Blocks:    
Attachments:
Description Flags
rhevm engine log none

Description Mahendra Takwale 2014-02-25 08:15:34 UTC
Created attachment 867283 [details]
rhevm engine log

Description of problem:
A host on which virtual machine was running crashes causing VM to go into unknown state. In such scenario, RHEV-M shows VM state along with associated host. However, if we try to retrieve the host associated with such VM using REST API it returns NULL.
This behavior is different than what we have observed in RHEV 3.1 and 3.2.
We are retrieving the host associate VM to initiate manual fencing using REST API in case of host crash.
If everything is working then the query returns:
# /usr/bin/curl --silent --fail --insecure --request  GET --data "" --user admin@internal:admin123 --basic --url https://rhevm.example.com:443/api/vms/bec376c5-36a5-43c5-a6de-9e7fbdcf263f --show-error --header "Accept:application/xml" | /usr/bin/xpath "string(vm/host/@id)"
Query didn't return a nodeset. Value: 46a8288a-d3f6-43b0-8fd6-33524eac9be7
#

But if the host is down and vm is in unknown state then the query returns

# /usr/bin/curl --silent --fail --insecure --request  GET --data "" --user admin@internal:admin123 --basic --url https://rhevm.example.com:443/api/vms/bec376c5-36a5-43c5-a6de-9e7fbdcf263f --show-error --header "Accept:application/xml" | /usr/bin/xpath "string(vm/host/@id)"
Query didn't return a nodeset. Value: 
#


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

How reproducible:
Poweroff the host on which virtual machine is running and check the host and VM state. Once the host goes into "Non Responsive" state, check VM state, it goes into "unknown" state. use REST API to retrieve the host id associated with that particular VM

Steps to Reproduce:
1.
2.
3.

Actual results:
The REST API returns the empty string while RHEV-M console shows the host name

Expected results:
The REST API should return then host id. Also, the VM should not be in unknown state.

Additional info:

Comment 1 Mahendra Takwale 2014-02-26 06:45:53 UTC
Please include ovirt-engine-restapi developers as well.

Thanks & Regards,
Mahendra Takwale

Comment 3 Andrew Dahms 2015-02-22 22:23:38 UTC
Reassigning this bug to ovirt-engine-restapi for review.

Comment 4 jniederm 2015-08-17 13:31:36 UTC

*** This bug has been marked as a duplicate of bug 1144938 ***