// Module included in the following assemblies:
//
//installing/installing_bare_metal/ipi/ipi-install-troubleshooting.adoc

:_mod-docs-content-type: PROCEDURE
[id="ipi-install-troubleshooting-cleaning-up-previous-installations_{context}"]
= Cleaning up previous installations

In case of an earlier failed deployment, remove the artifacts from the failed attempt before trying to deploy {product-title} again.

.Procedure

. Power off all bare-metal nodes before installing the {product-title} cluster by using the following command:
+
[source,terminal]
----
$ ipmitool -I lanplus -U <user> -P <password> -H <management_server_ip> power off
----

. Remove all old bootstrap resources if any remain from an earlier deployment attempt by using the following script:
+
[source,bash]
----
for i in $(sudo virsh list | tail -n +3 | grep bootstrap | awk {'print $2'});
do
  sudo virsh destroy $i;
  sudo virsh undefine $i;
  sudo virsh vol-delete $i --pool $i;
  sudo virsh vol-delete $i.ign --pool $i;
  sudo virsh pool-destroy $i;
  sudo virsh pool-undefine $i;
done
----

. Delete the artifacts that the earlier installation generated by using the following command:
+
[source,terminal]
----
$ cd ; /bin/rm -rf auth/ bootstrap.ign master.ign worker.ign metadata.json \
.openshift_install.log .openshift_install_state.json
----

. Re-create the {product-title} manifests by using the following command:
+
[source,terminal]
----
$ ./openshift-baremetal-install --dir ~/clusterconfigs create manifests
----
