diff --git a/.zuul.yaml b/.zuul.yaml index 28f7861ee1ab..d299257ba4b1 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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 diff --git a/playbooks/nova-multi-cell/pre.yaml b/playbooks/nova-multi-cell/pre.yaml new file mode 100644 index 000000000000..329f51b1f9ea --- /dev/null +++ b/playbooks/nova-multi-cell/pre.yaml @@ -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 diff --git a/roles/setup-multi-cell-policy/README.rst b/roles/setup-multi-cell-policy/README.rst new file mode 100644 index 000000000000..cd7b9f390394 --- /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 000000000000..622a1a9e5baf --- /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 000000000000..9adc8aad181b --- /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

AltStyle によって変換されたページ (->オリジナル) /