Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1528816

Summary: vdsm-tool remove-config does not revert changes
Product: [oVirt] vdsm Reporter: Yedidyah Bar David <didi>
Component: ToolsAssignee: Yaniv Bronhaim <ybronhei>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.20.9CC: bugs, mperina, pmatyas
Target Milestone: ovirt-4.2.1Keywords: ZStream
Target Release: 4.20.11Flags: rule-engine: ovirt-4.2+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1530630 (view as bug list) Environment:
Last Closed: 2018-02-12 11:57:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1528813, 1530630    

Description Yedidyah Bar David 2017-12-24 11:48:56 UTC
Description of problem:

See bug 1528813.

ovirt-hosted-engine-cleanup calls 'vdsm-tool remove-config', but this leaves at least some files changed by vdsm with the changes.

First one I noticed is that libvirtd fails to start with:

Dec 24 13:21:57 lvc7host1.home.local libvirtd[16297]: 2017-12-24 11:21:57.641+0000: 16297: error : virNetTLSContextCheckCertFile:120 : Cannot read CA certificate '/etc/pki/vdsm/certs/cacert.pem': No such file or directory

Because /etc/libvirt/libvirtd.conf has:

## beginning of configuration section by vdsm-4.20.0
auth_unix_rw="sasl"
ca_file="/etc/pki/vdsm/certs/cacert.pem"
cert_file="/etc/pki/vdsm/certs/vdsmcert.pem"
host_uuid="88f843a0-fdda-4eb2-bdb4-b6edacd7ad6e"
keepalive_interval=-1
key_file="/etc/pki/vdsm/keys/vdsmkey.pem"
unix_sock_group="qemu"
unix_sock_rw_perms="0770"
## end of configuration section by vdsm-4.20.0

which is not removed, while the cleanup script later does remove vdsmcert.pem , so libvirtd fails to read it.

Version-Release number of selected component (if applicable):

Current master

How reproducible:

Not sure, I think always

Steps to Reproduce:
1. deploy hosted-engine. It's probably enough to 'vdsm-tool configure --force'.
2. vdsm-tool remove-config
3.

Actual results:

All configuration files changed by (1.) are reverted to their original state.

Expected results:

At least some are not.

Additional info:

Comment 2 Petr Matyáš 2018-01-08 15:08:00 UTC
Testing on vdsm-4.20.9.3-1.el7.centos.x86_64

Still fails to run libvirtd with Jan  8 16:03:43 localhost libvirtd: 2018-01-08 15:03:43.760+0000: 5187: error : virNetTLSContextCheckCertFile:120 : Cannot read CA certificate '/etc/pki/vdsm/certs/cacert.pem': No such file or directory

[root@$hostname ~]# tail -10 /etc/libvirt/libvirtd.conf
## beginning of configuration section by vdsm-4.20.0
auth_unix_rw="sasl"
ca_file="/etc/pki/vdsm/certs/cacert.pem"
cert_file="/etc/pki/vdsm/certs/vdsmcert.pem"
host_uuid="$uuid"
keepalive_interval=-1
key_file="/etc/pki/vdsm/keys/vdsmkey.pem"
unix_sock_group="qemu"
unix_sock_rw_perms="0770"
## end of configuration section by vdsm-4.20.0

Comment 3 Yaniv Bronhaim 2018-01-09 06:44:43 UTC
vdsm-4.20.9.3 does not include the fix. please verify with http://gerrit.ovirt.org/85719 - the section is removed after running remove-config

Comment 4 Yaniv Bronhaim 2018-01-09 06:48:00 UTC
my verification is the following, correct me if your scenario is different:

~ tail -10 /etc/libvirt/libvirtd.conf
## beginning of configuration section by vdsm-4.20.0
auth_unix_rw="sasl"
ca_file="/etc/pki/vdsm/certs/cacert.pem"
cert_file="/etc/pki/vdsm/certs/vdsmcert.pem"
host_uuid="09528c43-d5f5-4012-9244-239ab8d0f35a"
keepalive_interval=-1
key_file="/etc/pki/vdsm/keys/vdsmkey.pem"
unix_sock_group="qemu"
unix_sock_rw_perms="0770"
## end of configuration section by vdsm-4.20.0

~ vdsm-tool remove-config
~ tail -10 /etc/libvirt/libvirtd.conf
#admin_keepalive_count = 5

###################################################################
# Open vSwitch:
# This allows to specify a timeout for openvswitch calls made by
# libvirt. The ovs-vsctl utility is used for the configuration and
# its timeout option is set by default to 5 seconds to avoid
# potential infinite waits blocking libvirt.
#
#ovs_timeout = 5

Comment 5 Petr Matyáš 2018-01-09 09:13:52 UTC
I tried running 'vdsm-tool remove-config' and also 'ovirt-hosted-engine-cleanup'

I will reverify when new package with this change is built and included

Comment 6 Martin Perina 2018-01-09 09:55:54 UTC
The fix is part 4.2.1-1 build

Comment 7 Petr Matyáš 2018-01-12 11:24:49 UTC
Verified on vdsm-4.20.13-1.el7.centos.x86_64

Comment 8 Sandro Bonazzola 2018-02-12 11:57:02 UTC
This bugzilla is included in oVirt 4.2.1 release, published on Feb 12th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.1 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.