Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When trying see the VMs from Virtual Machines tab of a Vmware Compute Resource, It shows "500 Internal Server" error.
Version-Release number of selected component (if applicable):
Satellite 6.7 and above
How reproducible:
Under specific circumstances i.e when the value of instanceUuid of any VM in the concerned datacenter is set to ''
Steps to Reproduce:
1. Have a VM created in vCenter in a way that it's config.uuid and config.instanceUuid looks like below.
name = '/vmfs/volumes/60d169e5-cbe0d537-c0b3-94f128c38630/sandbox02/sandbox02.vmx',
guestFullName = 'Other (32-bit)',
version = 'vmx-13',
uuid = '',
instanceUuid = '',
2. Create a VMware Compute Resource in Satellite for that Datacenter where above VM resides.
3. Go to UI --> Infrastructure --> Compute Resources --> Click open the compute resource and go to the Virtual Machines tab
Actual results:
At Step 3: We can see 500 Internal Server error.
Rails debug shows following traceback in production.log
2021-08-10T16:33:16 [W|app|ea1023d4] Action failed
2021-08-10T16:33:16 [D|app|ea1023d4] Backtrace for 'Action failed' error (ActionView::Template::Error): No route matches {:action=>"show", :compute_resource_id=>#<Foreman::Model::Vmware id: 3, name: "sma7301", description: "", url: "myvcenter.example.com", user: "example\\svc-mis-satellite-ah", password: "encrypted-c0p0Wlc1cGV4MU1EdEJCWFhDdkcrcVpsRnRiTUxX...", uuid: "FR-MAR", type: "Foreman::Model::Vmware", created_at: "2019-01-14 10:56:15", updated_at: "2021-08-10 12:57:45", attrs: {:setpw=>1, :pubkey_hash=>"50addbd601d3dd8dff7e47608f4a84dbf0f2927bbc094bb27119e536fcf2f637", :display=>"vmrc"}, email: nil, caching_enabled: false, domain: nil, http_proxy_id: nil>, :controller=>"compute_resources_vms", :id=>""},
possible unmatched constraints: [:id]
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/formatter.rb:57:in `generate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:744:in `generate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:775:in `generate'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:822:in `url_for'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/url_for.rb:179:in `full_url_for'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/url_for.rb:169:in `url_for'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/routing_url_for.rb:91:in `url_for'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/turbolinks-2.5.4/lib/turbolinks/xhr_url_for.rb:19:in `url_for'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/helpers/url_helper.rb:202:in `link_to'
/usr/share/foreman/app/helpers/application_helper.rb:101:in `link_to_if_authorized'
/usr/share/foreman/app/views/compute_resources_vms/index/_vmware.html.erb:15:in `block in _65d7c00e9bb905a55a6f934bc60b7e1d'
/usr/share/foreman/app/views/compute_resources_vms/index/_vmware.html.erb:13:in `each'
/usr/share/foreman/app/views/compute_resources_vms/index/_vmware.html.erb:13:in `_65d7c00e9bb905a55a6f934bc60b7e1d'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:159:in `block in render'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:354:in `instrument_render_template'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:157:in `render'
/opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.5.3/lib/deface/action_view_extensions.rb:43:in `render'
Expected results:
The satellite should be able to bypass the problematic VMs and then provide us with the list of good VMs utilizing the compute resource connectivity.
Additional info:
Following is the code we have.
# grep 'vms =' /usr/share/foreman/app/services/fog_extensions/vsphere/mini_servers.rb
vms = results.select { |result| result.obj.is_a?(RbVmomi::VIM::VirtualMachine) && result['config.template'] == templates && !result['config.instanceUuid'].nil? }
Based on discussion with the RH Engineering team, we needed to change it to look like below followed by a restart of satellite services and that fixed the issue.
# grep 'vms =' /usr/share/foreman/app/services/fog_extensions/vsphere/mini_servers.rb
vms = results.select { |result| result.obj.is_a?(RbVmomi::VIM::VirtualMachine) && result['config.template'] == templates && result['config.instanceUuid'].present? }
Comment 8Lukáš Hellebrandt
2021-10-12 15:03:32 UTC
I was unable to obtain a reproducer. After consulting with people involved, it seems like we don't know how to create a VM without a UUID. Our VMWare instances fill random UUID even after attempts to hack empty uuid directly into the configuration text files. We also don't have any instance with reproducer already prepared.
Therefore, verified sanity-only with sat 6.10.0 snap 21.0.
VMWare CR can be added, seems to work, compute profile for that CR can be created, host can be created on that CR, VMs can be listed (including those we attempted do remove the uuid from, as opposed to hypothetical VMs that actually don't have any uuid - those should not be listed).
Code inspection shows that the fix is indeed present in app/services/fog_extensions/vsphere/mini_servers.rb on line 22.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2021:4702
Description of problem: When trying see the VMs from Virtual Machines tab of a Vmware Compute Resource, It shows "500 Internal Server" error. Version-Release number of selected component (if applicable): Satellite 6.7 and above How reproducible: Under specific circumstances i.e when the value of instanceUuid of any VM in the concerned datacenter is set to '' Steps to Reproduce: 1. Have a VM created in vCenter in a way that it's config.uuid and config.instanceUuid looks like below. name = '/vmfs/volumes/60d169e5-cbe0d537-c0b3-94f128c38630/sandbox02/sandbox02.vmx', guestFullName = 'Other (32-bit)', version = 'vmx-13', uuid = '', instanceUuid = '', 2. Create a VMware Compute Resource in Satellite for that Datacenter where above VM resides. 3. Go to UI --> Infrastructure --> Compute Resources --> Click open the compute resource and go to the Virtual Machines tab Actual results: At Step 3: We can see 500 Internal Server error. Rails debug shows following traceback in production.log 2021-08-10T16:33:16 [W|app|ea1023d4] Action failed 2021-08-10T16:33:16 [D|app|ea1023d4] Backtrace for 'Action failed' error (ActionView::Template::Error): No route matches {:action=>"show", :compute_resource_id=>#<Foreman::Model::Vmware id: 3, name: "sma7301", description: "", url: "myvcenter.example.com", user: "example\\svc-mis-satellite-ah", password: "encrypted-c0p0Wlc1cGV4MU1EdEJCWFhDdkcrcVpsRnRiTUxX...", uuid: "FR-MAR", type: "Foreman::Model::Vmware", created_at: "2019-01-14 10:56:15", updated_at: "2021-08-10 12:57:45", attrs: {:setpw=>1, :pubkey_hash=>"50addbd601d3dd8dff7e47608f4a84dbf0f2927bbc094bb27119e536fcf2f637", :display=>"vmrc"}, email: nil, caching_enabled: false, domain: nil, http_proxy_id: nil>, :controller=>"compute_resources_vms", :id=>""}, possible unmatched constraints: [:id] /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/formatter.rb:57:in `generate' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:744:in `generate' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:775:in `generate' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:822:in `url_for' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/url_for.rb:179:in `full_url_for' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/url_for.rb:169:in `url_for' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/routing_url_for.rb:91:in `url_for' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/turbolinks-2.5.4/lib/turbolinks/xhr_url_for.rb:19:in `url_for' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/helpers/url_helper.rb:202:in `link_to' /usr/share/foreman/app/helpers/application_helper.rb:101:in `link_to_if_authorized' /usr/share/foreman/app/views/compute_resources_vms/index/_vmware.html.erb:15:in `block in _65d7c00e9bb905a55a6f934bc60b7e1d' /usr/share/foreman/app/views/compute_resources_vms/index/_vmware.html.erb:13:in `each' /usr/share/foreman/app/views/compute_resources_vms/index/_vmware.html.erb:13:in `_65d7c00e9bb905a55a6f934bc60b7e1d' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:159:in `block in render' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:170:in `instrument' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:354:in `instrument_render_template' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/template.rb:157:in `render' /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.5.3/lib/deface/action_view_extensions.rb:43:in `render' Expected results: The satellite should be able to bypass the problematic VMs and then provide us with the list of good VMs utilizing the compute resource connectivity. Additional info: Following is the code we have. # grep 'vms =' /usr/share/foreman/app/services/fog_extensions/vsphere/mini_servers.rb vms = results.select { |result| result.obj.is_a?(RbVmomi::VIM::VirtualMachine) && result['config.template'] == templates && !result['config.instanceUuid'].nil? } Based on discussion with the RH Engineering team, we needed to change it to look like below followed by a restart of satellite services and that fixed the issue. # grep 'vms =' /usr/share/foreman/app/services/fog_extensions/vsphere/mini_servers.rb vms = results.select { |result| result.obj.is_a?(RbVmomi::VIM::VirtualMachine) && result['config.template'] == templates && result['config.instanceUuid'].present? }