Unable to create libvirt compute resource VM instances - Foreman 3.2.1 w/ Katello 4.4.1, AlmaLinux 8.6

Problem:
Fresh/newly installed Foreman 3.2.1 with katello 4.4.1 on AlmaLinux 8.6 VM is unable to provision new VMs on libvirtd compute resources. Error in GUI is as follows:

  • Failed to create a compute [compute resource] (Libvirt) instance sitea-syslog1.[redacted]: Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: VNC password is 16 characters long, only 8 permitted

Disabling “generate console passwords” does not solve the issue, as this causes a malformed XML file to be generated, using file as the source dev for the backing storage of the VM instead of dev for LVM storage pools:

  • [E|app|385ef156] Failed to save: Failed to power up a compute sitea-kvm (Libvirt) instance sitea-syslog1.[redacted]: Call to virDomainCreateWithFlags failed: internal error: process exited while connecting to monitor: 2022-07-15T23:51:46.516942Z qemu-kvm: -blockdev {“driver”:“file”,“filename”:“/dev/kvm_storage/sitea-syslog1-disk1”,“node-name”:“libvirt-1-storage”,“auto-read-only”:true,“discard”:“unmap”}: ‘file’ driver requires ‘/dev/kvm_storage/sitea-syslog1-disk1’ to be a regular file

Expected outcome:
Provisioning of libvirt resource completes.

Foreman and Proxy versions:
rubygem-foreman_puppet-3.0.7-1.fm3_2.el8.noarch
foreman-libvirt-3.2.1-1.el8.noarch
foreman-service-3.2.1-1.el8.noarch
foreman-installer-3.2.1-2.el8.noarch
foreman-release-3.2.1-1.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.fm3_0.el8.noarch
rubygem-foreman_discovery-20.0.1-1.fm3_2.el8.noarch
rubygem-foreman_openscap-5.2.1-1.fm3_2.el8.noarch
rubygem-foreman_remote_execution-6.0.0-1.fm3_2.el8.noarch
foreman-proxy-3.2.1-1.el8.noarch
rubygem-hammer_cli_foreman_puppet-0.0.5-1.fm3_2.el8.noarch
rubygem-foreman_ansible-7.1.0-1.fm3_2.el8.noarch
foreman-3.2.1-1.el8.noarch
foreman-postgresql-3.2.1-1.el8.noarch
rubygem-foreman_templates-9.1.0-1.fm2_6.el8.noarch
rubygem-hammer_cli_foreman-3.2.0-1.20220214175116git323f240.el8.noarch
foreman-installer-katello-3.2.1-2.el8.noarch
foreman-debug-3.2.1-1.el8.noarch
foreman-dynflow-sidekiq-3.2.1-1.el8.noarch
rubygem-foreman_maintain-1.0.10-1.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.17-1.fm3_2.el8.noarch
rubygem-foreman-tasks-6.0.1-1.fm3_2.el8.noarch
foreman-selinux-3.2.1-1.el8.noarch
foreman-cli-3.2.1-1.el8.noarch

Foreman and Proxy plugin versions:
katello-certs-tools-2.8.2-1.el8.noarch
katello-selinux-4.0.2-1.el8.noarch
rubygem-katello-4.4.1-1.el8.noarch
katello-repos-4.4.1-1.el8.noarch
katello-client-bootstrap-1.7.8-1.el8.noarch
foreman-installer-katello-3.2.1-2.el8.noarch
rubygem-hammer_cli_katello-1.4.1-1.el8.noarch
katello-debug-4.4.1-1.el8.noarch
katello-common-4.4.1-1.el8.noarch
katello-4.4.1-1.el8.noarch

Distribution and version:
AlmaLinux 8.6

Other relevant data:

Compute resource is specified as libvirt and with vnc password generated (see attached).

Connection has been validated and tested. Below are the production logs from the provisioning. There are a few things that come to mind, but I’m not familiar enough with Foreman’s code base…

First, tmk, looks like password length is set here: https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/libvirt.rb#L173-L175 for compute resources. My assumption is that this would set the console password to a length of 8 per this PR: Fixes #35035 - set VNC password length to 8 chars. · theforeman/foreman@4ea1a6b · GitHub ; but it looks like some value is missing from the run from the call to the fog-libvirt gem. But I am not sure…

PRODUCTION.LOG excerpt

2022-07-16T00:11:30 [I|app|cb27df9a] Started GET "/notification_recipients" for 172.31.253.224 at 2022-07-16 00:11:30 +0000
2022-07-16T00:11:30 [I|app|cb27df9a] Processing by NotificationRecipientsController#index as JSON
2022-07-16T00:11:30 [I|app|cb27df9a] Completed 200 OK in 15ms (Views: 0.1ms | ActiveRecord: 10.0ms | Allocations: 2323)
2022-07-16T00:11:31 [I|app|53766231] Started POST "/hosts" for 172.31.253.224 at 2022-07-16 00:11:31 +0000
2022-07-16T00:11:31 [I|app|53766231] Processing by HostsController#create as */*
2022-07-16T00:11:31 [I|app|53766231]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"in/F7CseBQvxdft8WNusbDrtqBplsrh1qI75maj1hSnbFqVOoj6ktBnlf57qIo6GtkNWlF8BjprT6B3g5cc5Xw==", "host"=>{"name"=>"sitea-syslog1", "organization_id"=>"1", "location_id"=>"2", "hostgroup_id"=>"14", "compute_resource_id"=>"10", "compute_profile_id"=>"4", "content_facet_attributes"=>{"lifecycle_environment_id"=>"2", "content_view_id"=>"2", "content_source_id"=>"1", "kickstart_repository_id"=>""}, "puppet_attributes"=>{"environment_id"=>"2"}, "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "identifier"=>"eth0", "name"=>"sitea-syslog1", "domain_id"=>"1", "subnet_id"=>"1", "ip"=>"10.25.155.44", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "execution"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"bridge", "bridge"=>"br-private", "model"=>"virtio"}}}, "compute_attributes"=>{"cpus"=>"12", "cpu_mode"=>"host-passthrough", "memory"=>"25769803776", "start"=>"1", "volumes_attributes"=>{"0"=>{"_delete"=>"", "pool_name"=>"kvm_storage", "capacity"=>"2048G", "allocation"=>"2048G", "format_type"=>"raw"}}}, "architecture_id"=>"1", "operatingsystem_id"=>"2", "provision_method"=>"build", "build"=>"1", "medium_id"=>"15", "ptable_id"=>"205", "pxe_loader"=>"PXELinux BIOS", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"4-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "media_selector"=>"install_media"}
2022-07-16T00:11:31 [W|api|53766231] param host[puppetclass_*] has been deprecated in favor of host[puppet_attributes][puppetclass_*]
2022-07-16T00:11:31 [W|app|53766231] Scoped order is ignored, it's forced to be batch order.
2022-07-16T00:11:32 [I|app|53766231] Adding Compute instance for sitea-syslog1.[redacted]
2022-07-16T00:11:32 [W|app|53766231] Unhandled Libvirt error
2022-07-16T00:11:32 [I|app|53766231] Backtrace for 'Unhandled Libvirt error' error (Fog::Errors::Error): Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: VNC password is 16 characters long, only 8 permitted
 53766231 | /usr/share/gems/gems/fog-libvirt-0.9.0/lib/fog/libvirt/models/compute/server.rb:71:in `rescue in save'
 53766231 | /usr/share/gems/gems/fog-libvirt-0.9.0/lib/fog/libvirt/models/compute/server.rb:63:in `save'
 53766231 | /usr/share/foreman/app/models/compute_resources/foreman/model/libvirt.rb:162:in `create_vm'
 53766231 | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:107:in `setCompute'
 53766231 | /usr/share/foreman/app/models/concerns/orchestration.rb:227:in `execute'
 53766231 | /usr/share/foreman/app/models/concerns/orchestration.rb:152:in `block in process'
 53766231 | /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `each'
 53766231 | /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `process'
 53766231 | /usr/share/foreman/app/models/concerns/orchestration.rb:44:in `around_save_orchestration'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:139:in `run_callbacks'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/callbacks.rb:327:in `create_or_update'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/timestamp.rb:128:in `create_or_update'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:470:in `save'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/validations.rb:47:in `save'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:314:in `block in save'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:212:in `transaction'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/transactions.rb:314:in `save'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/suppressor.rb:44:in `save'
 53766231 | /usr/share/foreman/app/models/concerns/foreman/sti.rb:26:in `save'
 53766231 | /usr/share/foreman/app/controllers/hosts_controller.rb:97:in `create'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/base.rb:195:in `process_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
 53766231 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
 53766231 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
 53766231 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
 53766231 | /usr/share/gems/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
 53766231 | /usr/share/gems/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:139:in `run_callbacks'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/callbacks.rb:41:in `process_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/rescue.rb:22:in `process_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:180:in `block in instrument'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:180:in `instrument'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
 53766231 | /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/base.rb:136:in `process'
 53766231 | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/rendering.rb:39:in `process'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal.rb:190:in `dispatch'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal.rb:254:in `dispatch'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/journey/router.rb:49:in `block in serve'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/journey/router.rb:32:in `each'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/journey/router.rb:32:in `serve'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/route_set.rb:834:in `call'
 53766231 | /usr/share/gems/gems/katello-4.4.1/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 53766231 | /usr/share/gems/gems/katello-4.4.1/lib/katello/middleware/event_daemon.rb:10:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/apipie-dsl-2.4.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 53766231 | /usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/static_dispatcher.rb:66:in `call'
 53766231 | /usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/extractor/recorder.rb:137:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 53766231 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 53766231 | /usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 53766231 | /usr/share/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/conditional_get.rb:40:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
 53766231 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/cookies.rb:648:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:101:in `run_callbacks'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 53766231 | /usr/share/gems/gems/railties-6.0.3.7/lib/rails/rack/logger.rb:37:in `call_app'
 53766231 | /usr/share/gems/gems/railties-6.0.3.7/lib/rails/rack/logger.rb:28:in `call'
 53766231 | /usr/share/gems/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 53766231 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/request_id.rb:27:in `call'
 53766231 | /usr/share/gems/gems/katello-4.4.1/lib/katello/prevent_json_parsing.rb:12:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
 53766231 | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/executor.rb:14:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
 53766231 | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
 53766231 | /usr/share/gems/gems/secure_headers-6.3.0/lib/secure_headers/middleware.rb:11:in `call'
 53766231 | /usr/share/gems/gems/railties-6.0.3.7/lib/rails/engine.rb:527:in `call'
 53766231 | /usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:190:in `public_send'
 53766231 | /usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:190:in `method_missing'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
 53766231 | /usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
 53766231 | /usr/share/gems/gems/puma-5.5.2/lib/puma/configuration.rb:249:in `call'
 53766231 | /usr/share/gems/gems/puma-5.5.2/lib/puma/request.rb:77:in `block in handle_request'
 53766231 | /usr/share/gems/gems/puma-5.5.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
 53766231 | /usr/share/gems/gems/puma-5.5.2/lib/puma/request.rb:76:in `handle_request'
 53766231 | /usr/share/gems/gems/puma-5.5.2/lib/puma/server.rb:447:in `process_client'
 53766231 | /usr/share/gems/gems/puma-5.5.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
 53766231 | /usr/share/gems/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2022-07-16T00:11:32 [W|app|53766231] Failed to create a compute sitea-kvm (Libvirt) instance sitea-syslog1.[redacted]: Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: VNC password is 16 characters long, only 8 permitted
 53766231 |
