diff options
| author | Clint Byrum <clint@fewbar.com> | 2018-07-19 17:24:22 -0700 |
|---|---|---|
| committer | Adam Harwell <flux.adam@gmail.com> | 2018-07-21 00:43:50 +0000 |
| commit | d648be03ecad23d4111412fdd2baa369af88bcc2 (patch) | |
| tree | 6cbe1cf7401d999a54b53f6522dac9967be7a5d6 /tools/setup-compute-libvirt.yml | |
| parent | 97dcee4c98a63d4b1656a3c813a2f021395a95f1 (diff) | |
| download | kolla-ansible-d648be03ecad23d4111412fdd2baa369af88bcc2.tar.gz kolla-ansible-d648be03ecad23d4111412fdd2baa369af88bcc2.zip | |
Add safe shutdown systemd jobs to tools
Without these jobs, a compute node that is rebooted or powered off may
violently kill off the VMs running inside of it. This has been kept
separate from the main portion of kolla-ansible since no current role
modifies the systemd jobs of the system.
Change-Id: I0a4424f97b5ad872ff0398258c1dc42d31d0ef07
Diffstat (limited to 'tools/setup-compute-libvirt.yml')
| -rw-r--r-- | tools/setup-compute-libvirt.yml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/setup-compute-libvirt.yml b/tools/setup-compute-libvirt.yml new file mode 100644 index 000000000..8c3f46a54 --- /dev/null +++ b/tools/setup-compute-libvirt.yml @@ -0,0 +1,24 @@ +# This playbook modifies the system shutdown sequence to ensure that +# nova-compute is shutdown safely, including guests, when used in +# conjunction with systemd-machined and libvirt. +--- +- name: Set up compute libvirts to shutdown guests safely + hosts: compute + become: true + vars: + systemd_artifacts: + - kolla-libvirt-guests.service + - virt-guest-shutdown.target + tasks: + - name: Install systemd artifacts + copy: + src: "{{ item }}" + dest: "/usr/lib/systemd/system/{{ item }}" + with_items: "{{ systemd_artifacts }}" + + - name: Enable/start systemd artifacts + systemd: + enabled: yes + state: started + name: "{{ item }}" + with_items: "{{ systemd_artifacts }}" |
