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.
Bug 1620179 - no way to list cluster IDs inside compute resource
Summary: no way to list cluster IDs inside compute resource
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.3.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.5.0
Assignee: Andrew Kofink
QA Contact: Sanket Jagtap
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-22 15:31 UTC by John Berninger
Modified: 2019-11-05 22:31 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:37:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24747 0 None None None 2018-08-29 20:02:52 UTC
Github theforeman hammer-cli-foreman pull 383 0 None None None 2018-08-29 20:02:31 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:37:57 UTC

Description John Berninger 2018-08-22 15:31:05 UTC
Description of problem:
A VMware type compute resource can have multiple clusters defined within it (defined by VMware). Full use of the `hammer` command for provisioning requires we specify a cluster ID to deploy to. There is no way to currently list the clusters within a compute resource.

Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli-0.11.0.1-1.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1. Configure a VMware type compute resource within Satellite 6.3
2. Issue `hammer compute resource info --id 1`
3. See no information about clusters within the given compute resource

Actual results:
No information on clusters, no additional commands to list information on clusters in `hammer compute-resource --help`

Expected results:
Either a listing of all clusters or an additional command sequence to get that list.

Additional info:

Comment 2 Chris Roberts 2018-08-29 19:33:18 UTC
Confirmed this is a bug with hammer and not Foreman:

We see it missing from here:

https://github.com/theforeman/hammer-cli-foreman/blob/master/lib/hammer_cli_foreman/compute_resource.rb

Yet I can see the ID when I query the API:

chrobert@vault111:~/certs$ http -j --verify=no -a admin:changeme -v GET https://vmwaresat.satellite.lab.eng.rdu2.redhat.com/api/compute_resources/1/available_clusters
GET /api/compute_resources/1/available_clusters HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Authorization: Basic YWRtaW46Y2hhbmdlbWU=
Connection: keep-alive
Content-Type: application/json
Host: vmwaresat.satellite.lab.eng.rdu2.redhat.com
User-Agent: HTTPie/0.9.8



HTTP/1.1 200 OK
Apipie-Checksum: d060cb9648d89f2f6c219b50d34e38d1
Cache-Control: max-age=0, private, must-revalidate
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 180
Content-Security-Policy: default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data: *.gravatar.com; script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 29 Aug 2018 19:29:35 GMT
ETag: W/"0d520ae6afa3c835428dcc2e59e4c0e4-gzip"
Foreman_api_version: 2
Foreman_version: 1.15.6.45
Keep-Alive: timeout=5, max=10000
Server: Apache/2.4.6 (Red Hat Enterprise Linux)
Set-Cookie: _session_id=beccb5bb0220b12ce0c307b8c44bc67d; path=/; secure; HttpOnly
Status: 200 OK
Strict-Transport-Security: max-age=631152000; includeSubdomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: sameorigin
X-Permitted-Cross-Domain-Policies: none
X-Powered-By: Phusion Passenger 4.0.18
X-Request-Id: dfb22ed2-de79-411d-868b-ba6fd4c72d89
X-Runtime: 0.409989
X-XSS-Protection: 1; mode=block

{
    "page": 1,
    "per_page": 20,
    "results": [
        {
            "full_path": "Satellite_Engineering",
            "id": "domain-c7",
            "name": "Satellite_Engineering"
        },
        {
            "full_path": "SysMgmt_vMotion",
            "id": "domain-c20",
            "name": "SysMgmt_vMotion"
        }
    ],
    "search": null,
    "sort": {
        "by": null,
        "order": null
    },
    "subtotal": 1,
    "total": 1
}

Comment 3 Chris Roberts 2018-08-29 19:53:39 UTC
Played around on a 6.3 box and got this working after adding it into hammer:

hammer> compute-resource clusters --id 1
----------------------|-----------
NAME                  | ID        
----------------------|-----------
Satellite_Engineering | domain-c7 
SysMgmt_vMotion       | domain-c20
----------------------|-----------

Will create a PR for this.

Comment 4 Satellite Program 2018-08-29 22:13:05 UTC
Upstream bug assigned to akofink

Comment 5 Satellite Program 2018-08-29 22:13:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24747 has been resolved.

Comment 7 Sanket Jagtap 2018-11-28 07:44:25 UTC
Build:Satellite 6.5.0 snap 5

hammer> compute-resource clusters --id 3 
-----------|----------------------
ID         | NAME                 
-----------|----------------------
domain-c7  | Satellite_Engineering
domain-c20 | SysMgmt_vMotion      
-----------|----------------------
Page 1 of 1 (use --page and --per-page for navigation).
hammer> compute-resource clusters --help
Usage:
     compute-resource clusters [OPTIONS]

Options:
 --id ID                                  
 --location LOCATION_NAME                Location name
 --location-id LOCATION_ID                
 --location-title LOCATION_TITLE         Location title
 --name NAME                             Compute resource name
 --organization ORGANIZATION_NAME        Organization name
 --organization-id ORGANIZATION_ID       Organization ID
 --organization-title ORGANIZATION_TITLE Organization title
 -h, --help                              Print help

But, it shows use the parameters to sort it page wise which doesn't work. the current Vmware has only 2 clusters, but looking at error it seems the options are not recognised. Wnat to confirm if it is a issue.
hammer> compute-resource clusters --id 3 --per-page 2
Error: Unrecognised option '--per-page'.

See: ' compute-resource clusters --help'.
hammer> compute-resource clusters --id 3 --page 2
Error: Unrecognised option '--page'.

See: ' compute-resource clusters --help'.

Comment 8 Tomas Strachota 2018-11-28 08:13:54 UTC
The API for clusters always lists all the records. Pagination isn't supported there so it is correct that --page and --per-page is missing in the command. 

The bug is that hammer shouldn't be displaying the pagination message when an api doesn't offer page and per_page parameters. Since it's a generic problem in hammer's core I'd prefer fixing it in a separate bug.

Comment 9 Sanket Jagtap 2018-12-18 07:00:42 UTC
ACK, Let's create and track it as a separate bug


Moving the bug to verified,as it solves the original issue

Comment 11 errata-xmlrpc 2019-05-14 12:37:48 UTC
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, 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-2019:1222


Note You need to log in before you can comment on or make changes to this bug.