Commit Graph

62 Commits

Author SHA1 Message Date
Michal Nasiadka 40cf91aab6 cleanup: fix cleanup containers
Currently the script only stops containers and removes services,
without disabling service or removing symlink - which renders the
service in a not-found state.
After we disable and stop - some of the services end up in failed
state (due to wrong exit codes for various reasons) - running
reset-failed fixes that.

Change-Id: I637783ce758dbf1c2a7b4b99aa6b61e2c5ca1460
2023-08-28 13:05:02 +00:00
Martin Hiner 53e8b80ed3 Add container engine option to scripts
This patch add a way to choose container engine inside tool and test
scripts. This is in preparation for Podman introduction but still
leaves Docker as default container engine.

Signed-off-by: Martin Hiner <m.hiner@partner.samsung.com>
Change-Id: I395d2bdb0dfb4b325b6ad197c8893c8a0f768324
2023-04-28 16:16:55 +02:00
Martin Hiner 4866017e52 Add systemd container control
This commit adds SystemdWorker class to kolla_docker ansible module.
It is used to manage container state via systemd calls.

Change-Id: I20e65a6771ebeee462a3aaaabaa5f0596bdd0581
Signed-off-by: Ivan Halomi <i.halomi@partner.samsung.com>
Signed-off-by: Martin Hiner <m.hiner@partner.samsung.com>
2023-01-19 10:38:41 +01:00
Bryan Schwerer 570a1d4339 Corrected the config file to use when stopping neutron-openvswitch-agent
The use of file ml12_conf.ini has been deprecated, replaced by /etc/neutron/plugins/ml2/openvswitch_agent.ini.

The command to cleanup the agent still references the old file.  Just fix the filename

https: //bugs.launchpad.net/kolla-ansible/+bug/1982222
Change-Id: I0fe7f68eda55e0c7d9960016bba74f5ba1ae223e
2022-07-19 16:43:31 -04:00
Marc 'risson' Schmitt 839ec629bf
tools: use /usr/bin/env bash instead of /bin/bash
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Change-Id: I374f7427a4318d00ca474367818117e11789ec13
2021-08-17 14:29:33 +02:00
likui 8d458e95a4 Delete the /var/log/kolla directory should use sudo
Change-Id: Iff699b6dd9417e2e72618263641cbfa6ccb6e585
Related-Bug: #1892341
2020-08-20 18:00:31 +08:00
Mark Goddard b123bf6621 Use become for all docker tasks
Many tasks that use Docker have become specified already, but
not all. This change ensures all tasks that use the following
modules have become:

* kolla_docker
* kolla_ceph_keyring
* kolla_toolbox
* kolla_container_facts

It also adds become for 'command' tasks that use docker CLI.

Change-Id: I4a5ebcedaccb9261dbc958ec67e8077d7980e496
2019-06-06 19:04:58 +01:00
binhong.hua 93e5e8e631 Link kolla_log volume dir to /var/log/kolla
The path /var/lib/docker/volumes/kolla_logs/_data/ is too long
shorter log path will help to debug from log.
The volume path is compatible with docker-engine and docker-ce.

Change-Id: I9195d5f24d938f5060fe748aac3ae58c79ec5abf
2019-01-24 11:02:48 +08:00
Jorge Niedbalski 6c5a6c65f1 Enforce removal of container network namespace.
This patch enforces the removal of the container
network namespace when the environment is destroyed.

Closes-Bug: #1769651

Change-Id: I9b0bbbb5a59e6067a745635c555051ef97b79f9a
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
2018-05-07 16:23:02 -03:00
liyingjun 479d567177 Removing ovs bridge before destroying container
Change-Id: I0fac4cef9e961b1d64f269bfc27804e77f4ea842
Closes-bug: #1689422
2017-05-19 10:46:12 +08:00
caoyuan a565925b0f Fix the remove mariadb volume failed
- when run tools/cleanup-containers mariadb, the mariadb volume remove
failed, because the "volumes_to_remove" can't catch the mariadb
volume, this patch to fix it.

- remove the unnecessary "()"

more test infomation, see http://paste.openstack.org/show/603359/

Closes-Bug: #1674207

Change-Id: I82f5922fcc84d222f74d2551a2c697bf78136a2d
2017-03-20 04:40:33 +00:00
Eduardo Gonzalez 1a54266029 Ignore qemu-img process in cleanup-containers
Change-Id: I059b0aafbf93cf8c131beba47ca6f6718ec5fb36
Closes-Bug: #1586548
2017-02-02 09:49:12 +00:00
Eduardo Gonzalez 0581d3b319 Fix cleanup-containers script
kolla-ansible destroy properly fails if qemu processes
are running in compute nodes.
Manually executing ./cleanup-container won't because
$COMPUTE variable is not defined anywhere.

