Bug #1640
openOops when viewing a Libvirt VM where the Libvirt host has no "default" storage volume
Description
The following error occurs when trying to view a VM on a Libvirt host that does not have a "default" storage pool:
ArgumentError Initialization parameters must be an attributes hash, got nil app/views/compute_resources/vms/show/_libvirt.html.erb:42:in `_app_views_compute_resources_vms_show__libvirt_html_erb__687762671_70269412929760_809790' app/views/compute_resources/vms/show.html.erb:1:in `_app_views_compute_resources_vms_show_html_erb__620887415_70269412946320_0' app/controllers/compute_resources/vms_controller.rb:26:in `show'
The Libvirt host has various storage pools, sich as a LVM volume group called "virthosts" or a filesystem directory called "cd_images", but no "default" storage pool. Using Libvirt 0.9.8 on Ubuntu 12.04, Foreman 0.5-nightly-ba71c565.
This seems related to the fact that Foreman seems to think every VM's disk is based off the "default" storage pool, even when it is not.
In our environment, all VMs have their volumes in a "virthost" LVM-based storage pool, not in the "default" storage pool. Nonetheless, for a given VM, Foreman says this about the VM's disk: "using 1G GB out of 10G GB (default storage pool - )". Foreman also seems to think that all disks are 10GB in size, even when they are not. I recall a similar problem in Foreman 0.4.2.
Updated by Andreas Ntaflos almost 13 years ago
Another consequence of a missing "default" storage pool seems to be that, when creating a new host in Foreman as a Virtual Machine, the "Virtual Machine" page/tab remains completely empty. In Foreman's production.log there appears a similar error message as above:
Started POST "/hosts/compute_resource_selected" for 10.216.236.2 at Sun May 20 00:56:12 +0200 2012 Processing by HostsController#compute_resource_selected as Parameters: {"compute_resource_id"=>"2"} Rendered hosts/_compute.html.erb (1.1ms) Operation FAILED: Initialization parameters must be an attributes hash, got nil Rendered common/500.rhtml (2.6ms) Completed 500 Internal Server Error in 11ms (Views: 3.0ms | ActiveRecord: 0.0ms)
Updated by Ohad Levy almost 13 years ago
- Status changed from New to Ready For Testing
I've pushed an update to the fog library, could you please try to execute
bundle update
and see if it still occurs ?
thanks
Updated by Andreas Ntaflos almost 13 years ago
Ohad, thanks, this seems to have fixed that particular issue. I can now view virtual machines of a Libvirt compute resource that does not have a "default" storage pool. However, this only works for VMs which were created as "Bare Metal" through Foreman (and defined via virt-manager/virsh on the virtualisation host). Trying to view virtual machines that were created entirely through Foreman, as "Virtual Machine", results in this error:
NoMethodError undefined method `[]' for nil:NilClass app/views/compute_resources/vms/show/_libvirt.html.erb:42:in `_app_views_compute_resources_vms_show__libvirt_html_erb___970148999_70189147447460_810270' app/views/compute_resources/vms/show.html.erb:1:in `_app_views_compute_resources_vms_show_html_erb___188722847_70189147457960_0' app/controllers/compute_resources/vms_controller.rb:26:in `show'
I wonder if this is related to issue #1639?
Updated by Ohad Levy almost 13 years ago
- Status changed from Ready For Testing to Need more information
can you check if this still happens with latest fog version? (change your bundler.d/fog to use the git version instead of the gem and run bundle update)
Updated by Will Foster over 9 years ago
Ohad Levy wrote:
can you check if this still happens with latest fog version? (change your bundler.d/fog to use the git version instead of the gem and run bundle update)
I know this report is a bit old but we're seeing this on 1.8.4 and ruby193-rubygem-fog-1.29.0-1.el6.noarch (EL6) as well when adding an EL7.1 Libvirt compute resource:
--snip--
2015-11-02 14:55:28 [I] Rendered nic/_base_form.html.erb (29.3ms)
2015-11-02 14:55:28 [I] Rendered hosts/_compute.html.erb (35.7ms)
2015-11-02 14:55:28 [W] Operation FAILED: No storage pools are defined
2015-11-02 14:55:28 [I] Rendered nic/_virtual_form.html.erb (2.4ms)
2015-11-02 14:55:28 [I] Rendered common/500.html.erb (11.3ms)
2015-11-02 14:55:28 [I] Completed 500 Internal Server Error in 67ms (Views: 14.9ms | ActiveRecord: 0.1ms)
2015-11-02 14:55:28 [I] Rendered compute_resources_vms/form/libvirt/_network.html.erb (36.2ms)
2015-11-02 14:55:28 [I] Rendered nic/_provider_specific_form.html.erb (38.2ms)
2015-11-02 14:55:28 [I] Rendered nic/manageds/_managed.html.erb (73.8ms)
2015-11-02 14:55:28 [I] Rendered nic/_base_form.html.erb (22.5ms)
2015-11-02 14:55:28 [I] Rendered nic/_virtual_form.html.erb (2.3ms)
2015-11-02 14:55:28 [I] Rendered compute_resources_vms/form/libvirt/_network.html.erb (31.7ms)
2015-11-02 14:55:28 [I] Rendered nic/_provider_specific_form.html.erb (32.9ms)
2015-11-02 14:55:28 [I] Rendered nic/manageds/_managed.html.erb (61.0ms)
2015-11-02 14:55:28 [I] Rendered hosts/_interfaces.html.erb (139.2ms)
2015-11-02 14:55:28 [I] Rendered hosts/_interfaces_tab.html.erb (140.0ms)
2015-11-02 14:55:28 [I] Completed 200 OK in 165ms (Views: 140.3ms | ActiveRecord: 2.1ms)
--snip--
Updated by Dominic Cleal over 9 years ago
- Description updated (diff)
- Category set to Compute resources - libvirt
- Status changed from Need more information to New