ocp-power-automation / ocp4-upi-kvm

OCP4 on KVM/Power
Apache License 2.0
17 stars 20 forks source link

Libvirt/KVM error on RHEL8 #80

Closed mgiessing closed 3 years ago

mgiessing commented 3 years ago

Hi, when running the ocp4-upi-kvm (release 4.5) repo on RHEL8 KVM Host I get the following error: (on RHEL7 it works without problems)

Error: Error creating libvirt domain: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: 2021-01-29T11:37:56.466288Z qemu-kvm: Requested count cache flush assist capability level not supported by kvm, try appending -machine cap-ccf-assist=off')

  on modules/1_prepare/prepare.tf line 68, in resource "libvirt_domain" "bastion":
  68: resource "libvirt_domain" "bastion" {

Error: Error creating libvirt domain: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: 2021-01-29T11:37:58.788347Z qemu-kvm: Requested count cache flush assist capability level not supported by kvm, try appending -machine cap-ccf-assist=off')

  on modules/4_nodes/nodes.tf line 140, in resource "libvirt_domain" "bootstrap":
 140: resource "libvirt_domain" "bootstrap" {

[...]

I've installed and configured virsh like this:

yum install libvirt-devel libvirt-daemon-kvm libvirt-client -y
systemctl enable --now libvirtd   

sed -i 's/#listen_tls = 0/listen_tls = 0/g' /etc/libvirt/libvirtd.conf
sed -i 's/#listen_tcp = 1/listen_tcp = 1/g' /etc/libvirt/libvirtd.conf
sed -i 's/#tcp_port = "16509"/tcp_port = "16509"/g' /etc/libvirt/libvirtd.conf
sed -i 's/#auth_tcp = "sasl"/auth_tcp = "none"/g' /etc/libvirt/libvirtd.conf

# on RHEL8 '--listen' parameter is not used anymore and therefore must be commented out and libvirtd-tcp.socket must be started BEFORE libvirtd is started
# source: https://bugzilla.redhat.com/show_bug.cgi?id=1741403
if test "$(rpm -E %rhel)" = "7"
then
    sed -i 's/#LIBVIRTD_ARGS="--listen"/LIBVIRTD_ARGS="--listen"/g' /etc/sysconfig/libvirtd
elif test "$(rpm -E %rhel)"  = "8"
then
    systemctl stop libvirtd 
    systemctl start libvirtd-tcp.socket
fi
systemctl restart libvirtd 

Here's the virsh version output:

[root@p605-met1 ocp4-upi-kvm]# virsh version
setlocale: No such file or directory
Compiled against library: libvirt 6.0.0
Using library: libvirt 6.0.0
Using API: QEMU 6.0.0
Running hypervisor: QEMU 4.2.0

Any help appreciated!

yussufsh commented 3 years ago

I got similar error when I had upgraded the libvirt version to 6.0. As per https://access.redhat.com/solutions/4644591 we need to upgrade the firmware to be able to boot VMs on P8. I had another Habanero where I have installed RHEL 8.3 and was able to use the automation directly.

This is the older firmware which cannot be used:

# lsmcode
Version of System Firmware :
 Product Name          : OpenPOWER Firmware
 Product Version       : IBM-plat-ibm-v00.06-dirty
 Product Extra         :        hostboot-bc98d0b-opdirty-41a200f
 Product Extra         :        occ-0362706-opdirty
 Product Extra         :        skiboot-5.1.5-opdirty-8f25d7e
 Product Extra         :        hostboot-binaries-43d5a59-opdirty
 Product Extra         :        saba-xml-001-opdirty
 Product Extra         :        capp-ucode-105cb8f-opdirty

This is where it works:

# lsmcode
Version of System Firmware :
 Product Name          : OpenPOWER Firmware
 Product Version       : IBM-habanero-OP8_v1.12_2.96
 Product Extra         :        op-build-v2.3-5-g98aa884
 Product Extra         :        skiboot-v6.3.1
 Product Extra         :        bmc-firmware-version-2.16
 Product Extra         :        occ-p8-a2856b7
 Product Extra         :        hostboot-p8-c893515-pd6f049d
 Product Extra         :        buildroot-2019.02.1-16-ge01dcd0
 Product Extra         :        capp-ucode-p9-dd2-v4
 Product Extra         :        machine-xml-c3998a5
 Product Extra         :        hostboot-binaries-hw041519a.opv23
 Product Extra         :        petitboot-v1.10.3
 Product Extra         :        linux-5.0.7-openpower1-p8e31f00
lukebrowning commented 3 years ago

We use P8 servers all the time. On a couple of them, I had to update the firmware. I wrote a script to disable some kvm capabilities that are not available or properly implemented on the older firmware. I wrote the script because I couldn't require every user to update their firmware.

BTW, you can use this project ocs-upi-kvm to create an OCP cluster if you like. If you are just trying to create a OCP cluster, you just need to invoke one command - create-ocp.sh. It will install and configure the host server for you.

yussufsh commented 3 years ago

This is not related to the Terraform automation provided by this project. Hence closing. We have good results with Libvirt 6.0 on Habanero.