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 (community) 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
=== modified file 'hooks/nova_compute_context.py'
--- hooks/nova_compute_context.py 2015-02-16 09:53:45 +0000
+++ hooks/nova_compute_context.py 2015-03-12 03:47:45 +0000
@@ -1,5 +1,5 @@
1import uuid1import uuid
22import platform
3from charmhelpers.contrib.openstack import context3from charmhelpers.contrib.openstack import context
4from charmhelpers.core.host import service_running, service_start4from charmhelpers.core.host import service_running, service_start
5from charmhelpers.fetch import apt_install, filter_installed_packages5from charmhelpers.fetch import apt_install, filter_installed_packages
@@ -104,6 +104,9 @@
104 'listen_tls': 0,104 'listen_tls': 0,
105 }105 }
106106
107 # get the processor architecture to use in the nova.conf template
108 ctxt['arch'] = platform.machine()
109
107 # enable tcp listening if configured for live migration.110 # enable tcp listening if configured for live migration.
108 if config('enable-live-migration'):111 if config('enable-live-migration'):
109 ctxt['libvirtd_opts'] += ' -l'112 ctxt['libvirtd_opts'] += ' -l'
110113
=== modified file 'templates/havana/nova.conf'
--- templates/havana/nova.conf 2014-12-15 10:28:47 +0000
+++ templates/havana/nova.conf 2015-03-12 03:47:45 +0000
@@ -13,7 +13,14 @@
13state_path=/var/lib/nova13state_path=/var/lib/nova
14lock_path=/var/lock/nova14lock_path=/var/lock/nova
15force_dhcp_release=True15force_dhcp_release=True
16
17{% if arch == 'aarch64' -%}
18libvirt_use_virtio_for_bridges=False
19libvirt_disk_prefix=vd
20{% else -%}
16libvirt_use_virtio_for_bridges=True21libvirt_use_virtio_for_bridges=True
22{% endif -%}
23
17verbose=True24verbose=True
18use_syslog = {{ use_syslog }}25use_syslog = {{ use_syslog }}
19ec2_private_dns_show_ip=True26ec2_private_dns_show_ip=True
2027
=== modified file 'templates/juno/nova.conf'
--- templates/juno/nova.conf 2014-12-15 10:28:47 +0000
+++ templates/juno/nova.conf 2015-03-12 03:47:45 +0000
@@ -13,7 +13,14 @@
13state_path=/var/lib/nova13state_path=/var/lib/nova
14lock_path=/var/lock/nova14lock_path=/var/lock/nova
15force_dhcp_release=True15force_dhcp_release=True
16
17{% if arch == 'aarch64' -%}
18libvirt_use_virtio_for_bridges=False
19libvirt_disk_prefix=vd
20{% else -%}
16libvirt_use_virtio_for_bridges=True21libvirt_use_virtio_for_bridges=True
22{% endif -%}
23
17verbose=True24verbose=True
18use_syslog = {{ use_syslog }}25use_syslog = {{ use_syslog }}
19ec2_private_dns_show_ip=True26ec2_private_dns_show_ip=True
2027
=== modified file 'templates/kilo/nova.conf'
--- templates/kilo/nova.conf 2015-01-21 12:27:42 +0000
+++ templates/kilo/nova.conf 2015-03-12 03:47:45 +0000
@@ -22,6 +22,11 @@
22compute_driver=libvirt.LibvirtDriver22compute_driver=libvirt.LibvirtDriver
23my_ip = {{ host_ip }}23my_ip = {{ host_ip }}
2424
25{% if arch == 'aarch64' -%}
26libvirt_use_virtio_for_bridges=False
27libvirt_disk_prefix=vd
28{% endif -%}
29
25{% include "parts/database" %}30{% include "parts/database" %}
2631
27{% include "parts/rabbitmq" %}32{% include "parts/rabbitmq" %}
2833
=== modified file 'unit_tests/test_nova_compute_contexts.py'
--- unit_tests/test_nova_compute_contexts.py 2015-02-16 09:53:45 +0000
+++ unit_tests/test_nova_compute_contexts.py 2015-03-12 03:47:45 +0000
@@ -1,3 +1,5 @@
1import platform
2
1from mock import patch3from mock import patch
2from test_utils import CharmTestCase4from test_utils import CharmTestCase
35
@@ -179,6 +181,7 @@
179181
180 self.assertEqual(182 self.assertEqual(
181 {'libvirtd_opts': '-d',183 {'libvirtd_opts': '-d',
184 'arch': platform.machine(),
182 'listen_tls': 0,185 'listen_tls': 0,
183 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())186 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
184187
@@ -190,6 +193,7 @@
190193
191 self.assertEqual(194 self.assertEqual(
192 {'libvirtd_opts': '-d -l',195 {'libvirtd_opts': '-d -l',
196 'arch': platform.machine(),
193 'listen_tls': 0,197 'listen_tls': 0,
194 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())198 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
195199
@@ -201,9 +205,10 @@
201205
202 self.assertEqual(206 self.assertEqual(
203 {'libvirtd_opts': '-d',207 {'libvirtd_opts': '-d',
208 'disk_cachemodes': 'file=unsafe,block=none',
209 'arch': platform.machine(),
204 'listen_tls': 0,210 'listen_tls': 0,
205 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7',211 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
206 'disk_cachemodes': 'file=unsafe,block=none'}, libvirt())
207212
208 @patch.object(context.NeutronComputeContext, 'network_manager')213 @patch.object(context.NeutronComputeContext, 'network_manager')
209 @patch.object(context.NeutronComputeContext, 'plugin')214 @patch.object(context.NeutronComputeContext, 'plugin')

Subscribers

People subscribed via source and target branches