Bug 1994945
Summary: | hammer cannot use the cluster name or id as valid input when clusters are residing inside folders and fails with error Fog::Vsphere::Compute::NotFound error | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sayan Das <saydas> | |
Component: | Compute Resources - VMWare | Assignee: | Chris Roberts <chrobert> | |
Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 6.9.0 | CC: | ahumbe, arahaman, bbuckingham, chrobert, mhulan, mmitschk, ncho, osousa, pcreech, pmendezh, satellite6-bugs | |
Target Milestone: | 6.12.0 | Keywords: | PrioBumpGSS, Triaged | |
Target Release: | Unused | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 2131761 (view as bug list) | Environment: | ||
Last Closed: | 2022-11-16 13:32:46 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
Sayan Das
2021-08-18 08:29:16 UTC
NOTE: I have queried cluster details from vCenter inside the foreman-rake console and I got the following details. <Fog::Vsphere::Compute::Cluster id="domain-c1694", name="OT_Non_Oracle_HA", datacenter="TC", num_host=6, num_cpu_cores=216, overall_status="green", full_path="OT_Non-Oracle/OT_Non_Oracle_HA" >] <Fog::Vsphere::Compute::Cluster id="domain-c208", name="OT_Oracle_HA", datacenter="TC", num_host=4, num_cpu_cores=144, overall_status="green", full_path="OT_Oracle/OT_Oracle_HA" >, Looks like, UI can detect and work with id and\or full_path but hammer CLI can't work with any of the id\name\full_path in this situation. So it could be related to https://bugzilla.redhat.com/show_bug.cgi?id=1993888 as well to some extent. // Update // It seems there was a small mistake done from my mine and customer's end. Full path that rake gave us for the cluster was "OT_Non-Oracle/OT_Non_Oracle_HA" But we were using "OT_Non_Oracle/OT_Non_Oracle_HA" So OT_Non_Oracle != OT_Non-Oracle I have informed that and that hopefully will let customer create the CP as well. Now, Hao++ was assisting and found out that even if "hammer compute-profile values create" command is accepting that Full Cluster PATH, the "hammer compute-resource resource-pools --cluster-id" is not accepting the same. In case of Folder/Cluster architecture, "hammer compute-resource resource-pools --cluster-id" accepts none of the values i.e. id or name or full_path hammer compute-resource resource-pools --cluster-id OT_Oracle_HA --id 1 Fog::Vsphere::Compute::NotFound hammer compute-resource resource-pools --cluster-id domain-c1694 --id 1 Fog::Vsphere::Compute::NotFound hammer compute-resource resource-pools --cluster-id "OT_Non-Oracle/OT_Non_Oracle_HA" --id 1 404 Not Found So suggestions is : 1. Always map the name attribute of cluster with full_path or 2. Add an additional parameter to be able to use Cluster Full Path One more definite recommendation is, following output should print a third column i.e. Full Path where full_path value of cluster will be present. # hammer compute-resource clusters --id 1 --------------|----------------------- ID | NAME --------------|----------------------- ... domain-c1694 | OT_Non_Oracle_HA domain-c208 | OT_Oracle_HA ... Completed issue #1 and enhanced hammer to show the following: -------------|-----------------------|----------------|-----------------|------------------ ID | NAME | FULL PATH | NUMBER OF HOSTS | STATUS OF CLUSTER -------------|-----------------------|----------------|-----------------|------------------ domain-c1235 | ABJ-LabCluster | RH_Engineering | 1 | green domain-c7 | Satellite-Engineering | RH_Engineering | 3 | green domain-c65 | vMotion-Cluster | RH_Engineering | 3 | green -------------|-----------------------|----------------|-----------------|------------------ With a datacenter inside of a folder like the customer has: --------------|----------------|-------------|-----------------|------------------ ID | NAME | FULL PATH | NUMBER OF HOSTS | STATUS OF CLUSTER --------------|----------------|-------------|-----------------|------------------ domain-c40243 | Folder-Cluster | CEE/test_dc | 0 | green --------------|----------------|-------------|-----------------|------------------ Will work on issue #2 tomorrow changed FULL PATH to be called DATACENTER PATH For reference this is what the old output looked like: -------------|---------------------- ID | NAME -------------|---------------------- domain-c1235 | ABJ-LabCluster domain-c7 | Satellite-Engineering domain-c65 | vMotion-Cluster -------------|---------------------- I was able to confirm resource pools works without a nested cluster: [vagrant@centos7-hammer-devel ~]$ hammer -d compute-resource resource-pools --id 2 --cluster-id "Satellite-Engineering" -----------|-----------|-----------------------|----------------|--------------- ID | NAME | CLUSTER | DATACENTER | OVERALL STATUS -----------|-----------|-----------------------|----------------|--------------- resgroup-8 | Resources | Satellite-Engineering | RH_Engineering | green -----------|-----------|-----------------------|----------------|--------------- But does not work with the nested such as how the bz was filed: hammer -d compute-resource resource-pools --id 1 --cluster-id "Test-Folder/Test-Cluster" Starting to work on this part now So we have narrowed down the issue to being an issue with Hammer sending off the / encoded as %2F but Apache is blocking / per: https://httpd.apache.org/docs/current/mod/core.html#allowencodedslashes Opening this up is a security concern for the project, so we have a patch that will unescape it and I am going to test that today. If that does not get approved I think we can apply that apache directive to the custom hiera file to have the installer add it to apache for you. My method would make it so you have to send in the cluster like this: hammer -d compute-resource resource-pools --id 1 --cluster-id "Test-Folder%2FTest-Cluster" With the apache directive turned on you would be able to send it as hammer -d compute-resource resource-pools --id 1 --cluster-id "Test-Folder/Test-Cluster" Will test on a non devel setup today to see if my change works and to test the hiera method as well I verified the patch works correctly now: hammer -d compute-profile values create --compute-profile-id 6 --compute-resource-id 6 '--compute-attributes={"cpus":2,"corespersocket":2,"memory_mb":4096,"firmware":"efi","resource_pool":"Resources","cluster":"Test-Folder/Test-Cluster","guest_id":"rhel8_64Guest","path":"/Datacenters/Toledo-Test/vm","hardware_version":"Default","memoryHotAddEnabled":0,"cpuHotAddEnabled":0,"add_cdrom":0,"boot_order":["disk","network"],"scsi_controllers":[{"type":"ParaVirtualSCSIController","key":1000},{"type":"ParaVirtualSCSIController","key":1001}]}' Compute profile attributes are set. So with compute profile we can pass in folder/cluster but with clusters we still need to pass in %2F because of Apache. Will push up PR's and link them up to the BZ Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35438 has been resolved. Moving to POST, the Foreman PR got built into the snap but we now need the hammer PR built into the snap. https://github.com/theforeman/hammer-cli-foreman/pull/604 *** Bug 1993888 has been marked as a duplicate of this bug. *** Verified with Sat 6.12 snap 13.0. For vSphere versions 6 and 7, followed the instructions from OP + succesfully created hosts using the compute profiles. No related traceback. $ hammer compute-profile values create --compute-profile-id 2 --compute-resource-id 5 '--compute-attributes={"cpus":4,"corespersocket":2,"memory_mb":4096,"firmware":"efi","resource_pool":"Resources","cluster":"lhellebr-clusterfolder-willdelsoon/Satellite-Engineering","guest_id":"rhel8_64Guest","path":"/Datacenters/RH_Engineering/vm/","hardware_version":"Default","memoryHotAddEnabled":0,"cpuHotAddEnabled":0,"add_cdrom":0,"boot_order":["disk","network"],"scsi_controllers":[{"type":"ParaVirtualSCSIController","key":1000},{"type":"ParaVirtualSCSIController","key":1001}]}' Compute profile attributes are set. 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 (Important: Satellite 6.12 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-2022:8506 |