2022-07-16T00:11:32 [I|app|53766231] Backtrace for 'Failed to create a compute sitea-kvm (Libvirt) instance sitea-syslog1.[redacted]: Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: VNC password is 16 characters long, only 8 permitted
 53766231 |  ' error (Fog::Errors::Error): Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: VNC password is 16 characters long, only 8 permitted

The VNC password issue was Bug #35035: VM creation is broken with libvirt >= 8.0.0 due to VNC password length - Foreman and should be fixed in Foreman 3.4

Hello from 2023!

I can reproduce this problem with a LVM-backed libvirtd storage pool and creating a VM from the Foreman webUI.

I have done some digging today and it seems to be a change to newer qemu version (I’m testing with CentOS Stream 9) no longer accepting disk type of ‘file’ pointing to a block device:

And indeed Foreman managed to create the VM in libvirtd but is unable to start it because qemu-kvm errors out with error similar to:

'file' driver requires '/dev/VG/FQDN-disk1' to be a regular file

If we change the file driver to block we can start the VM:

# diff orig.xml new.xml
26c26
<     <disk type='file' device='disk'>
---
>     <disk type='block' device='disk'>
28c28
<       <source file='/dev/VolGroup01/fqdn-disk1'/>
---
>       <source dev='/dev/VolGroup01/fqdn-disk1'/>
# virsh start fqdn
Domain 'fqdn' started

Now question: is there a way to teach Foreman to either use the right disk “type” automagically or add an option for users to choose the disk type?

Looking forward to hear from you guys.

Found @ekohl 's fix here:

:heart:

2 Likes

How can we apply this fix to Foreman?

It’s been fixed in release 3.9.