Bug 1946120

Summary: Compute profile references wrong datacenter path after changing datacenter name
Product: Red Hat Satellite Reporter: Paul Dudley <pdudley>
Component: Compute Resources - VMWareAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8.0CC: ahumbe, chrobert, lstejska, mhulan, oezr, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-22 07:43:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paul Dudley 2021-04-04 19:51:14 UTC
When changing the name of the datacenter compute profiles still reference the old path, seen in the api here:

Result of  GET https://satellite.example.com/api/v2/compute_resources
description            : 
url                    : vCenter.example.com
id                     : 4
name                   : vCenter_Name
provider               : Vmware
provider_friendly_name : VMware
user                   : vcenter_login
datacenter             : 
server                 : vcenter.server.example.com
set_console_password   : True
caching_enabled        : True

But the compute profiles associated with the updated compute resource are still using the old datacenter path of /Datacenters/<old name>/vm (which no longer exists):
From GET https://satellite.example.com/api/v2/compute_profiles/6
id                     : 12
name                   : 2 CPUs and 2048 MB memory
compute_resource_id    : 4
compute_resource_name  : vCenter
provider_friendly_name : VMware
compute_profile_id     : 6
compute_profile_name   : Base OS
vm_attrs               : @{cpus=2; corespersocket=1; memory_mb=2048; firmware=bios; cluster=i-linux-cluster01; resource_pool=Resources; path=/Datacenters/<old name>/vm; guest_id=rhel7_64Guest; scsi_controller_type=ParaVirtualSCSIController; hardware_version=Default; 
                         memoryHotAddEnabled=0; cpuHotAddEnabled=0; add_cdrom=0; annotation=; interfaces_attributes=; volumes_attributes=}

Correcting the resource only requires editing the profile and submitting the profile again and the path is fixed, no direct changes are necessary.


Related to bug 1440711

Comment 2 Ondřej Ezr 2021-06-12 14:30:53 UTC
Created redmine issue https://projects.theforeman.org/issues/32792 from this bug

Comment 3 Bryan Kearney 2021-06-27 12:02:11 UTC
Upstream bug assigned to ymakias

Comment 4 Bryan Kearney 2021-08-06 12:04:59 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32792 has been resolved.

Comment 7 Lukáš Hellebrandt 2021-10-08 11:23:34 UTC
FailedQA with Sat 6.10.0 snap 21.0, no change in behavior noticed as compared to OP. I can, however, confirm that the code changes are present in /usr/share/foreman/app/controllers/api/v2/compute_resources_controller.rb and /usr/share/foreman/app/models/compute_resource.rb.

Comment 10 Leos Stejskal 2024-04-22 07:43:10 UTC
Closing the BZ as per the https://bugzilla.redhat.com/show_bug.cgi?id=1946120#c8