Change-Id: I304c59ec682a93035e631490bbba7b355b1fcae2
Closes-Bug: #1656864
2017-01-17 15:52:24 +00:00
caowei 1063f73620 Fix cleanup-containers
qemu-ga should be excluded

Change-Id: I89474758a45e52c6c2da7307764344863e065aed
Closes-Bug: #1655838
2017-01-12 18:22:38 +08:00
Eduardo Gonzalez da83802b1b Fix ovs-cleanup issue at cleanup scripts
Move ovs-cleanup step to cleanup-containers,
otherwise bridges will not be removed because neutron_openvswitch_agent
container does not exists after running cleanup-containers.

Add logic to cleanup ovs bridges only when openvswitch_db
is removed and openvswitch-agent is running,
so when removing other container from a parameter at script
invocation ovs-cleanup will not be executed.

Change-Id: Ie5fea40426df0e9e465fc173aba185f61098f676
Closes-Bug: #1640178
2016-12-30 14:10:30 +01:00
Borne Mace eb138539f2 Ignore dom0 qemu processes during destroy
Updates cleanup-containers to disclude lines related to
dom0 qemu processes.

Change-Id: I0b71ed29b9a2f239ebfdaa66b7cbe41eeaf2773c
Partially-Implements: blueprint xen-hypervisor-support
2016-11-23 14:26:57 -08:00
liyingjun d5fe8a30f9 Cleanup container script improvement
Currently, when there are some qemu processes which may be some useful
virtual machines running by the operator running on non compute node, the
cleanup script will fail the cleanup operation for that node. We need to
ignore the qemu process check for non compute nodes.

Change-Id: If49a1a30764063935b2a65312de8f3b2357c7fbc
Closes-bug: 1633005
2016-10-13 17:31:17 +08:00
Sean Mooney f0aa137a1d move ovs cleanup to tools/cleanup-host
- One of the usecase supported by tools/cleanup-containers
  was the ablity to remove container with a regex so that
  you could redepoloy just that single componet.
- By cleaning up ovs in cleanup-containers that is nolonger
  possible.
- This change move the cleanup of ovs from,
  tools/cleanup-contianers to tools/cleanup-hosts

TrivialFix

Change-Id: If2001130f4a2400555ce4d9ac5ee506482e4c25e
2016-09-12 20:46:56 +01:00
luyao cf2ff03d60 TrivialFix: Delete virtual bridge artifacts when cleaning hosts
After cleaning hosts by using tools/cleanup_host, some of the ovs bridge
devices such as ovs-system still exist. This will result in
{{neutron_external_interface}} not working properly because it had been
added to the ovs-system bridge. The solution is calling
neutron-ovs-cleanup script in neutron_openvswitch_agent container before
removing it.

TrivialFix

Change-Id: Ib3b096d842f2210b8bd223892a3492ef2fcf7c52
Signed-off-by: luyao <lu.yao135@zte.com.cn>
2016-09-06 09:05:30 +00:00
Michal (inc0) Jastrzebski f76e9a1e0d Make cleanup remove restarting/exited containers
If we have bug in contianer or it simplt somehow ended up in Exited
state, cleanup doesn't flush it. It also means it doesn't flush volumes
and that might cause an dirty env.

Closes-Bug: #1587344
Change-Id: Ib5705992500ce7efdc66509df61c381bd33d1954
2016-06-14 16:59:41 +00:00
Carlos Cesario 7bce0993df Make "cleanup-containers" script works dynamically
Make cleanup-containers works dynamically. The script
removes the containers and its volumes dynamically based
on label contained in each kolla container, this way is not
needed create a big container and volume lists to be deleted.

http://paste.openstack.org/show/496357/

Closes-Bug: #1579044
Change-Id: Ie0d8a38ba2cf77c8d5da655958407145f4105bec
2016-05-06 13:12:36 -03:00
prithiv 0fda8badd2 Deletes fake containers on cleanup
Closes-Bug: #1576277

Change-Id: Ie68d1d5da620f26a0aa21aa5c6473bc464994ed8
2016-05-05 08:24:37 +00:00
Mauricio Lima 404dd842ea Add mongodb in cleanup containers script
Change-Id: I0901802e0e349956f2c01dcd86746b4de0cc2382
Closes-Bug: #1567642
2016-04-07 16:21:33 -04:00
Mauricio Lima f0ad131a87 Add nova_ssh in cleanup containers script
Closes-Bug: #1566281
Change-Id: I84533a066a2dbc4de282b20785092350607c5971
2016-04-05 08:16:50 -04:00
Mauricio Lima b9603d35e7 Remove bootstrap_mariadb with cleanup-containers
TrivialFix

