Project

General

Profile

Bug #22749

Image username is ignored on GCE

Added by Daniel Lobato Garcia over 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources - GCE
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1375132

Description of problem:
When creating an image (in this case on GCE), you can specify a username. Iiuc, this username is then used by Foreman to run the finish_template.

On GCE, this username is completely ignored, so when creating a new instance, the Fog default of 'root' is used to setup ssh public key authentication for. This fails, of course, because root would never be allowed to log in remotely on a cloud instance by default.

Version-Release number of selected component (if applicable):
6.2.1

How reproducible:

Steps to Reproduce:
1. Setup GCE compute resource (see bug 1374335)
2. Specify image and setup username
3. Try and create a new host

Actual results:
Running the finish_template fails, so new host is left unconfigured

Expected results:
Finish_template runs

Additional info:
Workaround is to override the default in line 20 of /opt/theforeman/tfm/root/usr/share/gems/gems/fog-core-1.36.0/lib/fog/compute/models/server.rb, so I'm thinking the username is not passed to the Fog Google::Server class properly.


Related issues

Related to Foreman - Bug #26473: [Google Compute Resource] fix broken changes with latest API changes and fog-google gem updateClosed

Associated revisions

Revision abdece46 (diff)
Added by Kavita Gaikwad 4 months ago

Fixes #22749 - fix user & sshkey creation for VM in GCE

With this commit, able to create user using username from image
and sshkey for this user now gets stored inside VM.

History

#1 Updated by Kavita Gaikwad 6 months ago

  • Assignee set to Kavita Gaikwad
  • Subject changed from Image username is ignored on GCE to Image username is ignored on GCE

#2 Updated by Kavita Gaikwad 5 months ago

  • Related to Bug #26473: [Google Compute Resource] fix broken changes with latest API changes and fog-google gem update added

#3 Updated by Tomer Brisker 4 months ago

  • Fixed in Releases 1.22.0 added

#4 Updated by Kavita Gaikwad 4 months ago

  • Status changed from New to Closed

Also available in: Atom PDF