Merge "Create symlink for libvirt save directory"

This commit is contained in:
Jenkins 2016-05-31 19:18:26 +00:00 committed by Gerrit Code Review
commit 118c12c8c2
4 changed files with 36 additions and 0 deletions

View File

@ -52,6 +52,7 @@ nova_system_group_name: nova
nova_system_shell: /bin/bash
nova_system_comment: nova system user
nova_system_home_folder: "/var/lib/{{ nova_system_user_name }}"
nova_libvirt_save_path: "{{ nova_system_home_folder }}/save"
## Manually specified nova UID/GID
# Deployers can specify a UID for the nova user as well as the GID for the
@ -397,6 +398,8 @@ nova_pip_packages:
- keystonemiddleware
- nova
nova_qemu_user: libvirt-qemu
nova_qemu_group: kvm
## Tunable overrides
nova_nova_conf_overrides: {}

View File

@ -0,0 +1,8 @@
---
fixes:
- The ``/var/lib/libvirt/qemu/save`` directory is now a
symlink to ``{{ nova_system_home_folder }}/save`` to
resolve an issue where the default location used by the
libvirt managed save command can result with the root
partitions on compute nodes becoming full when
``nova image-create`` is run on large instances.

View File

@ -45,6 +45,30 @@
- nova-apt-packages
- nova-compute-kvm-apt-packages
- name: Check if qemu save directory is a directory
stat:
path: "/var/lib/libvirt/qemu/save"
register: qemu_savedir_stat
- name: Check if qemu save directory is empty
shell:
cmd: 'ls -1A /var/lib/libvirt/qemu/save'
register: qemu_savedir_empty
# We force the link creation if our tests passed, this removes the directory as
# well
- name: Symlink qemu save dir to nova_libvirt_save_path
file:
path: "/var/lib/libvirt/qemu/save"
state: link
owner: "{{ nova_qemu_user }}"
group: "{{ nova_qemu_group }}"
src: "{{ nova_libvirt_save_path }}"
force: True
when:
- qemu_savedir_stat.stat.isdir
- qemu_savedir_empty.stdout_lines | length == 0
- name: Install pip packages (venv)
pip:
name: "{{ item }}"

View File

@ -68,6 +68,7 @@
- { path: "{{ nova_system_home_folder }}/.ssh", mode: "0700" }
- { path: "{{ nova_system_home_folder }}/cache/api" }
- { path: "{{ nova_system_home_folder }}/instances" }
- { path: "{{ nova_libvirt_save_path }}", mode: "0750" }
- { path: "/var/lock/nova" }
- { path: "/var/run/nova" }
tags: