Foreman - VMWare - Template based provisoning - SSH issue

> Environment Details:
> Foreman 1.6
> VMware 5.5
> VMWare Template: RHEL 6.5 x86_64 (minimal)
>
> Issue:
> I am trying to provision VM on vCenter using Foreman using the VMware
> template mentioned above. I am able to get the VM created but
> provisioning gets hung after the VM is created. Upon further
> investigation in the logs I found the following error stacktrace as below
>
> Started GET "/tasks/5cf790ec-ffad-4463-9c14-ba4585723b96" for
> 10.160.32.77 at 2014-09-23 15:21:47 +0100
> Processing by TasksController#show as /
> Parameters: {"id"=>"5cf790ec-ffad-4463-9c14-ba4585723b96"}
> Rendered tasks/_list.html.erb (0.0ms)
> Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.4ms)
> all authorization methods failed (tried password)
> Failed to login via SSH to foremantest2.ordsvy.gov.uk: execution
> expired
[snip]
>
> ---- end of error stacktrace
>
> I believe this might be due to some pre-setup I need to do into the
> template (e.g. like creating a foreman user to allow ssh or generate ssh
> keys). I have searched upon this error and could find something similar
> regarding EC2 instances provisioning with SSH keys but with no luck for
> VMware compute resource. I am certain that this would have been caught
> during the testing of this feature when it was introduced into Foreman
> and probably missed in documentation.

When you created the image under the compute resource in Foreman's UI,
you need to specify a username and password that can be used to log into
the image. Edit this by going to Infra > Compute resources > your
VMware CR > Images tab and then Edit.

Ensure you pre-create this username + password on the template and
ensure that Foreman has connectivity to the VM after creation.

As a side note, please don't cross-post to dev and users, this is a
users list question really. (And only post once!)

··· On 24/09/14 09:36, soumen trivedi wrote:


Dominic Cleal
Red Hat Engineering

Thanks Dominic for the response. I will give this a try now.

Sorry I wasn't sure if this was issue that would require dev attention
(given VMWare Template provisioning is a new feature in Foreman) and there
was some browser issue causing multiple post. Will certainly not re-post
the same issue :slight_smile:

··· On Wednesday, September 24, 2014 9:41:40 AM UTC+1, Dominic Cleal wrote: > > On 24/09/14 09:36, soumen trivedi wrote: > > Environment Details: > > Foreman 1.6 > > VMware 5.5 > > VMWare Template: RHEL 6.5 x86_64 (minimal) > > > > Issue: > > I am trying to provision VM on vCenter using Foreman using the VMware > > template mentioned above. I am able to get the VM created but > > provisioning gets hung after the VM is created. Upon further > > investigation in the logs I found the following error stacktrace as > below > > > > Started GET "/tasks/5cf790ec-ffad-4463-9c14-ba4585723b96" for > > 10.160.32.77 at 2014-09-23 15:21:47 +0100 > > Processing by TasksController#show as */* > > Parameters: {"id"=>"5cf790ec-ffad-4463-9c14-ba4585723b96"} > > Rendered tasks/_list.html.erb (0.0ms) > > Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.4ms) > > all authorization methods failed (tried password) > > Failed to login via SSH to foremantest2.ordsvy.gov.uk: execution > > expired > [snip] > > > > ---- end of error stacktrace > > > > I believe this might be due to some pre-setup I need to do into the > > template (e.g. like creating a foreman user to allow ssh or generate ssh > > keys). I have searched upon this error and could find something similar > > regarding EC2 instances provisioning with SSH keys but with no luck for > > VMware compute resource. I am certain that this would have been caught > > during the testing of this feature when it was introduced into Foreman > > and probably missed in documentation. > > When you created the image under the compute resource in Foreman's UI, > you need to specify a username and password that can be used to log into > the image. Edit this by going to Infra > Compute resources > your > VMware CR > Images tab and then Edit. > > Ensure you pre-create this username + password on the template and > ensure that Foreman has connectivity to the VM after creation. > > As a side note, please don't cross-post to dev and users, this is a > users list question really. (And only post once!) > > -- > Dominic Cleal > Red Hat Engineering >