diff options
author | Matt Riedemann <mriedem.os@gmail.com> | 2019-05-01 11:24:27 -0400 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2019-12-23 10:10:57 -0500 |
commit | 7661995b69c3302533646dc72446fcdea496e589 (patch) | |
tree | 091e600c4db9a320f88661ae963fd250e1c2c36e /roles | |
parent | 6ebee92445d799a2e610116cf72b4bf3d3d6a2f3 (diff) | |
download | nova-7661995b69c3302533646dc72446fcdea496e589.tar.gz |
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
Diffstat (limited to 'roles')
-rw-r--r-- | roles/setup-multi-cell-policy/README.rst | 10 | ||||
-rw-r--r-- | roles/setup-multi-cell-policy/defaults/main.yaml | 1 | ||||
-rw-r--r-- | roles/setup-multi-cell-policy/tasks/main.yaml | 18 |
3 files changed, 29 insertions, 0 deletions
diff --git a/roles/setup-multi-cell-policy/README.rst b/roles/setup-multi-cell-policy/README.rst new file mode 100644 index 0000000000..cd7b9f3903 --- /dev/null +++ b/roles/setup-multi-cell-policy/README.rst @@ -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. diff --git a/roles/setup-multi-cell-policy/defaults/main.yaml b/roles/setup-multi-cell-policy/defaults/main.yaml new file mode 100644 index 0000000000..622a1a9e5b --- /dev/null +++ b/roles/setup-multi-cell-policy/defaults/main.yaml @@ -0,0 +1 @@ +nova_config_dir: /etc/nova diff --git a/roles/setup-multi-cell-policy/tasks/main.yaml b/roles/setup-multi-cell-policy/tasks/main.yaml new file mode 100644 index 0000000000..9adc8aad18 --- /dev/null +++ b/roles/setup-multi-cell-policy/tasks/main.yaml @@ -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 |