Project

General

Profile

Actions

Bug #33270

closed

libvirt VMs showing "unknown power state" and no Console access

Added by Ian Shore almost 3 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

After upgrading from Foreman 2.3 to 2.4.1, all VMs managed by libvirt are showing "unknown power state". The button for Console access has also gone missing.

Foreman log indicates an issue with an undefined method:

Backtrace for 'undefined method `allocation' for nil:NilClass' error (ActionView::Template::Error): undefined method `allocation' for nil:NilClass
4ccdca18 | /usr/share/foreman/app/views/compute_resources_vms/show/_libvirt.html.erb:46:in `block in app_views_compute_resources_vms_show_libvirt_html_erb___1095817749888559541_69835413092660'

Also if I select a VM by going to Compute Resources and selecting the VM after selecting its host, I am greeted with the message:

Oops, we're sorry but something went wrong undefined method `allocation' for nil:NilClass

I attach the foreman-rake errors:fetch_log for that here.


Files

62f033ad.txt 62f033ad.txt 19.5 KB foreman-rake errors:fetch_log request_id=62f033ad Ian Shore, 08/17/2021 10:57 AM
production.log.txt production.log.txt 123 KB production log Ian Shore, 08/18/2021 12:46 PM
test1.xml.txt test1.xml.txt 4.83 KB Ian Shore, 08/18/2021 01:45 PM
Actions #1

Updated by Lukas Zapletal almost 3 years ago

  • Category set to Compute resources - libvirt
  • Triaged changed from No to Yes

Looks like a regression on fog-libvirt between 0.7 and 0.8 or newer:

https://github.com/fog/fog-libvirt/commits/master?after=b6a6161583b81bac4c1fd4b822305c369ba82e78+34&branch=master

I have a suspicion on https://github.com/fog/fog-libvirt/pull/75

Can you show me the full backtrace? You can reach me as lzap on our IRC.

Actions #2

Updated by Lukas Zapletal almost 3 years ago

I see the attachment now, well it did not help. Not sure what is wrong at the moment.

Actions #3

Updated by Ian Shore almost 3 years ago

I set debug logging on, restarted httpd, then viewed a VM from the Hosts page. I attach the resulting log file, and hope it is of some use.

Actions #4

Updated by Lukas Zapletal almost 3 years ago

Thanks, but the root cause is buried down the stack somewhere in the fog/fog-libvirt library. Libvirt call "volumes" returns list of associated data volumes but it appears to return an array with nil value in it.

Can you tell me how do I reproduce this bug? What's special about these VMs that libvirt fog library returns nil? Can you share libvirt XML of the VM that triggers the error?

Actions #5

Updated by Ian Shore over 2 years ago

All the VM hosts display the same "Unknown power state" message. We have 7 VM servers and 25 VMs, built on iSCSi LUNs managed by a NetApp server. I attach the XML dump from the VM mentioned in the previous log file.

Thanks for your help in this.

Actions #6

Updated by Lukas Zapletal over 2 years ago

  • Status changed from New to Rejected

I have some bad news for you, for-libvirt only supports file-based storage domain (the default one - directory with files). I am not sure how you created this VM, but this could not be through Foreman/fog library.

I filed a patch into the library to skip volumes which are not file-based to prevent the nil pointer exception, but that's all I can do for you.

https://github.com/fog/fog-libvirt/pull/105

Actions #7

Updated by Ian Shore over 2 years ago

Okay, thanks. I'll give it a try tomorrow. Most of the VMs were built before we ever started using Foreman, and we continue to build them the same way, outside of Foreman.

Actions

Also available in: Atom PDF