Unable to update the Host Group with hammer command

Problem:
Unable to change the Host Group with hammer command, but it can be changed via the web page. It appears to be trying to create a VM that already exist on the VCenter rather than just updating the Host Group information.

Expected outcome:
Should be able to change the hostgoup with hammer command for automation. Is there a switch that will turn off the “create” command, so that it acts the same way that it does on the web page where you select the Host Group and simply submit.

Foreman and Proxy versions:
1.22.0-1

Foreman and Proxy plugin versions:
foreman-tasks - 0.15.7
foreman_chefs - 0.8.1
foreman_discoverys - 15.0.0
foreman_dockers - 5.0.0
foreman_remote_executions - 1.8.2
katellos - 3.12.1

Other relevant data:
Could not update the host:
Failed to create a compute sitea-vcenter.example.us (VMware) instance sysengtesta04a.example.us: DuplicateName: The name ‘sysengtesta04a.example.us’ already exists.

logs
==> /var/log/foreman/production.log <==
2019-08-28T15:24:32 [W|app|c0f36814] Scoped order is ignored, it's forced to be batch order.
2019-08-28T15:24:32 [I|app|c0f36814] Authorized user timbrooks(Tim Brooks)
2019-08-28T15:24:32 [I|app|c0f36814] Current user set to timbrooks (admin)
2019-08-28T15:24:32 [I|app|c0f36814]   Rendering api/v2/smart_proxies/index.json.rabl within api/v2/layouts/index_layout
2019-08-28T15:24:32 [I|app|c0f36814]   Rendered api/v2/smart_proxies/index.json.rabl within api/v2/layouts/index_layout (35.4ms)
2019-08-28T15:24:32 [I|app|c0f36814] Completed 200 OK in 1134ms (Views: 31.4ms | ActiveRecord: 32.9ms)
2019-08-28T15:24:32 [I|app|b818df9d] Started PUT "/api/hosts/76" for 172.18.11.26 at 2019-08-28 15:24:32 -0500
2019-08-28T15:24:32 [I|app|b818df9d] Processing by Api::V2::HostsController#update as JSON
2019-08-28T15:24:32 [I|app|b818df9d]   Parameters: {"organization_id"=>1, "host"=>{"name"=>"sysenga04a.example.us", "puppetclass_ids"=>[], "operatingsystem_id"=>1, "hostgroup_id"=>181, "owner_type"=>"Usergroup", "compute_attributes"=>{}, "content_facet_attributes"=>{"content_source_id"=>9}, "subscription_facet_attributes"=>{}, "owner_id"=>"1", "host_parameters_attributes"=>[{"name"=>"patch_week", "value"=>"[FILTERED]"}, {"name"=>"patch_day", "value"=>"[FILTERED]"}, {"name"=>"patch_time", "value"=>"[FILTERED]"}], "location_id"=>3}, "apiv"=>"v2", "id"=>"76"}
2019-08-28T15:24:33 [W|app|b818df9d] Scoped order is ignored, it's forced to be batch order.
2019-08-28T15:24:33 [I|app|b818df9d] Authorized user timbrooks(Tim Brooks)
2019-08-28T15:24:33 [I|app|b818df9d] Current user set to timbrooks (admin)
2019-08-28T15:24:34 [I|app|b818df9d] Adding Compute instance for sysenga04a.example.us

==> /var/log/httpd/foreman-ssl_access_ssl.log <==
172.18.11.26 - - [28/Aug/2019:15:24:32 -0500] "PUT //api/hosts/76 HTTP/1.1" 422 385 "-" "rest-client/2.0.2 (darwin18 x86_64) ruby/2.3.7p456"

==> /var/log/foreman/production.log <==
2019-08-28T15:24:46 [W|app|b818df9d] Failed to create a compute sitea-vcenter.example.us (VMware) instance sysenga04a.example.us: DuplicateName: The name 'sysenga04a.example.us' already exists.

