After upgrading to foreman 3.10, hosts created using libvirt compute resources lack vnc passwd in their definition.
Expected outcome:
Hosts created using libvirt are able to use vnc passwords
Foreman and Proxy versions:
3.10 Foreman and Proxy plugin versions:
3.10 Distribution and version:
rhel 8 Other relevant data:
It’s been working fine for years before 3.10. Not sure if it can be related to some fog:libvirt interaction and if it’s a general bug or something local to my installation. It’s unrelated to old bug of vnc passwords being longer than 8. If I shutdown the guest node after it’s created and manually alter it to enable vnc password, everything including novnc console works as expected.
It does not fail creating the host, it does not enable vnc password. And this can’t be enabled in libvirt on a running guest later, so it keeps running without password protection, fully open. Also another symptom is that pressing console button password assignation fails, same as in this old bug (Bug #10626: Openning a novnc console of a libvirt VM returns with error: "Failed to set console : call to VirDomainUpdateDeviceFlags failed : Internal error : unable to execute QEMU command 'set_password' : Could not set password" - Foreman)
With version 3.10 we can no longer use compute resources running CentOS 7.
It works with CentOS Stream 9 compute resources.
VNC console is not usable because no password is set - can be fixed after VM creation using virsh edit or Ansible. Requires VM shutdown (needs killing and restart the qemu process).
And after a restart VMs are again created with VNC password
This has some side effects. VMs are created using old fog-libvirt definition. So for example if you use a enterprise linux 9 they will fail if you don’t change cpu type from default to host-passthrough, but it’s a first step knowing this is a regression from 0.11 release
Error is due to a typo in server.rb at fog:libvirt
diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb
index 55241f2..2506561 100644
--- a/lib/fog/libvirt/models/compute/server.rb
+++ b/lib/fog/libvirt/models/compute/server.rb
@@ -408,7 +408,7 @@ module Fog
graphics.autoport = "yes"
end
graphics.listen = display[:listen] unless display[:listen].empty?
- graphics.password = display[:password] unless display[:password].empty?
+ graphics.passwd = display[:password] unless display[:password].empty?
xml.video do
xml.model(:type => "cirrus", :vram => 9216, :heads => 1)
@@ -678,7 +678,7 @@ module Fog
end
def default_display
- {:port => '-1', :listen => '127.0.0.1', :type => 'vnc', :password => '' }
+ {:port => '-1', :listen => '127.0.0.1', :type => 'vnc', :passwd => '' }
end
end
end
As a temporal solution you can apply that diff on fog:libvirt 0.12. File location is /usr/share/gems/gems/fog-libvirt-0.12.0/lib/fog/libvirt/models/compute/server.rb in a standard installation and run a restart.
I always do this procedure if edit some file manually into foreman