https://foreman.example.com/ "PUT /api/hosts/43003/power HTTP/1.1" 500 100 Exception in thread Thread-stateless-machine.example.com: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner self.run() File "provision.py", line 368, in run self.reboot_host() File "provision.py", line 181, in reboot_host self._foreman.hosts.power(power_action="cycle", id=host_id) File "", line 15, in power File "/workspace/.ansible/lib/python2.7/site-packages/foreman/client.py", line 944, in do_put return self._process_request_result(res) File "/workspace/.ansible/lib/python2.7/site-packages/foreman/client.py", line 898, in _process_request_result 'Something went wrong:%s' % res_to_str(res) ForemanException: Something went wrong: #################################### url = https://foreman.example.com/api/hosts/43003/power headers = {'Content-Length': '38', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json; version=2', 'User-Agent': 'python-requests/2.18.4', 'Connection': 'keep-alive', 'Cookie': '_session_id=4afb2f5b13aeeba3d99914c9ffc2d874', 'Content-type': 'application/json', 'Authorization': '*****'} -------- data sent ----------------- {"power_action": "cycle", "id": 43003} ------------------------------------ @@@@@ response @@@@@@@@@@@@@@@@ headers = {'Status': '500 Internal Server Error', 'X-Request-Id': '635ea7a1-1708-4082-a36e-ce24343af80b', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'X-Powered-By': 'Phusion Passenger 4.0.18', 'Set-Cookie': 'request_method=PUT; path=/', 'Vary': 'Accept-Encoding', 'Foreman_version': '1.12.4', 'Content-Length': '100', 'Server': 'Apache/2.2.15 (Red Hat)', 'X-Runtime': '2.308159', 'Connection': 'close', 'Cache-Control': 'no-cache', 'Date': 'Thu, 12 Oct 2017 11:08:50 GMT', 'Apipie-Checksum': 'c6ac1100323403f71f1ce3a3b7d73aa0', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Type': 'application/json; charset=utf-8', 'Foreman_api_version': '2', 'Content-Encoding': 'gzip'} code = 500 reason = Internal Server Error --------- data received ------------ { "error": {"message":"Cannot run VM because the VM is in Powering Down status."} } ------------------------------------ ####################################