RbVmomi::Fault: DuplicateName: The name 'sysenga04a.example.us' already exists.
/opt/theforeman/tfm/root/usr/share/gems/gems/rbvmomi-2.0.1/lib/rbvmomi/vim/Task.rb:14:in `wait_for_completion'
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-3.0.0/lib/fog/vsphere/requests/compute/create_vm.rb:66:in `create_vm_on_storage_pod'
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-3.0.0/lib/fog/vsphere/requests/compute/create_vm.rb:36:in `create_vm'
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-3.0.0/lib/fog/vsphere/models/compute/server.rb:301:in `save'
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:470:in `create_vm'
/usr/share/foreman/app/models/concerns/orchestration/compute.rb:91: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'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:136:in `run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:816:in `_run_save_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/callbacks.rb:342:in `create_or_update'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/persistence.rb:275:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/validations.rb:46:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block (2 levels) in save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block in save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:325:in `rollback_active_record_state!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:309:in `save'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/suppressor.rb:44:in `save'
/usr/share/foreman/app/models/concerns/foreman/sti.rb:26:in `save'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.15.7/app/models/foreman_tasks/concerns/action_triggering.rb:27:in `block in save'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.15.7/app/models/foreman_tasks/concerns/action_triggering.rb:127:in `dynflow_task_wrap'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.15.7/app/models/foreman_tasks/concerns/action_triggering.rb:27:in `save'
/usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:161:in `update'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:194:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/usr/share/foreman/app/controllers/api/v2/base_controller.rb:163:in `disable_json_root'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/sweeper.rb:14:in `around'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/sweeper.rb:14:in `around'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:136:in `run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:41:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `block in instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `instrument'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:134:in `process'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/rendering.rb:32:in `process'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal.rb:191:in `dispatch'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal.rb:252:in `dispatch'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/mapper.rb:48:in `serve'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35:in `serve'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:840:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.14/lib/apipie/static_dispatcher.rb:65:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.14/lib/apipie/extractor/recorder.rb:137:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.14/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
/usr/share/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/etag.rb:25:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/conditional_get.rb:38:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/head.rb:12:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:98:in `run_callbacks'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/rack/logger.rb:38:in `call_app'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/rack/logger.rb:28:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.1/lib/katello/prevent_json_parsing.rb:12:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/runtime.rb:22:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-6.0.0/lib/secure_headers/middleware.rb:13:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/engine.rb:524:in `call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/railtie.rb:190:in `public_send'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/railtie.rb:190:in `method_missing'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/urlmap.rb:68:in `block in call'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `call'
/usr/share/passenger/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
/usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
/usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
/usr/share/passenger/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2019-08-28T15:24:46 [W|app|b818df9d] Rolling back due to a problem: [#<Orchestration::Task:0x00007f5baeed4408 @name="Set up compute instance sysenga04a.example.us", @id="Set up compute instance sysenga04a.example.us", @status="failed", @priority=3, @action=[#<Host::Managed id: 76, name: "sysenga04a.example.us", last_compile: "2019-08-28 19:21:08", last_report: nil, updated_at: "2019-08-28 19:21:26", created_at: "2019-08-28 19:21:05", root_pass: "$5$1NYltcuRVqXKlesU$F6GTNn1mkbpc35pWzI5hP.r.fCOl6W...", architecture_id: 1, operatingsystem_id: 1, environment_id: nil, ptable_id: 138, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: 1, hostgroup_id: 181, owner_id: 1, owner_type: "Usergroup", enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: 1, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 1, location_id: 3, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: 4, provision_method: nil, grub_pass: "$5$1NYltcuRVqXKlesU$F6GTNn1mkbpc35pWzI5hP.r.fCOl6W...", global_status: 1, lookup_value_matcher: "fqdn=sysenga05a.a.carfax.us", pxe_loader: nil, initiated_at: nil, build_errors: nil, chef_proxy_id: 1, chef_environment_id: 2, chef_private_key: nil, discovery_rule_id: nil>, :setCompute], @created=1567023874.4204156, @timestamp=2019-08-28 20:24:46 UTC>]
2019-08-28T15:24:46 [I|app|b818df9d] Processed 1 tasks from queue 'Host::Managed Main', completed 0/2
2019-08-28T15:24:46 [E|app|b818df9d] Task 'Set up compute instance sysenga04a.example.us' *failed*
2019-08-28T15:24:46 [E|app|b818df9d] Task 'Query instance details for sysenga04a.example.us' *canceled*
2019-08-28T15:24:46 [E|app|b818df9d] Unprocessable entity Host::Managed (id: 76):
  Failed to create a compute sitea-vcenter.example.us (VMware) instance sysenga04a.example.us: DuplicateName: The name 'sysenga04a.example.us' already exists.

Could you please provide us the exact hammer command you’ve used?

Regards,
Martin

hammer host update --name sysenga04a.example.us --operatingsystem "CentOS 7" --new-location "site a" --hostgroup alpha_a_vm --organization orgname

Any luck determining the difference in what I’m doing here with the hammer command with what the web interface is doing that is successful?

@tbrooks, if you are trying to update the hostgroup and not the host,
please try the using the following hammer command:
hammer hostgroup update --name alpha_a_vm --operatingsystem “CentOS 7” --location “site a” --organization orgname

@shiramax I’m trying to assign a hostgroup to a server that is migrating from an old katello system to our new one. When I select the hostgroup for the server in the GUI, and click submit, it works flawlessly. However, we need to automate our migration of server using hammer commands. But it looks like hammer is trying to create a host that already exists in our vcenter rather than just assign the hostgroup the way the GUI is doing it.

Have you tried via host-id instead of host-name ?

An other idea would be the usage of “hammer host set-parameter”

I found a solution. The two suggestions didn’t work. However, what I found is that if I went to the compute resource for the server that I’m migrating, searched for the server, and then clicked the “Associate VMs” button. Then follow that up by running a “hammer host update” with the flag “–managed true”. And finally, once the host is associated with the compute resource and managed, I can then run a "hammer host update and set the hostgroup correctly without getting “DuplicateName” error.

The only thing I need to know to fully automate this procedure is a way to run the “Associate VMs” through the command line instead of the web page. Would you know how to do that?