Change-Id: Ic6884d46d8edf2d430f8a9fb8635f7d98d011112
2016-03-28 13:00:29 -04:00
SamYaple b98bc3a458 Change libvirt volume name to libvirtd
This change is a "futureproofing" thing. It has already been discussed
that libvirt should not be a child of nova and should be removed out
to the base docker directory (just like openvswitch isn't a child of
neutron). That is not going to happen this cycle but when it does we
can't change the name of the volume. This updates the volumes to the
proper name of libvirtd. This is in contrast with the libvirtlogd
volume that will be needed in newton due to libvirt 1.3

Of note, the container can remain named nova_libvirt since we can
change that on the fly later without breaking instances.

This wont break liberty as named_volumes are not backported yet.

TrivialFix

Change-Id: I16cf9e1b1dbba9b5a9f5cc883494580e276d4f72
2016-03-15 22:41:00 +00:00
Éric Lemoine 32a4cadac9 Add cron image and playbook
Add cron image and playbook for logrotate.

The "common" Ansible playbook includes configuration files for
logrotate. At this point the operator cannot customize/override the
logrotate configuration.

Closes-Bug: #1553244
Change-Id: Ic9fdda9a273c9ccd90502f0acc7614d2c7157dca
2016-03-09 13:53:55 +01:00
Éric Lemoine 97ae06341a Use alphabetical order in cleanup-containers
TrivialFix
Change-Id: I95f2e6d17ba7960b2f87344f30b7884d621f9ecb
2016-03-05 11:51:49 +01:00
Éric Lemoine 491aff0b88 Make Heka send logs to Elasticsearch
This patch includes changes relative to integrating Heka with
Elasticsearch and Kibana.

The main change is the addition of an Heka ElasticSearchOutput plugin
to make Heka send the logs it collects to Elasticsearch.

Since Logstash is not used the enable_elk deploy variable is renamed
to enable_central_logging.

If enable_central_logging is false then Elasticsearch and Kibana are
not started, and Heka won't attempt to send logs to Elasticsearch.

By default enable_central_logging is set to false. If
enable_central_logging is set to true after deployment then the Heka
container needs to be recreated (for Heka to get the new
configuration).

The Kibana configuration used property names that are deprecated in
Kibana 4.2. This is changed to use non-deprecated property names.

Previously logs read from files and from Syslog had a different Type
in Heka. This is changed to always use "log" for the Type. In this
way just one index instead of two is used in Elasticsearch, making
things easier to the user on the visualization side.

The HAProxy configuration is changed to add entries for Kibana.
Kibana server is now accessible via the internal VIP, and also via
the external VIP if there's one configured.

The HAProxy configuration is changed to add an entry for
Elasticsearch. So Elasticsearch is now accessible via the internal
VIP. Heka uses that channel for communicating with Elasticsearch.

Note that currently the Heka logs include "Plugin
elasticsearch_output" errors when Heka starts. This occurs when Heka
starts processing logs while Elasticsearch is not yet started. These
are transient errors that go away when Elasticsearch is ready. And
with buffering enabled on the ElasticSearchOuput plugin logs will be
buffered and then retransmitted when Elasticsearch is ready.

Change-Id: I6ff7a4f0ad04c4c666e174693a35ff49914280bb
Implements: blueprint central-logging-service
2016-03-05 11:51:49 +01:00
Jenkins 76c28f9698 Merge "Update cleanup-containers to remove ceph containers" 2016-03-01 14:16:04 +00:00
Mauricio Lima f1b8eec20d Update cleanup-containers to remove ceph containers
TrivialFix

Change-Id: Ia47429a38503d4982049c3fa1fc6fca4a8000fbd
2016-03-01 06:58:46 -05:00
Allen Gao 235e95885b Move ironic-discoverd to ironic-inspector
Closes-Bug: #1551052
Change-Id: Ic226287bbf1f1e8d5cc2e1d80ce2975448b1f95c
2016-02-29 11:47:52 +08:00
Éric Lemoine 0417844b8d Remove Rsyslog entirely
Partially implements: blueprint heka

Change-Id: I1322d2dc870e6f8fe052926995d993e8a08a25db
2016-02-23 01:45:23 -08:00
Jenkins c01ed04b2d Merge "Make cleanup-containers remove bootstrap_heka" 2016-02-22 18:00:36 +00:00
Éric Lemoine b3ee41a288 Make cleanup-containers remove Heka volumes
TrivialFix
Partially implements: blueprint heka

Change-Id: Ie8f393515c464020f079db41c05d023319920136
2016-02-22 17:30:57 +01:00
Éric Lemoine fadd8a3ded Make cleanup-containers remove bootstrap_heka
TrivialFix
Partially implements: blueprint heka

Change-Id: I5f91056590250f2a477018c1773905b412536f24
2016-02-22 13:56:29 +01:00
Éric Lemoine 916925c9a8 Add Heka to common role
Partially implements: blueprint heka
Change-Id: I9ddad09b3f16b323c7ed535243458b0de6620cdb
2016-02-19 20:32:00 +00:00
Allen Gao 75e5782400 Keep consistent with others for ironic containers
Make the containers and volumes names of ironic to be
consistent with others.

Partially-implements: blueprint ironic-container
Change-Id: If78b020c81157a948c5c3283f1410bcb6e5c1e61
2016-02-19 20:30:59 +08:00
Jeffrey Zhang 29833132d8 Also remove the volumes when cleaning up containers
TrivialFix

Change-Id: Ia52451d2c0de09ee9dcf79211389a3b1ce4ae738
2016-02-18 09:06:44 +01:00
Shaun Smekel 6ac7839a21 Adds support for cleaning up bootstrap containers in the
toos/cleanup-containers script.

Dynamic Ceph OSD bootstrap containers also included.

Change-Id: Ifb5b54c5b78a894ed6e8b9980a6eb9919e52364c
Closes-Bug: #1515544
Signed-off-by: Shaun Smekel <shaun.smekel@theorem.net.au>
2016-02-17 18:49:55 +11:00
Allen Gao a5a0a830ef rabbitmq_data container is removed
TrivialFix

Change-Id: I5168191182c249df68fd0b5c70a778f223326974
2016-02-14 20:18:55 +08:00
Martin André fd7b431069 Add all neutron agents to cleanup-containers script
When breaking neutron-agents into thin containers, we forgot to update
the cleanup-containers script.

TrivialFix

Change-Id: Idad2eb73a4de7c66109ad5bffcce3173970e2af9
2016-02-09 14:49:39 +09:00
SamYaple 80b7266ed1 Rename kolla_ansible to kolla_toolbox
This change is needed for clarity. We have a kolla-ansible script.
We have a kolla-mesos repo. We plan to have a kolla-ansible repo.
Already we have had far too much confusion about whether we are
talking about the container or the project. Naming this kolla-toolbox
eliminates all of that confusion and its probably a bit more accurate
of a name too.

Closes-Bug: #1541053
Change-Id: I8fd1f49d5a22b36ede5b10f46b9fe02ddda9007e
2016-02-02 18:12:15 +00:00
Mauricio Lima 488f46f537 Update cleanup-containers to remove manila containers
Change-Id: Ie7a53396b03ce4e472b5e810a02ccdfc9bd8aacd
Partially-Implements: blueprint enable-manila-containers
2016-01-28 14:47:37 -05:00
Allen Gao c7a7234415 refactor the cleanup containers
TrivialFix
Sort the containers, remove *_data ones, etc.

Change-Id: Ic7923828517da954e7c8802d6cf5918e425df255
2016-01-20 12:04:38 +08:00
Artur Zarzycki 95c1d7380f Remove ironic containers in the cleanup script
TrivialFix

Change-Id: Ia37369acf8bf7ca7f49fd647f40c6e98f40e93d8
2015-12-14 16:57:04 +01:00
Sidharth Surana a3b7b866b7 Remove cinder containers in the cleanup script
Change-Id: I29b788a71f30d133e66759a5de2ecd43222313a8
Closes-Bug: #1524557
2015-12-09 16:25:44 -08:00
Sean Mooney 2ffb35ee53 adds tools/cleanup-containers regex support
- this change extends the tools/cleanup-containers script to
  support a grep extended regex as a first paramater.
- if tools/cleanup-containers is called with a grep extended
  regex string as a first paramater, only containers mataching
  that regex will be cleaned up.
- e.g. tools/cleanup-containers "neutron|openvswitch"
  will cleanup all container whoes name contains either neutron
  or openvswitch.

Change-Id: Iadb68c0a8de40e9ec2c0a27568e3a372ec0e8303
Closes-Bug: #1522168
2015-12-02 23:01:42 +00:00
Hui Kang afb30cbebd Remove openvswitch_data container in the cleanup script
Change-Id: Iec94e254e8df501005fd3660c80e3c2eefbb05bb
Closes-bug: #1520833
2015-11-28 16:30:00 -05:00
Michal Rostecki 2cd5d9ed74 Add Ansible support for Magnum
Change-Id: Idb25ac4d3148c9b9400cf675ac2e47d35cce6224
Implements: blueprint ansible-magnum
2015-11-13 11:31:34 +01:00