Bug #1640
Oops when viewing a Libvirt VM where the Libvirt host has no "default" storage volume
| Status: | Need more information | Start: | 05/19/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Backlog: | No | Difficulity: | ||
| Votes: | 0 |
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.
History
Updated by Andreas Ntaflos about 1 year 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 12 months 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 12 months 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?
