- Description of problem: Looks like the GCE Compute Resource creation from API and CLI isn't possible for now as the options to create the GCE CR are not available from those endpoints. CLI: No options for GCE CR: -------------------------------- # hammer -u admin -p changeme compute-resource create --help API: No options for GCE CR: -------------------------------- https://<server_fqdn>/apidoc/v2/compute_resources/create.html - Version-Release number of selected component (if applicable): Satellite 6.6 snap 7 - How reproducible: Always - Steps to Reproduce: 1. Attempt to create a GCE Compute Resource from CLI / API. - Actual results: No options/fields to create GCE CR from API / CLI as said in the description of this bug. - Expected results: Options/fields to create GCE CR from API/CLI should be available. Additional info:
Created redmine issue https://projects.theforeman.org/issues/27155 from this bug
Hello Jitendra, Could you please confirm it was working previously? As far as I know it wasn't working before.If that is the case BZ should be marked as RFE not a bug.
Not sure if those options were present for previous satellite versions like 6.4 and below but, in 6.5 those options to create GCE CR is not present in API and CLI.
If API and CLI support is missing in 6.5, then I believe it is unimplemented. I've reached out to PM to clarify if this can be broken out into a story for Sat 6.7. If that's the case, we can mark this as RFE and defer it.
Verified! @Satellie 6.7 snap 8 Steps and Observation : -------------------------------- CLI: # hammer compute-resource create --help | grep GCE --email EMAIL Email for GCE only --key-path KEY_PATH Certificate path for GCE only --project PROJECT Project id for GCE only --provider PROVIDER Providers include Libvirt, Ovirt, EC2, Vmware, Openstack, GCE --zone ZONE For GCE only API/ APIDOC: compute_resource[project] optional , nil allowed Project id for GCE only Validations: Must be a String compute_resource[email] optional , nil allowed Email for GCE only Validations: Must be a String compute_resource[key_path] optional , nil allowed Certificate path for GCE only Validations: Must be a String compute_resource[zone] optional , nil allowed for GCE only Validations: Must be a String COMPUTE RESOURCE CREATE using API / CLI: Thanks for fixing / improving GCE. The CR create has been verified by API / CLI endpoints and it works flawlessly. The Compute Resource c
Hello, I got the feedback during "CEE enablement for Satellite 6.7 - Demo sessions" that it would be good to add sample hammer commands for GCE. Most of the GCE Hammer commands are similar with other compute-resources so adding below sample commands specific to GCE compute-resource. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sample Hammer commands for Documentation: ## Create GCE Compute Resource: Please check below list of options available for GCE compute-resource: # hammer compute-resource create --help | grep GCE --email EMAIL Email for GCE only --key-path KEY_PATH Certificate path for GCE only --project PROJECT Project id for GCE only --provider PROVIDER Providers include Libvirt, Ovirt, EC2, Vmware, Openstack, GCE --zone ZONE For GCE only # hammer compute-resource create --name 'test-hammer-gce' --provider 'gce' --project 'test-dev' --key-path 'gce_config.json' --zone 'us-west1-b' --email 'xyz' ## Create Image: # hammer compute-resource image create --name 'test-image' --operatingsystem-id 1 --architecture-id 1 --uuid '378010XXXXXXXXX' --compute-resource-id 6 --username 'test-admin' Note that Google do not provide the ability to ssh in directly as root so while creating an image, enter username except root. ## Create Compute Profile: # hammer compute-profile create --name gce_cp ## Set Compute Attributes for Compute Profile: # hammer compute-profile values create --help GCE: --volume: size_gb Volume size in GB, integer value --compute-attributes: machine_type network associate_external_ip # hammer compute-profile values create --compute-attributes "machine_type=f1-micro,associate_external_ip=true,network=default" --compute-profile-id 8 --compute-resource-id 6 --volume "size_gb=20" --location-id 1 --organization-id 2 ## Host creation: # hammer host create --name gceHammer --organization-id 1 --location-id 2 --compute-resource-id 6 --puppet-environment-id 1 --compute-attributes 'machine_type=g1-small,network=default,associate_external_ip=true' --volume 'size_gb=13' --provision-method 'image' --root-password changeme --interface "type=interface,domain_id=1,managed=true,primary=true,provision=true" --image-id 1 --puppet-ca-proxy-id 1 --puppet-proxy-id 1 --architecture-id 1 --operatingsystem-id 1 Note that using hammer, User needs to send Foreman image ID inside --image-id option whereas using API, User needs to send image UUID inside compute-attributes param against "image_id" key. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As it is part of hammer-cli-foreman not having separate plugin, would it be possible to include these example commands in Hammer documentation?
Hi Kavita, thank you very much for bringing this to my attention. I have created a docs bug to capture this. I might be back to you with some questions as I work: https://bugzilla.redhat.com/show_bug.cgi?id=1801257 Thanks, Melanie
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-2020:1454
qe-test-coverage + : Covered from API and CLI tests.