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

View File

@ -296,15 +296,19 @@
tempest_test_regex: ^tempest\.(scenario|(api\.compute))
tempest_test_blacklist: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/nova"].src_dir }}/devstack/nova-multi-cell-blacklist.txt'
devstack_local_conf:
post-config:
$NOVA_CONF:
oslo_policy:
# The default policy file is policy.json but the
# setup-multi-cell-policy role will write to policy.yaml.
policy_file: policy.yaml
test-config:
$TEMPEST_CONFIG:
compute-feature-enabled:
# TODO(mriedem): Enable cold migration once cross-cell resize is
# supported. We cannot enable it until then because this job has
# one compute in each cell and with
# allow_resize_to_same_host=True cold migrate will try to migrate
# on the same host which is not supported by the libvirt driver.
cold_migration: false
# Enable cold migration for migrating across cells. Note that
# because NOVA_ALLOW_MOVE_TO_SAME_HOST=false, all cold migrations
# will move across cells.
cold_migration: true
devstack_services:
# Disable other non-essential services that we don't need for this job.
c-bak: false
@ -312,11 +316,9 @@
USE_PYTHON3: True
# Setup two non-cell0 cells (cell1 and cell2).
NOVA_NUM_CELLS: 2
# Resize to the same host is supported for now since we only have
# two computes and they are in different cells.
# TODO(mriedem): Disable resize to the same host once cross-cell resize
# is supported so all resizes will move across cells.
NOVA_ALLOW_MOVE_TO_SAME_HOST: true
# Disable resize to the same host so all resizes will move across
# cells.
NOVA_ALLOW_MOVE_TO_SAME_HOST: false
# We only have two computes and we don't yet support cross-cell live
# migration.
LIVE_MIGRATION_AVAILABLE: false
@ -335,6 +337,9 @@
# Disable other non-essential services that we don't need for this
# job.
c-bak: false
# Perform setup for the multi-cell environment. Note that this runs
# before devstack is setup on the controller host.
pre-run: playbooks/nova-multi-cell/pre.yaml
- job:
name: nova-osprofiler-redis

View File

@ -0,0 +1,7 @@
- hosts: controller
roles:
# /etc/nova/policy.yaml is going to be owned by the stack user so we need
# to make sure that user exists on the controller host first.
- setup-stack-user
# Write rules to the /etc/nova/policy.yaml file.
- setup-multi-cell-policy

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.

View File

@ -0,0 +1 @@
nova_config_dir: /etc/nova

View File

@ -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