Merge lp:~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1 into lp:~openstack-charmers-archive/charms/trusty/nova-compute/next

Proposed by Clark Laughlin
Status: Merged
Merged at revision: 110
Proposed branch: lp:~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-compute/next
Diff against target: 113 lines (+30/-3)
5 files modified
hooks/nova_compute_context.py (+4/-1)
templates/havana/nova.conf (+7/-0)
templates/juno/nova.conf (+7/-0)
templates/kilo/nova.conf (+5/-0)
unit_tests/test_nova_compute_contexts.py (+7/-2)
To merge this branch: bzr merge lp:~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1
Reviewer Review Type Date Requested Status
Liam Young Approve
Ryan Beisner Pending
Review via email: mp+252682@code.launchpad.net

This proposal supersedes a proposal from 2015-03-12.

Description of the change

This change allows the nova-compute charm to deploy on arm64 machines without requiring a different configuration to be used. To deploy nova-compute on arm64 requires 2 settings in nova.conf, which are not required for amd64:

libvirt_use_virtio_for_bridges = False
libvirt_disk_prefix = vd

Since juju configuration is specified at the service level, there is not a way to provide a separate configuration when deploying an amd64 unit and an arm64 unit -- preventing deployment of openstack with a mixture of arm64 and amd64 nova-compute nodes.

This change simply detects the machine architecture, and adds the two configuration settings to nova.conf when running on an arm64 (aarch64) machine. Behavior when running on other architectures is unchanged.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_lint_check #2609 nova-compute-next for clark-laughlin mp252662
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/2609/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_unit_test #2399 nova-compute-next for clark-laughlin mp252662
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
  FAILED (SKIP=5, failures=3)
  make: *** [unit_test] Error 1

Full unit test output: http://paste.ubuntu.com/10582347/
Build: http://10.245.162.77:8080/job/charm_unit_test/2399/

Revision history for this message
Ryan Beisner (1chb1n) wrote : Posted in a previous version of this proposal

It looks like the unit test will also need some updating.

review: Needs Fixing
Revision history for this message
Clark Laughlin (clark-laughlin) wrote : Posted in a previous version of this proposal

Hmm - is it possible that the test results include all of the other changes
on that branch, or is this just for my change? I'll have to figure out how
the test works and what's failing – – curious, because my changes should
not alter the behavior of anything unless it is run on an ARM host

On Wednesday, March 11, 2015, Ryan Beisner <email address hidden>
wrote:

> Review: Needs Fixing
>
> It looks like the unit test will also need some updating.
> --
>
> https://code.launchpad.net/~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1/+merge/252662
> You are the owner of
> lp:~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1.
>

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_amulet_test #2434 nova-compute-next for clark-laughlin mp252662
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/2434/

Revision history for this message
Ryan Beisner (1chb1n) wrote : Posted in a previous version of this proposal

See inline comment.

Revision history for this message
Ryan Beisner (1chb1n) wrote : Posted in a previous version of this proposal

If you can apply this patch or edit like so, that should do the trick:
    http://paste.ubuntu.com/10582523/

To re-confirm manually before committing:
    make unit_test

Revision history for this message
Clark Laughlin (clark-laughlin) wrote : Posted in a previous version of this proposal

Thank you! I'll give it a try later tonight and resubmit.

On Wednesday, March 11, 2015, Ryan Beisner <email address hidden>
wrote:

> If you can apply this patch or edit like so, that should do the trick:
> http://paste.ubuntu.com/10582523/
>
> To re-confirm manually before committing:
> make unit_test
>
> --
>
> https://code.launchpad.net/~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1/+merge/252662
> You are the owner of
> lp:~clark-laughlin/charms/trusty/nova-compute/arm64-patch-1.
>

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_lint_check #2610 nova-compute-next for clark-laughlin mp252662
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  unit_tests/test_nova_compute_contexts.py:210:30: W291 trailing whitespace
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10583581/
Build: http://10.245.162.77:8080/job/charm_lint_check/2610/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_unit_test #2401 nova-compute-next for clark-laughlin mp252662
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/2401/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_amulet_test #2435 nova-compute-next for clark-laughlin mp252662
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

Full amulet test output: http://paste.ubuntu.com/10583654/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2435/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2611 nova-compute-next for clark-laughlin mp252682
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/2611/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #2402 nova-compute-next for clark-laughlin mp252682
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/2402/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2436 nova-compute-next for clark-laughlin mp252682
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

Full amulet test output: http://paste.ubuntu.com/10583731/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2436/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Amulet test failed due to environment timeout issue, unrelated to the proposed changes. I kicked off a re-run of that test.

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2437 nova-compute-next for clark-laughlin mp252682
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/2437/

