From 17a050f13e836a1022e640f2e8a1c6f682c2a7b0 Mon Sep 17 00:00:00 2001 From: Nir Magnezi Date: Thu, 28 Feb 2019 11:57:00 +0200 Subject: [PATCH] Specify Octavia amphora image hw_architecture property in Glance In the case of a multi-architecture cloud, Nova will try to schedule an Amphora to a non-x86_64 architecture compute node, which will fail the load balancer creation in Octavia. This patch explicitly specifies the Amphora image hw_architecture property when the image is being uploaded to Glance. By doing so, it hints the Nova scheduler which compute nodes to take into account when it schedules an Amphora instance. The default for hw_architecture is x86_64, which resembles the current behavior since this is the only image type that we ship. Closes-Bug: #1818563 Change-Id: Ia7be6503a40e08d0d1f7f4d89132c9e9b5bd6704 (cherry picked from commit 2f1c0b89ee15ad95e23e23995aa3340d8db59966) (cherry picked from commit ef5bf9deb83a81364cea39b12de0ba799aa8b8ee) --- playbooks/roles/common/defaults/main.yml | 1 + playbooks/roles/octavia-undercloud/tasks/image_mgmt.yml | 1 + workbooks/octavia_post.yaml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/playbooks/roles/common/defaults/main.yml b/playbooks/roles/common/defaults/main.yml index a73238d27..f85bf810a 100644 --- a/playbooks/roles/common/defaults/main.yml +++ b/playbooks/roles/common/defaults/main.yml @@ -5,6 +5,7 @@ amp_image_tag: "amphora-image" amp_ssh_key_name: "octavia-ssh-key" amp_ssh_key_path: "" amp_to_raw: False +amp_hw_arch: "x86_64" auth_username: "octavia" auth_project_name: "service" lb_mgmt_net_name: "lb-mgmt-net" diff --git a/playbooks/roles/octavia-undercloud/tasks/image_mgmt.yml b/playbooks/roles/octavia-undercloud/tasks/image_mgmt.yml index a73073f57..769940618 100644 --- a/playbooks/roles/octavia-undercloud/tasks/image_mgmt.yml +++ b/playbooks/roles/octavia-undercloud/tasks/image_mgmt.yml @@ -72,6 +72,7 @@ openstack image create --disk-format {{ raw_format|default('qcow2') }} \ --container-format bare --tag {{ amp_image_tag }} \ --file {{ raw_filename|default(image_filename) }} \ + --property hw_architecture={{ amp_hw_arch }} \ {{ amphora_image }} register: image_result changed_when: "image_result.stdout != ''" diff --git a/workbooks/octavia_post.yaml b/workbooks/octavia_post.yaml index 47b31f96d..870040313 100644 --- a/workbooks/octavia_post.yaml +++ b/workbooks/octavia_post.yaml @@ -15,6 +15,7 @@ workflows: - amp_ssh_key_path - amp_ssh_key_data - amp_to_raw + - amp_hw_arch - auth_username - auth_password - auth_project_name @@ -105,6 +106,7 @@ workflows: amp_ssh_key_path: <% $.amp_ssh_key_path %> amp_ssh_key_data: <% $.amp_ssh_key_data %> amp_to_raw: <% $.amp_to_raw %> + amp_hw_arch: <% $.amp_hw_arch %> auth_username: <% $.auth_username %> auth_password: <% $.auth_password %> auth_project_name: <% $.auth_project_name %>