Open j-pavel opened 7 years ago
If I recall correctly, this is due to one of two things:
That second case is why I have all Azure images set as user data images, and use Azure custom script extensions to configure the hosts (there are fields during the host build for setting the URI and arguments to a script).
I should mention that I'm not completely sure whether Foreman is incapable of handling passing a password to sudo, because I ran into difficulties attempting to persuade it to do so, and just used custom script extensions instead
Does the SSH session get initiated from the foreman server, or is there logic somewhere to utilize a certain smart-proxy? We have our foreman server in a private datacenter, and a smart-proxy installation in Azure.
It is initiated from the Foreman server
Thanks. I'd settle for it to get created at this point, even without a finishing script. Nothing is getting initiated in Azure, it seems, when I submit a request in Foreman. I'm not sure if my data doesn't line up with a valid request in fog so it's getting dropped there, or something else.
I have the same issue. It will successfully create in Foreman, but no machine is ever created at Azure.
Can either of you attempt to create a machine, and dump the relevant portion of the logs somewhere I can see them?
All Azure-related events grepped by event ID (third column of production.log) attached from both of my Foremans.
Any luck here? I wanted to confirm that you could see the attachment.
I can indeed see it, I'll go through it later this evening
No worries.... I just wanted to make sure I attached the file right... upload form was being odd yesterday.
@jas612 It looks from your logs like you don't have any finish templates configured, and it's erroring on that. That said, this plugin does not play well with finish templates, because I could not find a way to get Foreman to sudo when attempting to run the finishing script.
The way I've been using this is to mark all Azure templates as user data templates, and pass a script to the Azure custom script extension. There are fields for doing this during VM provisioning.
This fails me. See the attached image where I edit the OS to just use a user data template, and then the new error I get on creating a host. Why is it demanding a finish template still, when the OS doesn't have it defined?
Similar to @jas612, I'm trying to figure out what I'm missing. Right now, my scripts are all blank (I'm just trying to get this created), but I defined one of each type - a User data, Finish, iPXE, Provisioning, and PXELinux.
When I define a host, if I don't have a "Finishing" template linked for the OS, I get the error jas612 shows above. If I link a template (in my case here a blank one), I get logged immediately upon saving the host: 2017-09-12 13:46:42 6924f7b0 [templates] [I] Rendering template 'Azure Finishing Script' 2017-09-12 13:46:42 6924f7b0 [app] [W] Failed to login via SSH to foreman-deployed.prod.mcs.az-eastus2.mob.com: ERF42-1994 [Foreman::Exception]: Unable to find proper authentication method | Foreman::Exception: ERF42-1994 [Foreman::Exception]: Unable to find proper authentication method
Is my problem that my finishing template is blank? Is there some template you can share to help this deployment succeed?
I'm now to the same place as @j-pavel is:
foreman-01 ~ [atl] # egrep -i '918814bd' ssh /var/log/foreman/production.log grep: ssh: No such file or directory /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [I] Started POST "/hosts" for 172.24.107.78 at 2017-09-12 11:48:42 -0400 /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [I] Processing by HostsController#create as */* /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"79rZ+IaGbjMZxicJkoOggmmWAxjUjv0XRqCHeRv5Po0MhwuqTOLoVQFRes3BA5w6jZ9DgaW/NoJHu733GfnbWA==", "host"=>{"name"=>"foreman-proxy-01", "hostgroup_id"=>"623", "compute_resource_id"=>"11", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"foreman-proxy-01", "domain_id"=>"22", "subnet_id"=>"59", "ip"=>"", "ip6"=>"", "managed"=>"0", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"network"=>"/subscriptions/d0e3c7e5-1e22-4823-89c9-b23d268ca4a5/resourceGroups/Linux/providers/Microsoft.Network/virtualNetworks/US_East2_Linux_172.28.96.0-19/subnets/US_East_2_Linux_Tools_Management", "bridge"=>"None", "name"=>"false"}}}, "compute_attributes"=>{"location"=>"East US 2", "resource_group"=>"Linux", "vm_size"=>"Basic_A0", "platform"=>"Linux", "username"=>"rentpath", "password"=>"[FILTERED]", "ssh_key_data"=>"", "os_disk_size"=>"", "premium_os_disk"=>"false", "os_disk_caching"=>"None", "puppet_master"=>"", "script_command"=>"/root/post_prov.sh", "script_uris"=>"", "image_id"=>"/subscriptions/d0e3c7e5-1e22-4823-89c9-b23d268ca4a5/resourceGroups/Linux/providers/Microsoft.Compute/images/scilinux73-useast2"}, "architecture_id"=>"1", "operatingsystem_id"=>"15", "provision_method"=>"image", "build"=>"1", "medium_id"=>"11", "ptable_id"=>"55", "pxe_loader"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"54-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"image", "provider"=>"AzureRM", "bare_metal_capabilities"=>"build"} /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [I] Current user: jstewart (administrator) /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [templates] [I] Rendering template 'Azure Finish' /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [W] Failed to login via SSH to foreman-proxy-01.tools.useast2.azure.rentpath.com: ERF42-1994 [Foreman::Exception]: Unable to find proper authentication method /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [I] Redirected to https://foreman.vip.atl.primedia.com/hosts/foreman-proxy-01.tools.useast2.azure.rentpath.com /var/log/foreman/production.log:2017-09-12 11:48:42 918814bd [app] [I] Completed 302 Found in 561ms (ActiveRecord: 42.0ms) foreman-01 ~ [atl] #
Any luck?
Sorry, I just saw your replies. Have you guys used Foreman to provision on another compute provider? The demand for a finish template is built into Foreman, not this plugin. You'll need to set your images as being User data images for Foreman to look for a user data template instead of a finishing script. There is a checkbox in the template for doing this.
When I do this, the host immediately creates in Foreman, but still does not in Azure. No SSH error this time, though, and no finish template error, this time.
Logged create event:
2017-09-16 02:15:38 e37d9d5b [app] [I] Started POST "/hosts" for 172.24.107.78 at 2017-09-16 02:15:38 -0400 2017-09-16 02:15:38 e37d9d5b [app] [I] Processing by HostsController#create as / 2017-09-16 02:15:38 e37d9d5b [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"+dCB10MOpYdl4ZCCQKHKo8mkPIzVjecQiIjTIFFdY7VE2eU0P/eZXrZi0TKtKEu491A8KCfzTHQ4qUB7ZN/6KQ==", "host"=>{"name"=>"foreman-proxy-01", "hostgroup_id"=>"297", "compute_resource_id"=>"11", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"foreman-proxy-01", "domain_id"=>"23", "subnet_id"=>"59", "ip"=>"", "ip6"=>"", "managed"=>"0", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"network"=>"", "bridge"=>"None", "name"=>"false"}}}, "compute_attributes"=>{"location"=>"East US 2", "resource_group"=>"Linux", "vm_size"=>"", "platform"=>"Linux", "username"=>"", "password"=>"[FILTERED]", "ssh_key_data"=>"", "os_disk_size"=>"", "premium_os_disk"=>"false", "os_disk_caching"=>"None", "puppet_master"=>"", "script_command"=>"", "script_uris"=>"", "image_id"=>"/subscriptions/d0e3c7e5-1e22-4823-89c9-b23d268ca4a5/resourceGroups/Linux/providers/Microsoft.Compute/images/scilinux73-useast2"}, "architecture_id"=>"1", "operatingsystem_id"=>"16", "provision_method"=>"image", "build"=>"1", "pxe_loader"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"54-Users", "enabled"=>"1", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"image", "provider"=>"AzureRM", "bare_metal_capabilities"=>"build"} 2017-09-16 02:15:38 e37d9d5b [app] [I] Current user: jstewart (administrator) 2017-09-16 02:15:39 e37d9d5b [app] [I] Redirected to https://foreman.vip.atl.primedia.com/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com 2017-09-16 02:15:39 e37d9d5b [app] [I] Completed 302 Found in 348ms (ActiveRecord: 25.9ms)
Can you do a build and provide me with your logs again? Also, are you able to build with other compute providers?
Done. I log rotated production.log RIGHT BEFORE I hit the Create button in the UI, and copied it shortly after (this is a production system with over 1000 hosts on multiple compute providers). The logs:
2017-09-16 18:56:06 f20b7995 [app] [I] Started GET "/node/maxleases-web-01.qa.atl.primedia.com?format=yml" for 172.24.107.78 at 2017-09-16 18:56:06 -0400 2017-09-16 18:56:06 f20b7995 [app] [I] Processing by HostsController#externalNodes as YML 2017-09-16 18:56:06 f20b7995 [app] [I] Parameters: {"name"=>"maxleases-web-01.qa.atl.primedia.com"} 2017-09-16 18:56:06 f20b7995 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:06 f20b7995 [app] [I] Rendered text template (0.0ms) 2017-09-16 18:56:06 f20b7995 [app] [I] Completed 200 OK in 198ms (Views: 0.6ms | ActiveRecord: 28.4ms) 2017-09-16 18:56:07 aeb6bed7 [app] [I] Started POST "/hosts" for 172.24.12.109 at 2017-09-16 18:56:07 -0400 2017-09-16 18:56:07 aeb6bed7 [app] [I] Processing by HostsController#create as */* 2017-09-16 18:56:07 aeb6bed7 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"aaojzvb0XxmlNjyYteSzSNhjhnQs87POqtTguMM22OCoJhM+04tQMkJNVhqpmpkIEgAV4kHIwRuc0EPdhxWxvg==", "host"=>{"name"=>"foreman-proxy-01", "hostgroup_id"=>"297", "compute_resource_id"=>"11", "compute_profile_id"=>"5", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"foreman-proxy-01", "domain_id"=>"23", "subnet_id"=>"59", "ip"=>"", "ip6"=>"", "managed"=>"0", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"network"=>"/subscriptions/d0e3c7e5-1e22-4823-89c9-b23d268ca4a5/resourceGroups/Linux/providers/Microsoft.Network/virtualNetworks/US_East2_Linux_172.28.96.0-19/subnets/US_East_2_Linux_Tools_Management", "bridge"=>"None", "name"=>"false"}}}, "compute_attributes"=>{"location"=>"East US 2", "resource_group"=>"Linux", "vm_size"=>"Standard_A2", "platform"=>"Linux", "username"=>"rentpath", "password"=>"[FILTERED]", "ssh_key_data"=>"", "os_disk_size"=>"", "premium_os_disk"=>"false", "os_disk_caching"=>"None", "puppet_master"=>"", "script_command"=>"/root/postprovision.sh", "script_uris"=>"", "image_id"=>"/subscriptions/d0e3c7e5-1e22-4823-89c9-b23d268ca4a5/resourceGroups/Linux/providers/Microsoft.Compute/images/scilinux73-useast2"}, "architecture_id"=>"1", "operatingsystem_id"=>"17", "provision_method"=>"image", "build"=>"1", "pxe_loader"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"54-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"image", "provider"=>"AzureRM", "bare_metal_capabilities"=>"build"} 2017-09-16 18:56:07 aeb6bed7 [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:07 aeb6bed7 [app] [I] Redirected to https://foreman-01.atl.primedia.com/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com 2017-09-16 18:56:07 aeb6bed7 [app] [I] Completed 302 Found in 664ms (ActiveRecord: 40.5ms) 2017-09-16 18:56:08 9d42430c [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 9d42430c [app] [I] Processing by HostsController#show as */* 2017-09-16 18:56:08 9d42430c [app] [I] Parameters: {"id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 9d42430c [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered hosts/show.html.erb within layouts/application (37.5ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered layouts/_application_content.html.erb (1.0ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_user_dropdown.html.erb (29.3ms) 2017-09-16 18:56:08 9d42430c [app] [I] Read fragment views/tabs_and_title_records-54 (0.4ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_org_switcher.html.erb (0.9ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_submenu.html.erb (5.4ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_submenu.html.erb (1.6ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_submenu.html.erb (4.3ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_submenu.html.erb (3.6ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_submenu.html.erb (3.3ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_submenu.html.erb (3.4ms) 2017-09-16 18:56:08 9d42430c [app] [I] Write fragment views/tabs_and_title_records-54 (0.9ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered home/_topbar.html.erb (144.8ms) 2017-09-16 18:56:08 9d42430c [app] [I] Rendered layouts/base.html.erb (148.4ms) 2017-09-16 18:56:08 9d42430c [app] [I] Completed 200 OK in 208ms (Views: 187.2ms | ActiveRecord: 5.5ms) 2017-09-16 18:56:08 01d02e02 [app] [I] Started POST "/api/reports" for 172.24.107.78 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 01d02e02 [app] [I] Processing by Api::V2::ReportsController#create as JSON 2017-09-16 18:56:08 01d02e02 [app] [I] Parameters: {"report"=>"[FILTERED]", "apiv"=>"v2"} 2017-09-16 18:56:08 01d02e02 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:08 01d02e02 [app] [I] processing report for rent-varnish-03.lax.primedia.com 2017-09-16 18:56:08 01d02e02 [app] [I] Imported report for rent-varnish-03.lax.primedia.com in 0.02 seconds 2017-09-16 18:56:08 01d02e02 [app] [I] Rendered api/v2/reports/create.json.rabl (7.3ms) 2017-09-16 18:56:08 01d02e02 [app] [I] Completed 201 Created in 60ms (Views: 7.2ms | ActiveRecord: 12.8ms) 2017-09-16 18:56:08 d236a2ea [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com/overview" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 23447113 [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com/templates" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 d236a2ea [app] [I] Processing by HostsController#overview as HTML 2017-09-16 18:56:08 d236a2ea [app] [I] Parameters: {"id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 23447113 [app] [I] Processing by HostsController#templates as HTML 2017-09-16 18:56:08 23447113 [app] [I] Parameters: {"id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 c450ba48 [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com/vm" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 c450ba48 [app] [I] Processing by HostsController#vm as HTML 2017-09-16 18:56:08 c450ba48 [app] [I] Parameters: {"id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 d236a2ea [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 23447113 [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 cc58341f [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com/runtime?range=7" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 c450ba48 [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 cc58341f [app] [I] Processing by HostsController#runtime as HTML 2017-09-16 18:56:08 cc58341f [app] [I] Parameters: {"range"=>"7", "id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 cc58341f [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 cc58341f [app] [I] Rendered hosts/_runtime.html.erb (7.5ms) 2017-09-16 18:56:08 cc58341f [app] [I] Completed 200 OK in 36ms (Views: 9.5ms | ActiveRecord: 15.2ms) 2017-09-16 18:56:08 8b0ee9fc [app] [I] Started GET "/notification_recipients" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 d236a2ea [app] [I] Rendered hosts/_overview.html.erb (37.7ms) 2017-09-16 18:56:08 8b0ee9fc [app] [I] Processing by NotificationRecipientsController#index as JSON 2017-09-16 18:56:08 d236a2ea [app] [I] Completed 200 OK in 62ms (Views: 29.6ms | ActiveRecord: 16.2ms) 2017-09-16 18:56:08 0dc1706a [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com/resources?range=7" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 8b0ee9fc [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 8b0ee9fc [app] [I] Completed 200 OK in 7ms (Views: 0.1ms | ActiveRecord: 0.8ms) 2017-09-16 18:56:08 0dc1706a [app] [I] Processing by HostsController#resources as HTML 2017-09-16 18:56:08 0dc1706a [app] [I] Parameters: {"range"=>"7", "id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 0dc1706a [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 0dc1706a [app] [I] Rendered hosts/_resources.html.erb (10.9ms) 2017-09-16 18:56:08 0dc1706a [app] [I] Completed 200 OK in 29ms (Views: 11.7ms | ActiveRecord: 7.7ms) 2017-09-16 18:56:08 ee92ff0b [app] [I] Started GET "/hosts/foreman-proxy-01.tools.useast2.azure.primedia.com/nics" for 172.24.12.109 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 ee92ff0b [app] [I] Processing by HostsController#nics as HTML 2017-09-16 18:56:08 ee92ff0b [app] [I] Parameters: {"id"=>"foreman-proxy-01.tools.useast2.azure.primedia.com"} 2017-09-16 18:56:08 ee92ff0b [app] [I] Current user: jstewart (administrator) 2017-09-16 18:56:08 23447113 [app] [I] Rendered hosts/_templates.html.erb (9.1ms) 2017-09-16 18:56:08 23447113 [app] [I] Completed 200 OK in 183ms (Views: 12.5ms | ActiveRecord: 78.5ms) 2017-09-16 18:56:08 ee92ff0b [app] [I] Rendered hosts/_nics.html.erb (55.4ms) 2017-09-16 18:56:08 ee92ff0b [app] [I] Completed 200 OK in 78ms (Views: 50.2ms | ActiveRecord: 13.7ms) 2017-09-16 18:56:08 29083285 [app] [I] Started POST "/api/hosts/facts" for 172.24.107.78 at 2017-09-16 18:56:08 -0400 2017-09-16 18:56:08 29083285 [app] [I] Processing by Api::V2::HostsController#facts as JSON 2017-09-16 18:56:08 29083285 [app] [I] Parameters: {"facts"=>"[FILTERED]", "name"=>"warehousetracking-01.atl.primedia.com", "certname"=>"warehousetracking-01.atl.primedia.com", "apiv"=>"v2", :host=>{"certname"=>"warehousetracking-01.atl.primedia.com", "name"=>"warehousetracking-01.atl.primedia.com"}} 2017-09-16 18:56:08 29083285 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:08 29083285 [audit] [I] [warehousetracking-01.atl.primedia.com] deleted 0 (4.2ms) 2017-09-16 18:56:08 29083285 [audit] [I] [warehousetracking-01.atl.primedia.com] updated 4 (186.7ms) 2017-09-16 18:56:08 29083285 [audit] [I] [warehousetracking-01.atl.primedia.com] added 0 (18.8ms) 2017-09-16 18:56:08 29083285 [app] [I] Import facts for 'warehousetracking-01.atl.primedia.com' completed. Added: 0, Updated: 4, Deleted 0 facts 2017-09-16 18:56:09 29083285 [app] [I] Completed 201 Created in 281ms (Views: 2.1ms | ActiveRecord: 81.6ms) 2017-09-16 18:56:10 c450ba48 [app] [I] Rendered common/404.html.erb within layouts/application (7.4ms) 2017-09-16 18:56:10 c450ba48 [app] [I] Rendered layouts/_application_content.html.erb (0.3ms) 2017-09-16 18:56:10 c450ba48 [app] [I] Rendered layouts/base.html.erb (1.7ms) 2017-09-16 18:56:10 c450ba48 [app] [I] Completed 404 Not Found in 1615ms (Views: 11.2ms | ActiveRecord: 3.6ms) 2017-09-16 18:56:10 5da28e38 [app] [I] Started GET "/node/listing-review-02.ci.atl.primedia.com?format=yml" for 172.24.107.78 at 2017-09-16 18:56:10 -0400 2017-09-16 18:56:10 5da28e38 [app] [I] Processing by HostsController#externalNodes as YML 2017-09-16 18:56:10 5da28e38 [app] [I] Parameters: {"name"=>"listing-review-02.ci.atl.primedia.com"} 2017-09-16 18:56:10 5da28e38 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:10 5da28e38 [app] [I] Rendered text template (0.0ms) 2017-09-16 18:56:10 5da28e38 [app] [I] Completed 200 OK in 145ms (Views: 0.6ms | ActiveRecord: 24.0ms) 2017-09-16 18:56:11 a4154973 [app] [I] Started POST "/api/hosts/facts" for 172.24.107.78 at 2017-09-16 18:56:11 -0400 2017-09-16 18:56:11 a4154973 [app] [I] Processing by Api::V2::HostsController#facts as JSON 2017-09-16 18:56:11 a4154973 [app] [I] Parameters: {"facts"=>"[FILTERED]", "name"=>"rentalhouses-varnish-02.ci.atl.primedia.com", "certname"=>"rentalhouses-varnish-02.ci.atl.primedia.com", "apiv"=>"v2", :host=>{"certname"=>"rentalhouses-varnish-02.ci.atl.primedia.com", "name"=>"rentalhouses-varnish-02.ci.atl.primedia.com"}} 2017-09-16 18:56:11 a4154973 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:11 a4154973 [audit] [I] [rentalhouses-varnish-02.ci.atl.primedia.com] deleted 0 (5.0ms) 2017-09-16 18:56:11 [app] [I] memcached cache backend enabled: [:dalli_store, "memcache-infra-01", {:namespace=>"foreman", :expires_in=>86400, :compress=>true}] 2017-09-16 18:56:11 a4154973 [audit] [I] [rentalhouses-varnish-02.ci.atl.primedia.com] updated 5 (183.7ms) 2017-09-16 18:56:11 a4154973 [audit] [I] [rentalhouses-varnish-02.ci.atl.primedia.com] added 0 (13.2ms) 2017-09-16 18:56:11 a4154973 [app] [I] Import facts for 'rentalhouses-varnish-02.ci.atl.primedia.com' completed. Added: 0, Updated: 5, Deleted 0 facts 2017-09-16 18:56:11 a4154973 [app] [I] Completed 201 Created in 263ms (Views: 2.0ms | ActiveRecord: 83.7ms) 2017-09-16 18:56:11 9686cd4e [app] [I] Started GET "/node/onboard-endeca-02.lax.primedia.com?format=yml" for 172.24.107.78 at 2017-09-16 18:56:11 -0400 2017-09-16 18:56:11 9686cd4e [app] [I] Processing by HostsController#externalNodes as YML 2017-09-16 18:56:11 9686cd4e [app] [I] Parameters: {"name"=>"onboard-endeca-02.lax.primedia.com"} 2017-09-16 18:56:11 9686cd4e [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:11 9686cd4e [app] [I] Rendered text template (0.0ms) 2017-09-16 18:56:11 9686cd4e [app] [I] Completed 200 OK in 158ms (Views: 0.7ms | ActiveRecord: 31.2ms) 2017-09-16 18:56:12 109d8434 [app] [I] Started GET "/node/elk-logstash-02.lax.primedia.com?format=yml" for 172.24.107.78 at 2017-09-16 18:56:12 -0400 2017-09-16 18:56:12 109d8434 [app] [I] Processing by HostsController#externalNodes as YML 2017-09-16 18:56:12 109d8434 [app] [I] Parameters: {"name"=>"elk-logstash-02.lax.primedia.com"} 2017-09-16 18:56:12 109d8434 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:12 109d8434 [app] [I] Rendered text template (0.0ms) 2017-09-16 18:56:12 109d8434 [app] [I] Completed 200 OK in 149ms (Views: 0.5ms | ActiveRecord: 25.1ms) 2017-09-16 18:56:13 3a3a8068 [app] [I] Started GET "/node/image-scaler-02.lax.primedia.com?format=yml" for 172.24.107.78 at 2017-09-16 18:56:13 -0400 2017-09-16 18:56:13 3a3a8068 [app] [I] Processing by HostsController#externalNodes as YML 2017-09-16 18:56:13 3a3a8068 [app] [I] Parameters: {"name"=>"image-scaler-02.lax.primedia.com"} 2017-09-16 18:56:13 3a3a8068 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:14 3a3a8068 [app] [I] Rendered text template (0.0ms) 2017-09-16 18:56:14 3a3a8068 [app] [I] Completed 200 OK in 280ms (Views: 0.5ms | ActiveRecord: 88.3ms) 2017-09-16 18:56:14 [app] [I] Current user: foreman_admin (administrator) 2017-09-16 18:56:14 [app] [I] Current user: foreman_admin (administrator) 2017-09-16 18:56:14 [app] [I] Current user: foreman_admin (administrator) 2017-09-16 18:56:14 [app] [I] Current user: foreman_admin (administrator) 2017-09-16 18:56:14 9554be5b [app] [I] Started POST "/api/hosts/facts" for 172.24.107.78 at 2017-09-16 18:56:14 -0400 2017-09-16 18:56:14 9554be5b [app] [I] Processing by Api::V2::HostsController#facts as JSON 2017-09-16 18:56:14 9554be5b [app] [I] Parameters: {"facts"=>"[FILTERED]", "name"=>"clmr64-endeca-02.qa.atl.primedia.com", "certname"=>"clmr64-endeca-02.qa.atl.primedia.com", "apiv"=>"v2", :host=>{"certname"=>"clmr64-endeca-02.qa.atl.primedia.com", "name"=>"clmr64-endeca-02.qa.atl.primedia.com"}} 2017-09-16 18:56:14 9554be5b [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:14 9554be5b [audit] [I] [clmr64-endeca-02.qa.atl.primedia.com] deleted 0 (4.0ms) 2017-09-16 18:56:15 9554be5b [audit] [I] [clmr64-endeca-02.qa.atl.primedia.com] updated 4 (186.1ms) 2017-09-16 18:56:15 9554be5b [audit] [I] [clmr64-endeca-02.qa.atl.primedia.com] added 0 (7.0ms) 2017-09-16 18:56:15 9554be5b [app] [I] Import facts for 'clmr64-endeca-02.qa.atl.primedia.com' completed. Added: 0, Updated: 4, Deleted 0 facts 2017-09-16 18:56:15 9554be5b [app] [I] Completed 201 Created in 267ms (Views: 1.8ms | ActiveRecord: 66.1ms) 2017-09-16 18:56:15 7d76c231 [app] [I] Started GET "/node/clmr64-endeca-02.qa.atl.primedia.com?format=yml" for 172.24.107.78 at 2017-09-16 18:56:15 -0400 2017-09-16 18:56:15 7d76c231 [app] [I] Processing by HostsController#externalNodes as YML 2017-09-16 18:56:15 7d76c231 [app] [I] Parameters: {"name"=>"clmr64-endeca-02.qa.atl.primedia.com"} 2017-09-16 18:56:15 7d76c231 [app] [I] Current user: foreman_api_admin (administrator) 2017-09-16 18:56:15 7d76c231 [app] [I] Rendered text template (0.0ms) 2017-09-16 18:56:15 7d76c231 [app] [I] Completed 200 OK in 202ms (Views: 0.5ms | ActiveRecord: 33.4ms)
Any ideas?
I think I may have found something
http://projects.theforeman.org/issues/20098
It looks like, on create, the screen cannot resolve user-data templates, which are the thing you told us to use.
So, patching to 1.15.4 apparently fixes. I'll give it a shot and get back to you.
I'm pegged to 1.14 for other reasons for next few months, and was unaware of that. That said, the user data template does not actually do anything, any post-deployment configuration must be done with the custom script extension.
I'm having difficulty figuring out why it's not creating your VM in the first place, I've never encountered such an issue. Not without an error and accompanying stack trace in the logs anyway.
1.14... that's the key.
I setup a green-field instance of 1.14 in Azure and setup this module. It works like a charm.
So, I'm guessing your module isn't compatible with 1.15
Well damn. I'll have to look into why that's the case. However, in the interest of full disclosure I have moved on to using ManageIQ for provisioning, and now only use Foreman as an ENC; it may be some time before I fix this compatibility issue. I of course welcome PRs
The issue seems to be related to https://projects.theforeman.org/issues/23859 which is fixed by the PR https://github.com/theforeman/foreman/pull/5675 I.e. the issue should be fixed in foreman 1.21
I got this installed in Foreman 1.15.3... when I create a host, it submits successfully, and goes to a "pending installation" state in Foreman. Watching the logs, I see an immediate log message:
Failed to login via SSH to foreman-deployed.dev.mcs.az-eastus2.mob.nuance.com: ERF42-1994 [Foreman::Exception]: Unable to find proper authentication method | Foreman::Exception: ERF42-1994 [Foreman::Exception]: Unable to find proper authentication method | /usr/share/foreman/app/models/concerns/orchestration/ssh_provision.rb:53:in `setSSHWaitForResponse'
... is there some other setting necessary before the image can be deployed?