Bug 1367720

Summary: "Host to Maintenance" failed via cockpit if there is other host is registering to engine
Product: [oVirt] ovirt-node Reporter: jianwu <jiawu>
Component: UIAssignee: Marek Libra <mlibra>
Status: CLOSED NOTABUG QA Contact: jianwu <jiawu>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0CC: bugs, cshao, danken, dperpeet, fdeutsch, huzhao, jiawu, leiwang, mburman, michal.skrivanek, osvoboda, rbarry, thaller, tjelinek, yaniwang, ycui
Target Milestone: ---Flags: rule-engine: planning_ack?
rule-engine: devel_ack?
cshao: testing_ack+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-19 07:46:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
The cokpit's tag status when clicking Host to engine-part1
none
The cokpit's tag status when clicking Host to engine-part2
none
The cokpit's tag status when clicking Host to engine-part3
none
The reproduce status on engine
none
The vm status on engine
none
The related log about this bug
none
engine.log about cockpit none

Description jianwu 2016-08-17 10:07:40 UTC
Created attachment 1191555 [details]
The cokpit's tag status when clicking Host to engine-part1

Description of problem:
1.After registering to rhevm, the host cannot maintenance via cockpit page icon "Host to Maintenance" when there are other cluster's hosts are activating on the engine.

Version-Release number of selected component (if applicable):
redhat-virtualization-host-4.0-20160816.1
imgbased-0.8.4-1.el7ev.noarch
cockpit-ws-0.114-2.el7.x86_64
cockpit-ovirt-dashboard-0.10.6-1.3.6.el7ev.noarch


How reproducible:
100%


Steps to Reproduce:
1. Install RHVH rhvh-4.0-0.20160816.1
2. Login cockpit via "ip:9090"
3. Register to engine, set up vm on rhevm.
4. Enter "Vitualization" page, click "VMs in cluster".
5. Click "Host to Maintenance" below "Technical Preview".
   


Actual results:
After step 5, click "Host to Maintenance" failed to maintenance its host when there are other hosts in the state of activating.


Expected results:
After step 5, click "Host to Maintenance" can maintenance its host successfully.

Additional info:
After step5, click "Host to Maintenance" could work when all other cluster keeps inactive. it may be effected by other clusters.

Comment 1 Red Hat Bugzilla Rules Engine 2016-08-17 10:07:49 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 2 jianwu 2016-08-17 10:08:12 UTC
Created attachment 1191556 [details]
The cokpit's tag status when clicking Host to engine-part2

Comment 3 jianwu 2016-08-17 10:09:00 UTC
Created attachment 1191557 [details]
The cokpit's tag status when clicking Host to engine-part3

Comment 4 jianwu 2016-08-17 10:09:44 UTC
Created attachment 1191558 [details]
The reproduce status on engine

Comment 5 jianwu 2016-08-17 10:10:14 UTC
Created attachment 1191559 [details]
The vm status on engine

Comment 6 jianwu 2016-08-17 10:12:31 UTC
Created attachment 1191560 [details]
The related log about this bug

Comment 7 Tomas Jelinek 2016-08-18 06:46:00 UTC
- please provide also the engine.log 
- if you do the same operation in webadmin (e.g. hosts main tab, pick the host and press maintenance), does it behave differently?

Comment 8 jianwu 2016-08-18 07:29:07 UTC
(In reply to Tomas Jelinek from comment #7)
> - please provide also the engine.log 
> - if you do the same operation in webadmin (e.g. hosts main tab, pick the
> host and press maintenance), does it behave differently?

On the engine, can maintenance the host anytime, and it did not effected by other clusters.

i will reproduce the situation on 20160817 new version, and will provide related log.

Thanks

Comment 9 Tomas Jelinek 2016-08-18 08:41:08 UTC
thank you, putting the needinfo back to mark we are waiting for logs

Comment 10 jianwu 2016-08-19 02:06:42 UTC
Created attachment 1192017 [details]
engine.log about cockpit

Comment 11 jianwu 2016-08-19 02:08:03 UTC
(In reply to Tomas Jelinek from comment #9)
> thank you, putting the needinfo back to mark we are waiting for logs

i have upload engine.log form new version rhevh4.0 about "host to maintenance "via cockpit.

Comment 12 Tomas Jelinek 2016-08-19 07:46:30 UTC
so, looking at the logs I would say it behaves correctly and if it works from the UI than it is a coincidence / timing issue.
In the logs I can see that:

Operation Failed: [Cannot switch Host to Maintenance mode. Host is contending for Storage Pool Manager, wait for operation to complete and retry.]

and than two lines after:
[org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStartVDSCommand] (DefaultQuartzScheduler4) [6356c111] spmStart polling ended: taskId 'ae842052-f1b0-4535-a7a4-62b797b1264f' task status 'finished'

So, if you tried to run the maintenance now it would pass.
What cockpit is doing is just sending a REST call to:
/api/hosts/<host id>/deactivate
with body:
<action/>

So, I would say this is not a bug.

You could simulate the same as cockpit is doing by sending POST to <engine API path>/hosts/<host id>/deactivate with <action/> as body
If it behaves incorrectly, than please open a bug for the REST API. And if that behaves differently than the cockpit ui, than please feel free to reopen.