From 1ce1cd10fe867d002b0e87013e236842c4af68a6 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Thu, 28 Jul 2016 22:58:58 +0800 Subject: [PATCH] Enable the nova microversion api * Use the nova microversion api for compute service * Use the legacy nova api for compute_legacy service * Update the nova service and endpoint during the upgrade stage This is what the devstack used now[0] [0] https://github.com/openstack-dev/devstack/blob/e777bbce3b18ce50abe683a2d96394e96a3b70bc/lib/nova#L408,L422 TrivialFix Change-Id: I0574a3116b1dd1702b4eccb2394538866675c4c1 --- ansible/roles/nova/defaults/main.yml | 10 +++++++--- ansible/roles/nova/tasks/register.yml | 15 +++++++++------ ansible/roles/nova/tasks/upgrade.yml | 2 ++ ...enable-nova-microversion-b445f22548b41c2a.yaml | 3 +++ 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/enable-nova-microversion-b445f22548b41c2a.yaml diff --git a/ansible/roles/nova/defaults/main.yml b/ansible/roles/nova/defaults/main.yml index 08a440e294..2d80abf33e 100644 --- a/ansible/roles/nova/defaults/main.yml +++ b/ansible/roles/nova/defaults/main.yml @@ -71,9 +71,13 @@ nova_compute_ironic_image_full: "{{ nova_compute_ironic_image }}:{{ nova_compute #################### # OpenStack #################### -nova_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ nova_api_port }}/v2/%(tenant_id)s" -nova_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ nova_api_port }}/v2/%(tenant_id)s" -nova_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ nova_api_port }}/v2/%(tenant_id)s" +nova_legacy_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ nova_api_port }}/v2/%(tenant_id)s" +nova_legacy_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ nova_api_port }}/v2/%(tenant_id)s" +nova_legacy_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ nova_api_port }}/v2/%(tenant_id)s" + +nova_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ nova_api_port }}/v2.1/%(tenant_id)s" +nova_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ nova_api_port }}/v2.1/%(tenant_id)s" +nova_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ nova_api_port }}/v2.1/%(tenant_id)s" nova_logging_debug: "{{ openstack_logging_debug }}" diff --git a/ansible/roles/nova/tasks/register.yml b/ansible/roles/nova/tasks/register.yml index 5e21849560..a1b87e5c1d 100644 --- a/ansible/roles/nova/tasks/register.yml +++ b/ansible/roles/nova/tasks/register.yml @@ -2,9 +2,9 @@ - name: Creating the Nova service and endpoint command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m kolla_keystone_service - -a "service_name=nova - service_type=compute - description='Openstack Compute' + -a "service_name={{ item.name }} + service_type={{ item.service_type }} + description='{{ item.description }}' endpoint_region={{ openstack_region_name }} url='{{ item.url }}' interface='{{ item.interface }}' @@ -18,9 +18,12 @@ delay: 5 run_once: True with_items: - - {'interface': 'admin', 'url': '{{ nova_admin_endpoint }}'} - - {'interface': 'internal', 'url': '{{ nova_internal_endpoint }}'} - - {'interface': 'public', 'url': '{{ nova_public_endpoint }}'} + - {'name': 'nova_legacy', 'service_type': 'compute_legacy', 'interface': 'admin', 'url': '{{ nova_legacy_admin_endpoint }}', 'description': 'OpenStack Compute Service (Legacy 2.0)'} + - {'name': 'nova_legacy', 'service_type': 'compute_legacy', 'interface': 'internal', 'url': '{{ nova_legacy_internal_endpoint }}', 'description': 'OpenStack Compute Service (Legacy 2.0)'} + - {'name': 'nova_legacy', 'service_type': 'compute_legacy', 'interface': 'public', 'url': '{{ nova_legacy_public_endpoint }}', 'description': 'OpenStack Compute Service (Legacy 2.0)'} + - {'name': 'nova', 'service_type': 'compute', 'interface': 'admin', 'url': '{{ nova_admin_endpoint }}', 'description': 'OpenStack Compute Service'} + - {'name': 'nova', 'service_type': 'compute', 'interface': 'internal', 'url': '{{ nova_internal_endpoint }}', 'description': 'OpenStack Compute Service'} + - {'name': 'nova', 'service_type': 'compute', 'interface': 'public', 'url': '{{ nova_public_endpoint }}', 'description': 'OpenStack Compute Service'} - name: Creating the Nova project, user, and role command: docker exec -t kolla_toolbox /usr/bin/ansible localhost diff --git a/ansible/roles/nova/tasks/upgrade.yml b/ansible/roles/nova/tasks/upgrade.yml index f8f2f7deec..2e7cb4a029 100644 --- a/ansible/roles/nova/tasks/upgrade.yml +++ b/ansible/roles/nova/tasks/upgrade.yml @@ -8,6 +8,8 @@ - include: bootstrap_service.yml +- include: register.yml + - name: Checking if conductor container needs upgrading kolla_docker: action: "compare_image" diff --git a/releasenotes/notes/enable-nova-microversion-b445f22548b41c2a.yaml b/releasenotes/notes/enable-nova-microversion-b445f22548b41c2a.yaml new file mode 100644 index 0000000000..8919331d47 --- /dev/null +++ b/releasenotes/notes/enable-nova-microversion-b445f22548b41c2a.yaml @@ -0,0 +1,3 @@ +--- +features: + - Enable the nova microversion api