---
title: 清理环境
description: "如果需要重新安装ovirt-engine软件，安装前需要先清理环境。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengcpfs/ecosystemEnable/oVirt/kunpengovirtoe_04_0009.html
sourcePath: /source/zh/kunpengcpfs/ecosystemEnable/oVirt/kunpengovirtoe_04_0009.html
indexId: 29b83492979e31f10e2fd7ad47035f010fc3dff9d1e221cb35917e1d6f94b53072
---
# 清理环境

如果需要重新安装ovirt-engine软件，安装前需要先清理环境。

执行以下命令清理环境。

```
engine-cleanup
```

返回successfully表示成功清理环境。预期结果示例：

```
[ INFO  ] Stage: Initializing
[ INFO  ] Stage: Environment setup
Configuration files: /etc/ovirt-engine-setup.conf.d/10-packaging.conf, /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf
Log file: /var/log/ovirt-engine/setup/ovirt-engine-remove-20180626122314-u9w0ab.log
Version: otopi-1.9.1 (otopi-1.9.1-1.el8)
[ INFO  ] Stage: Environment packages setup
[ INFO  ] Stage: Programs detection
[ INFO  ] Stage: Environment customization
[WARNING] Host name hosted-engine-test1 has no domain suffix
[WARNING] Failed to resolve hosted-engine-test1 using DNS, it can be resolved only locally

--== PRODUCT OPTIONS ==--

[ INFO  ] Stage: Setup validation
During execution engine service will be stopped (OK, Cancel) [OK]:
All the installed ovirt components are about to be removed, data will be lost (OK, Cancel) [Cancel]: OK
[ INFO  ] Stage: Transaction setup
[ INFO  ] Stopping engine service
[ INFO  ] Stopping ovirt-fence-kdump-listener service
[ INFO  ] Stopping dwh service
[ INFO  ] Stopping vmconsole-proxy service
[ INFO  ] Stopping websocket-proxy service
[ INFO  ] Stage: Misc configuration (early)
[ INFO  ] Stage: Package installation
[ INFO  ] Stage: Misc configuration
[ INFO  ] Backing up PKI configuration and keys
[ INFO  ] Backing up database localhost:engine to '/var/lib/ovirt-engine/backups/engine-20180626122330.rrqbm6_o.dump'.
[ INFO  ] Clearing Engine database engine
[ INFO  ] Backing up database localhost:ovirt_engine_history to '/var/lib/ovirt-engine-dwh/backups/dwh-20180626122339.zdh7z31h.dump'.
[ INFO  ] Clearing DWH database ovirt_engine_history
[ INFO  ] Removing files
[ INFO  ] Reverting changes to files
[ INFO  ] Stage: Transaction commit
[ INFO  ] Stage: Closing up

--== SUMMARY ==--

Engine setup successfully cleaned up
A backup of PKI configuration and keys is available at /var/lib/ovirt-engine/backups/engine-pki-20180626122329oa2dzd61.tar.gz
ovirt-engine has been removed
A backup of the Engine database is available at /var/lib/ovirt-engine/backups/engine-20180626122330.rrqbm6_o.dump
A backup of the DWH database is available at /var/lib/ovirt-engine-dwh/backups/dwh-20180626122339.zdh7z31h.dump

--== END OF SUMMARY ==--

[ INFO  ] Stage: Clean up
Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-remove-20180626122314-u9w0ab.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20180626122410-cleanup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ INFO  ] Execution of cleanup completed successfully
```
