Power button not working for libvirt guests

Problem:

When attempting to power off a virtual guest from the given guest dashboard in Foreman UI, the following error appears in red in the upper right:

“Failed to stop myhost.example.net: uninitialized constant Fog::Compute::Ovirt”

Expected outcome:

We should be able to power on / off guests.

Foreman and Proxy versions:

1.17 on both

Foreman and Proxy plugin versions:

Foreman:

foreman_bootdisk Plugin for Foreman that creates iPXE-based boot disks to provision hosts without the need for PXE infrastructure. Dominic Cleal 11.0.0
foreman_discovery MaaS Discovery Plugin engine for Foreman alongoldboim, Alon Goldboim, amirfefer, Amit Karsale, Amos Benari, Bryan Kearney, Daniel Lobato, Daniel Lobato Garcia, Daniel Lobato García, David Davis, Dominic Cleal, Eric D. Helms, Ewoud Kohl van Wijngaarden, Frank Wall, Greg Sutcliffe, ChairmanTubeAmp, imriz, Imri Zvik, Joseph Mitchell Magen, June Zhang, Lars Berntzon, Lukas Zapletal, Lukáš Zapletal, Marek Hulan, Marek Hulán, Martin Bačovský, Matt Jarvis, Michael Moll, Nick, Ohad Levy, Ondrej Prazak, Ori Rabin, orrabin, Partha Aji, Petr Chalupa, Phirince Philip, Rahul Bajaj, Robert Antoni Buj Gelonch, Scubafloyd, Sean O’Keeffe, Sebastian Gräßl, Shimon Shtein, Shlomi Zadok, Stephen Benjamin, Swapnil Abnave, Timo Goebel, Tom Caspy, Tomer Brisker, and Yann Cézard 11.0.0
foreman_snapshot_management Foreman-plugin to manage snapshots in a vSphere environment. ATIX AG 1.3.0
foreman_templates Engine to synchronise provisioning templates from GitHub Greg Sutcliffe 5.0.1
foreman_vmwareannotations This plug-in copies the host comment to VMWare annotations in The Foreman. Timo Goebel 0.0.1

Proxy:
rubygem-smart_proxy_discovery-1.0.4-1.el7.noarch
rubygem-smart_proxy_dhcp_infoblox-0.0.13-1.fm1_17.el7.noarch

Other relevant data:

The following log was taken from the Foreman master during the time the button is pressed:

2018-05-17 18:15:38 6d8a6b02 [app] [I] Started GET "/notification_recipients" for 10.1.1.144 at 2018-05-17 18:15:38 +0000
2018-05-17 18:15:38 6d8a6b02 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-05-17 18:15:38 6d8a6b02 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:38 6d8a6b02 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:38 6d8a6b02 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:38 6d8a6b02 [notifications] [D] Cache Hit: notification, reading cache for notification-4
2018-05-17 18:15:38 6d8a6b02 [app] [D] Body: {"notifications":[{"id":47,"seen":false,"level":"info","text":"myhost.example.net has been deleted successfully","created_at":"2018-05-16T19:55:10.000Z","group":"Hosts","actions":{}}]}
2018-05-17 18:15:38 6d8a6b02 [app] [I] Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 0.3ms)
2018-05-17 18:15:40 faaef1ae [app] [I] Started PUT "/hosts/myhost.example.net/power?power_action=stop" for 10.1.1.144 at 2018-05-17 18:15:40 +0000
2018-05-17 18:15:40 faaef1ae [app] [I] Processing by HostsController#power as HTML
2018-05-17 18:15:40 faaef1ae [app] [I]   Parameters: {"authenticity_token"=>"j4IX7Hky4q868lAmFP7gRjo7pHmYJJog8AF49cs0Xs2Z7aqK9trSGV42ZZZFgCepWim9f47Rw6lVs9yJHZSYmg==", "power_action"=>"stop", "id"=>"myhost.example.net"}
2018-05-17 18:15:40 faaef1ae [app] [I] Current user: admin (administrator)
2018-05-17 18:15:40 faaef1ae [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:40 faaef1ae [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:41 a562daeb [app] [I] Started GET "/notification_recipients" for 10.1.1.144 at 2018-05-17 18:15:41 +0000
2018-05-17 18:15:41 a562daeb [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-05-17 18:15:41 a562daeb [app] [I] Current user: admin (administrator)
2018-05-17 18:15:41 a562daeb [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:41 a562daeb [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:41 a562daeb [notifications] [D] Cache Hit: notification, reading cache for notification-4
2018-05-17 18:15:41 a562daeb [app] [D] Body: {"notifications":[{"id":47,"seen":false,"level":"info","text":"myhost.example.net has been deleted successfully","created_at":"2018-05-16T19:55:10.000Z","group":"Hosts","actions":{}}]}
2018-05-17 18:15:41 a562daeb [app] [I] Completed 200 OK in 6ms (Views: 0.3ms | ActiveRecord: 0.2ms)
2018-05-17 18:15:41 faaef1ae [app] [I] Failed to save: 
2018-05-17 18:15:41 faaef1ae [app] [I] Redirected to https://foreman-master.example.net/hosts/myhost.example.net
2018-05-17 18:15:41 faaef1ae [app] [I] Completed 302 Found in 1326ms (ActiveRecord: 1.2ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I] Started GET "/hosts/myhost.example.net" for 10.1.1.144 at 2018-05-17 18:15:41 +0000
2018-05-17 18:15:41 1c02e6f8 [app] [I] Processing by HostsController#show as HTML
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Parameters: {"id"=>"myhost.example.net"}
2018-05-17 18:15:41 1c02e6f8 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:41 1c02e6f8 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:41 1c02e6f8 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendering hosts/show.html.erb within layouts/application
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered hosts/show.html.erb within layouts/application (41.7ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered layouts/_application_content.html.erb (0.6ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendering layouts/base.html.erb
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_location_dropdown.html.erb (3.4ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_org_switcher.html.erb (4.0ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_user_dropdown.html.erb (1.8ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_topbar.html.erb (6.9ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_menu.html.erb (2.5ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_menu.html.erb (3.3ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_menu.html.erb (2.7ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_menu.html.erb (2.5ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_menu.html.erb (3.0ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_taxonomies.html.erb (3.1ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_vertical_menu.html.erb (1.1ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered home/_navbar.html.erb (21.6ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I]   Rendered layouts/base.html.erb (32.6ms)
2018-05-17 18:15:41 1c02e6f8 [app] [I] Completed 200 OK in 93ms (Views: 73.3ms | ActiveRecord: 5.3ms)
2018-05-17 18:15:42 094e3801 [app] [I] Started GET "/notification_recipients" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 094e3801 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-05-17 18:15:42 094e3801 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 094e3801 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 094e3801 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 094e3801 [notifications] [D] Cache Hit: notification, reading cache for notification-4
2018-05-17 18:15:42 094e3801 [app] [D] Body: {"notifications":[{"id":47,"seen":false,"level":"info","text":"myhost.example.net has been deleted successfully","created_at":"2018-05-16T19:55:10.000Z","group":"Hosts","actions":{}}]}
2018-05-17 18:15:42 094e3801 [app] [I] Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.3ms)
2018-05-17 18:15:42 b78ab3a2 [app] [I] Started GET "/hosts/myhost.example.net/overview" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 b78ab3a2 [app] [I] Processing by HostsController#overview as HTML
2018-05-17 18:15:42 b78ab3a2 [app] [I]   Parameters: {"id"=>"myhost.example.net"}
2018-05-17 18:15:42 b78ab3a2 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 b78ab3a2 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 b78ab3a2 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 b78ab3a2 [app] [I]   Rendered hosts/_overview.html.erb (30.0ms)
2018-05-17 18:15:42 b78ab3a2 [app] [I] Completed 200 OK in 43ms (Views: 28.4ms | ActiveRecord: 3.2ms)
2018-05-17 18:15:42 6d30e6c4 [app] [I] Started GET "/hosts/myhost.example.net/templates" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 6d30e6c4 [app] [I] Processing by HostsController#templates as HTML
2018-05-17 18:15:42 6d30e6c4 [app] [I]   Parameters: {"id"=>"myhost.example.net"}
2018-05-17 18:15:42 fe738b65 [app] [I] Started GET "/hosts/myhost.example.net/vm" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 6d30e6c4 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 fe738b65 [app] [I] Processing by HostsController#vm as HTML
2018-05-17 18:15:42 fe738b65 [app] [I]   Parameters: {"id"=>"myhost.example.net"}
2018-05-17 18:15:42 fe738b65 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 fe738b65 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 f5a90a0b [app] [I] Started GET "/hosts/myhost.example.net/runtime?range=7" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 fe738b65 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 f5a90a0b [app] [I] Processing by HostsController#runtime as HTML
2018-05-17 18:15:42 f5a90a0b [app] [I]   Parameters: {"range"=>"7", "id"=>"myhost.example.net"}
2018-05-17 18:15:42 9f33c6df [app] [I] Started GET "/hosts/myhost.example.net/resources?range=7" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 f5a90a0b [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 f5a90a0b [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 c2e08de5 [app] [I] Started GET "/hosts/myhost.example.net/nics" for 10.1.1.144 at 2018-05-17 18:15:42 +0000
2018-05-17 18:15:42 f5a90a0b [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 c2e08de5 [app] [I] Processing by HostsController#nics as HTML
2018-05-17 18:15:42 c2e08de5 [app] [I]   Parameters: {"id"=>"myhost.example.net"}
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 9f33c6df [app] [I] Processing by HostsController#resources as HTML
2018-05-17 18:15:42 9f33c6df [app] [I]   Parameters: {"range"=>"7", "id"=>"myhost.example.net"}
2018-05-17 18:15:42 c2e08de5 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 c2e08de5 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 c2e08de5 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 9f33c6df [app] [I] Current user: admin (administrator)
2018-05-17 18:15:42 9f33c6df [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:42 9f33c6df [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 f5a90a0b [app] [I]   Rendered hosts/_runtime.html.erb (7.0ms)
2018-05-17 18:15:42 f5a90a0b [app] [I] Completed 200 OK in 26ms (Views: 2.8ms | ActiveRecord: 14.1ms)
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 9f33c6df [app] [I]   Rendered hosts/_resources.html.erb (13.6ms)
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 9f33c6df [app] [I] Completed 200 OK in 84ms (Views: 6.7ms | ActiveRecord: 38.4ms)
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to nj02
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [D] Setting current organization thread-local variable to none
2018-05-17 18:15:42 6d30e6c4 [app] [I]   Rendered hosts/_templates.html.erb (2.7ms)
2018-05-17 18:15:42 6d30e6c4 [app] [I] Completed 200 OK in 153ms (Views: 2.9ms | ActiveRecord: 32.7ms)
2018-05-17 18:15:42 c2e08de5 [app] [I]   Rendered hosts/_nics.html.erb (158.1ms)
2018-05-17 18:15:42 c2e08de5 [app] [I] Completed 200 OK in 203ms (Views: 149.2ms | ActiveRecord: 44.3ms)
2018-05-17 18:15:43 fe738b65 [app] [I]   Rendered compute_resources_vms/show/_libvirt.html.erb (416.4ms)
2018-05-17 18:15:43 fe738b65 [app] [I]   Rendered compute_resources_vms/_details.html.erb (418.4ms)
2018-05-17 18:15:43 fe738b65 [app] [I] Completed 200 OK in 1094ms (Views: 419.3ms | ActiveRecord: 54.3ms)
2018-05-17 18:15:51 78d004d7 [app] [I] Started GET "/notification_recipients" for 10.1.1.144 at 2018-05-17 18:15:51 +0000
2018-05-17 18:15:51 78d004d7 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-05-17 18:15:51 78d004d7 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:51 78d004d7 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:51 78d004d7 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:51 78d004d7 [notifications] [D] Cache Hit: notification, reading cache for notification-4
2018-05-17 18:15:51 78d004d7 [app] [D] Body: {"notifications":[{"id":47,"seen":false,"level":"info","text":"myhost.example.net has been deleted successfully","created_at":"2018-05-16T19:55:10.000Z","group":"Hosts","actions":{}}]}
2018-05-17 18:15:51 78d004d7 [app] [I] Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.3ms)
2018-05-17 18:15:52 c51704b9 [app] [I] Started GET "/notification_recipients" for 10.1.1.144 at 2018-05-17 18:15:52 +0000
2018-05-17 18:15:52 c51704b9 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-05-17 18:15:52 c51704b9 [app] [I] Current user: admin (administrator)
2018-05-17 18:15:52 c51704b9 [app] [D] Setting current user thread-local variable to admin
2018-05-17 18:15:52 c51704b9 [app] [D] Setting current location thread-local variable to none
2018-05-17 18:15:52 c51704b9 [notifications] [D] Cache Hit: notification, reading cache for notification-4
2018-05-17 18:15:52 c51704b9 [app] [D] Body: {"notifications":[{"id":47,"seen":false,"level":"info","text":"myhost.example.net has been deleted successfully","created_at":"2018-05-16T19:55:10.000Z","group":"Hosts","actions":{}}]}
2018-05-17 18:15:52 c51704b9 [app] [I] Completed 200 OK in 6ms (Views: 0.1ms | ActiveRecord: 0.2ms)

This sounds like Bug #23212: Changing power state gives: NameError: uninitialized constant Fog::Compute::Ovirt - Foreman which will be fixed in 1.17.1, that will be released in the next few days.
You can manually apply the patch and restart foreman if you wish, or install the foreman-ovirt package as a workaround.

Thanks I’m surprised I missed that