Problem:
Impossible to provision a host from a VMWare Image.
Error message : "Failed to create a compute vCenterMSC (VMware) instance devin-riter.msc.so: 5018cf78-5145-6662-4c37-401bcecef8af was not found"
The image was created in VMWare through creation of a Ubuntu Linux VM and then “Convert to template”.
Creation of the compute resource works fine, Foreman sees all VMs.
Creation of the image works fine also.
The image is not in any folder (I saw an old bug related to this).
I though it was related to French accent.
We can see for instance this kind of log in the production.log (look at path parameter) :
2018-09-03T10:23:32 [I|app|05105] Parameters: {"utf8"=>"✓", "authenticity_token"=>"1vuRpMbNYpaS+pTdbH+3/m93WXDk0O9BMRapbv5h9tSEctuDLjX7DCXgLQbwoJ2aGWlqi81EOS/LDXIaWvRHDw==", "host"=>{"name"=>"susan-vandon", "hostgroup_id"=>"", "compute_resource_id"=>"3", "environment_id"=>"", "puppet_proxy_id"=>"", "puppet_ca_proxy_id"=>"", "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"susan-vandon", "domain_id"=>"", "ip"=>"", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualE1000", "network"=>"network-46"}}}, "compute_attributes"=>{"cpus"=>"1", "corespersocket"=>"1", "memory_mb"=>"2048", "firmware"=>"automatic", "cluster"=>"", "path"=>"/Centres de données/NetCenter/vm", "guest_id"=>"otherGuest", "hardware_version"=>"Default", "memoryHotAddEnabled"=>"0", "cpuHotAddEnabled"=>"0", "add_cdrom"=>"0", "start"=>"1", "annotation"=>"", "scsi_controllers"=>"{\"scsiControllers\":[{\"type\":\"VirtualLsiLogicController\",\"key\":1000}],\"volumes\":[{\"thin\":true,\"name\":\"Hard disk\",\"mode\":\"persistent\",\"controllerKey\":1000,\"size\":10485760,\"sizeGb\":10}]}"}, "architecture_id"=>"", "operatingsystem_id"=>"", "provision_method"=>"build", "build"=>"1", "medium_id"=>"", "ptable_id"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"6-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "fakepassword"=>"[FILTERED]"}
But it does not work either with another vCenter where the path is in English :
2018-09-03T10:23:31 [I|app|5a42a] Parameters: {"utf8"=>"✓", "authenticity_token"=>"1vuRpMbNYpaS+pTdbH+3/m93WXDk0O9BMRapbv5h9tSEctuDLjX7DCXgLQbwoJ2aGWlqi81EOS/LDXIaWvRHDw==", "host"=>{"name"=>"susan-vandon", "hostgroup_id"=>"", "compute_resource_id"=>"3", "environment_id"=>"", "puppet_proxy_id"=>"", "puppet_ca_proxy_id"=>"", "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"susan-vandon", "domain_id"=>"", "ip"=>"", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualE1000", "network"=>"network-46"}}}, "compute_attributes"=>{"cpus"=>"1", "corespersocket"=>"1", "memory_mb"=>"2048", "firmware"=>"automatic", "cluster"=>"", "path"=>"/Datacenters/GO4COLLAB/vm", "guest_id"=>"otherGuest", "hardware_version"=>"Default", "memoryHotAddEnabled"=>"0", "cpuHotAddEnabled"=>"0", "add_cdrom"=>"0", "start"=>"1", "annotation"=>"", "scsi_controllers"=>"{\"scsiControllers\":[{\"type\":\"VirtualLsiLogicController\",\"key\":1000}],\"volumes\":[{\"thin\":true,\"name\":\"Hard disk\",\"mode\":\"persistent\",\"controllerKey\":1000,\"size\":10485760,\"sizeGb\":10}]}"}, "architecture_id"=>"", "operatingsystem_id"=>"", "provision_method"=>"build", "build"=>"1", "medium_id"=>"", "ptable_id"=>"", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"6-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "fakepassword"=>"[FILTERED]"}
Please help us with this issue.
Expected outcome:
Foreman and Proxy versions:
Foreman version : 1.18.1
Running on Ubuntu 16.04.5 LTS
VMWare vCenter server 5.5.0 build 4180647
Foreman and Proxy plugin versions:
Other relevant data:
The production log gives this :
2018-09-03T10:15:45 [W|app|d6d0d] Failed to create a compute vCenterMSC (VMware) instance devin-riter.msc.so: 5018cf78-5145-6662-4c37-401bcecef8af was not found
Fog::Compute::Vsphere::NotFound: 5018cf78-5145-6662-4c37-401bcecef8af was not found
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-vsphere-2.1.1/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:28:in `get_vm_ref'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-vsphere-2.1.1/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:7:in `get_virtual_machine'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-vsphere-2.1.1/lib/fog/vsphere/requests/compute/vm_clone.rb:22:in `vm_clone_check_options'
/usr/share/foreman/vendor/ruby/2.3.0/gems/fog-vsphere-2.1.1/lib/fog/vsphere/requests/compute/vm_clone.rb:96:in `vm_clone'
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:510:in `clone_vm'
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:439:in `create_vm'
/usr/share/foreman/app/models/concerns/orchestration/compute.rb:78:in `setCompute'
/usr/share/foreman/app/models/concerns/orchestration.rb:222:in `execute'
/usr/share/foreman/app/models/concerns/orchestration.rb:145:in `block in process'
/usr/share/foreman/app/models/concerns/orchestration.rb:137:in `each'
/usr/share/foreman/app/models/concerns/orchestration.rb:137:in `process'
/usr/share/foreman/app/models/concerns/orchestration.rb:44:in `around_save_orchestration'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:135:in `run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:827:in `_run_save_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/callbacks.rb:336:in `create_or_update'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/persistence.rb:129:in `save'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/validations.rb:44:in `save'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:35:in `save'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:308:in `block (2 levels) in save'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:308:in `block in save'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:323:in `rollback_active_record_state!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/transactions.rb:307:in `save'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:42:in `save'
/usr/share/foreman/app/models/concerns/foreman/sti.rb:26:in `save'
/usr/share/foreman/app/controllers/hosts_controller.rb:104:in `create'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:186:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/audited-4.7.1/lib/audited/sweeper.rb:14:in `around'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/audited-4.7.1/lib/audited/sweeper.rb:14:in `around'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:135:in `run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/rescue.rb:20:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in `block in instrument'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in `instrument'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/railties/controller_runtime.rb:22:in `process_action'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:124:in `process'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/rendering.rb:30:in `process'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal.rb:189:in `dispatch'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal.rb:253:in `dispatch'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:31:in `serve'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in `serve'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:844:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/apipie-rails-0.5.10/lib/apipie/static_dispatcher.rb:65:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/apipie-rails-0.5.10/lib/apipie/extractor/recorder.rb:136:in `call'
/usr/share/foreman/lib/middleware/telemetry.rb:9:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/apipie-rails-0.5.10/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/etag.rb:25:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
/usr/share/foreman/lib/middleware/logging_context.rb:23:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in `context'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:97:in `run_callbacks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:24:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/rack/logger.rb:36:in `call_app'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/rack/logger.rb:26:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/request_id.rb:25:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/runtime.rb:22:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/executor.rb:12:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/secure_headers-5.0.5/lib/secure_headers/middleware.rb:13:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/engine.rb:522:in `call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/railtie.rb:185:in `public_send'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/railtie.rb:185:in `method_missing'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:160:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
/usr/share/foreman/vendor/ruby/2.3.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2018-09-03T10:15:45 [W|app|d6d0d] Rolling back due to a problem: [#<Orchestration::Task:0x0000000a175b88 @name="Set up compute instance devin-riter.msc.so", @id="Set up compute instance dev
in-riter.msc.so", @status="failed", @priority=2, @action=[#<Host::Managed id: nil, name: "devin-riter.msc.so", last_compile: nil, last_report: nil, updated_at: nil, created_at: nil, root_pa
ss: "$5$69ZYlXlu$nXeHNrDtJrDs/35.kMr3cH/J5Y11/yO6JW6j19...", architecture_id: 1, operatingsystem_id: 1, environment_id: 1, ptable_id: nil, medium_id: nil, build: true, comment: "", disk: ""
, installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 6, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: true, use_image: nil, image_file: nil, uuid: nil, comp
ute_resource_id: 3, puppet_proxy_id: 1, certname: nil, image_id: 7, organization_id: nil, location_id: nil, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provisio
n_method: "image", grub_pass: "$6$X6Hoyi04$I/euOB6H2mvJxL9W.04wFfD3bmEtYaWkGRsTRS...", global_status: 0, lookup_value_matcher: "fqdn=devin-riter.msc.so", pxe_loader: "">, :setCompute], @cre
ated=1535962544.9690986, @timestamp=2018-09-03 08:15:45 UTC>]
2018-09-03T10:15:45 [I|app|d6d0d] Processed 1 tasks from queue 'Host::Managed Main', completed 0/3
2018-09-03T10:15:45 [E|app|d6d0d] Task 'Set up compute instance devin-riter.msc.so' *failed*
2018-09-03T10:15:45 [E|app|d6d0d] Task 'Query instance details for devin-riter.msc.so' *canceled*
2018-09-03T10:15:45 [E|app|d6d0d] Task 'Power up compute instance devin-riter.msc.so' *canceled*
2018-09-03T10:15:45 [E|app|d6d0d] Failed to save: Failed to create a compute vCenterMSC (VMware) instance devin-riter.msc.so: 5018cf78-5145-6662-4c37-401bcecef8af was not found