Bug 1472742

Summary: Running engine-host-update.py with single host in the cluster and running VM shows traceback
Product: [oVirt] ovirt-engine Reporter: Lukas Svaty <lsvaty>
Component: GeneralAssignee: Lev Veyde <lveyde>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.4.2CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-31 09:10:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Svaty 2017-07-19 10:12:00 UTC
Description of problem:
Running engine-host-update.py with single host and running VM shows traceback. This traceback should be properly handled and only details should be displays.



Version-Release number of selected component (if applicable):
ovirt-engine-4.1.4.2-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Have 1 host with running VM in engine
2. run `./engine-host-update.py --insecure --engine=localhost --username=admin@internal --password=mypass` --cluster=Default

Actual results:
Processing Host: moonmoon
Type: rhel
	Moving host to the maintenanceTraceback (most recent call last):
  File "./engine-host-update.py", line 684, in <module>
    processHost(api, host, skipInvalidHostNames)
  File "./engine-host-update.py", line 393, in processHost
    deactivateHost(api, name)
  File "./engine-host-update.py", line 213, in deactivateHost
    host.deactivate()
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/brokers.py", line 14293, in deactivate
    headers={"Correlation-Id":correlation_id}
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 122, in request
    persistent_auth=self.__persistent_auth
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 79, in do_request
    persistent_auth)
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 162, in __do_request
    raise errors.RequestError(response_code, response_reason, response_body)
ovirtsdk.infrastructure.errors.RequestError: 
status: 409
reason: Conflict
detail: The following Hosts have running VMs and cannot be switched to maintenance mode: moonmoon.Please ensure that the following Clusters have at least one Host in UP state: Default.


Expected results:
Error: The following Hosts have running VMs and cannot be switched to maintenance mode: moonmoon.Please ensure that the following Clusters have at least one Host in UP state: Default.

Comment 1 Sandro Bonazzola 2017-07-31 09:10:01 UTC
Not going to fix this, behavior is considered acceptable for this tool.