Revision history for this message
Liam Young (gnuoy) wrote :

Thank you for the contribution, it is very much appreciated. Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_compute_context.py'
2--- hooks/nova_compute_context.py 2015-02-16 09:53:45 +0000
3+++ hooks/nova_compute_context.py 2015-03-12 03:47:45 +0000
4@@ -1,5 +1,5 @@
5 import uuid
6-
7+import platform
8 from charmhelpers.contrib.openstack import context
9 from charmhelpers.core.host import service_running, service_start
10 from charmhelpers.fetch import apt_install, filter_installed_packages
11@@ -104,6 +104,9 @@
12 'listen_tls': 0,
13 }
14
15+ # get the processor architecture to use in the nova.conf template
16+ ctxt['arch'] = platform.machine()
17+
18 # enable tcp listening if configured for live migration.
19 if config('enable-live-migration'):
20 ctxt['libvirtd_opts'] += ' -l'
21
22=== modified file 'templates/havana/nova.conf'
23--- templates/havana/nova.conf 2014-12-15 10:28:47 +0000
24+++ templates/havana/nova.conf 2015-03-12 03:47:45 +0000
25@@ -13,7 +13,14 @@
26 state_path=/var/lib/nova
27 lock_path=/var/lock/nova
28 force_dhcp_release=True
29+
30+{% if arch == 'aarch64' -%}
31+libvirt_use_virtio_for_bridges=False
32+libvirt_disk_prefix=vd
33+{% else -%}
34 libvirt_use_virtio_for_bridges=True
35+{% endif -%}
36+
37 verbose=True
38 use_syslog = {{ use_syslog }}
39 ec2_private_dns_show_ip=True
40
41=== modified file 'templates/juno/nova.conf'
42--- templates/juno/nova.conf 2014-12-15 10:28:47 +0000
43+++ templates/juno/nova.conf 2015-03-12 03:47:45 +0000
44@@ -13,7 +13,14 @@
45 state_path=/var/lib/nova
46 lock_path=/var/lock/nova
47 force_dhcp_release=True
48+
49+{% if arch == 'aarch64' -%}
50+libvirt_use_virtio_for_bridges=False
51+libvirt_disk_prefix=vd
52+{% else -%}
53 libvirt_use_virtio_for_bridges=True
54+{% endif -%}
55+
56 verbose=True
57 use_syslog = {{ use_syslog }}
58 ec2_private_dns_show_ip=True
59
60=== modified file 'templates/kilo/nova.conf'
61--- templates/kilo/nova.conf 2015-01-21 12:27:42 +0000
62+++ templates/kilo/nova.conf 2015-03-12 03:47:45 +0000
63@@ -22,6 +22,11 @@
64 compute_driver=libvirt.LibvirtDriver
65 my_ip = {{ host_ip }}
66
67+{% if arch == 'aarch64' -%}
68+libvirt_use_virtio_for_bridges=False
69+libvirt_disk_prefix=vd
70+{% endif -%}
71+
72 {% include "parts/database" %}
73
74 {% include "parts/rabbitmq" %}
75
76=== modified file 'unit_tests/test_nova_compute_contexts.py'
77--- unit_tests/test_nova_compute_contexts.py 2015-02-16 09:53:45 +0000
78+++ unit_tests/test_nova_compute_contexts.py 2015-03-12 03:47:45 +0000
79@@ -1,3 +1,5 @@
80+import platform
81+
82 from mock import patch
83 from test_utils import CharmTestCase
84
85@@ -179,6 +181,7 @@
86
87 self.assertEqual(
88 {'libvirtd_opts': '-d',
89+ 'arch': platform.machine(),
90 'listen_tls': 0,
91 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
92
93@@ -190,6 +193,7 @@
94
95 self.assertEqual(
96 {'libvirtd_opts': '-d -l',
97+ 'arch': platform.machine(),
98 'listen_tls': 0,
99 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
100
101@@ -201,9 +205,10 @@
102
103 self.assertEqual(
104 {'libvirtd_opts': '-d',
105+ 'disk_cachemodes': 'file=unsafe,block=none',
106+ 'arch': platform.machine(),
107 'listen_tls': 0,
108- 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7',
109- 'disk_cachemodes': 'file=unsafe,block=none'}, libvirt())
110+ 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
111
112 @patch.object(context.NeutronComputeContext, 'network_manager')
113 @patch.object(context.NeutronComputeContext, 'plugin')

Subscribers

People subscribed via source and target branches