Enable cross-cell resize in the nova-multi-cell job

This changes the nova-multi-cell job to essentially
force cross-cell resize and cold migration. By "force"
I mean there is only one compute in each cell and
resize to the same host is disabled, so the scheduler
has no option but to move the server to the other cell.

This adds a new role to write the nova policy.yaml file
to enable cross-cell resize and a pre-run playbook so
that the policy file setup before tempest runs.

Part of blueprint cross-cell-resize

Change-Id: Ia4f3671c40e69674afc7a96b5d9b198dabaa4224
This commit is contained in:
Matt Riedemann
2019-05-01 11:24:27 -04:00
parent 6ebee92445
commit 7661995b69
5 changed files with 52 additions and 11 deletions
+10
View File
@@ -0,0 +1,10 @@
Setup multi-cell policy on the controller host. This should not require
a restart of the n-api service (the policy changes should be read
dynamically). The stack user must exist on the controller host first.
**Role Variables**
.. zuul:rolevar:: nova_config_dir
:default: /etc/nova
The nova configuration directory.
@@ -0,0 +1 @@
nova_config_dir: /etc/nova
@@ -0,0 +1,18 @@
# Ensure the nova configuration directory exists before writing the policy
# file to it.
- name: Create nova conf dir
file:
path: '{{ nova_config_dir }}'
state: directory
owner: stack
become: yes
# Write the policy file rule for multi-cell resize.
- name: Setup multi-cell policy
copy:
content: |
# Enable cross-cell resize.
"compute:servers:resize:cross_cell": "rule:admin_or_owner"
dest: '{{ nova_config_dir }}/policy.yaml'
owner: stack
become: yes