Adjust bifrost node provisioning timeout and fix file permissions
[releng.git] / prototypes / bifrost / scripts / destroy_env.sh
1 # SPDX-license-identifier: Apache-2.0
2 ##############################################################################
3 # Copyright (c) 2016 RedHat and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 #!/bin/bash
10 virsh destroy jumphost.opnfvlocal || true
11 virsh destroy controller00.opnfvlocal || true
12 virsh destroy compute00.opnfvlocal || true
13 virsh undefine jumphost.opnfvlocal || true
14 virsh undefine controller00.opnfvlocal || true
15 virsh undefine compute00.opnfvlocal || true
16
17 service ironic-conductor stop
18
19 echo "removing from database"
20 mysql -u root ironic --execute "truncate table ports;"
21 mysql -u root ironic --execute "delete from node_tags;"
22 mysql -u root ironic --execute "delete from nodes;"
23 mysql -u root ironic --execute "delete from conductors;"
24 echo "removing leases"
25 > /var/lib/dnsmasq/dnsmasq.leases
26 echo "removing logs"
27 rm -rf /var/log/libvirt/baremetal_logs/*.log
28
29 # clean up images
30 rm -rf /httpboot/*
31 rm -rf /tftpboot/*
32 rm -rf /var/lib/libvirt/images/*.qcow2
33
34 echo "restarting services"
35 service libvirtd restart
36 service ironic-api restart
37 service ironic-conductor start
38 service ironic-inspector restart