Bug #32792
closedCompute profile references wrong datacenter path after changing datacenter name
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1946120
When changing the name of the datacenter compute profiles still reference the old path, seen in the api here:
Result of GET https://foreman.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://foreman.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, it is anoying anyway.