Merge lp:~1chb1n/charms/trusty/nova-compute/cpu-mode into lp:~openstack-charmers-archive/charms/trusty/nova-compute/next

Proposed by Ryan Beisner
Status: Needs review
Proposed branch: lp:~1chb1n/charms/trusty/nova-compute/cpu-mode
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-compute/next
Diff against target: 147 lines (+49/-2)
9 files modified
Makefile (+1/-1)
config.yaml (+12/-0)
hooks/nova_compute_context.py (+3/-0)
hooks/nova_compute_hooks.py (+4/-0)
hooks/nova_compute_utils.py (+7/-0)
templates/icehouse/nova.conf (+3/-1)
templates/juno/nova.conf (+3/-0)
templates/kilo/nova.conf (+3/-0)
unit_tests/test_nova_compute_contexts.py (+13/-0)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/nova-compute/cpu-mode
Reviewer Review Type Date Requested Status
James Page Needs Fixing
Review via email: mp+269952@code.launchpad.net

Description of the change

Add charm config options for tuning nova/libvirt and smt in ppc64el compute node scenarios.

It works:
http://paste.ubuntu.com/12255215/

A bundle usage example:
http://bazaar.launchpad.net/~1chb1n/openstack-charm-testing/power-native-1509/view/head:/bundles/ppc64/ppc64el-7-unit-method1.yaml#L74

Previously, these needs were addressed via hacky post-deployment patches @
http://bazaar.launchpad.net/~ost-maintainers/openstack-charm-testing/trunk/view/head:/tools/ppc64el-post-deploy-patches.sh#L37

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

charm_lint_check #9243 nova-compute-next for 1chb1n mp269952
    LINT OK: passed

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

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

charm_unit_test #8544 nova-compute-next for 1chb1n mp269952
    UNIT OK: passed

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

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

charm_amulet_test #6204 nova-compute-next for 1chb1n mp269952
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 124
ERROR:root:Make target returned non-zero.

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

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

charm_lint_check #9244 nova-compute-next for 1chb1n mp269952
    LINT OK: passed

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

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

charm_unit_test #8545 nova-compute-next for 1chb1n mp269952
    UNIT OK: passed

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

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

Ignore amulet fail #6204, undercloud issue. Re-running...

158. By Ryan Beisner

update comment

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

charm_lint_check #9385 nova-compute-next for 1chb1n mp269952
    LINT OK: passed

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

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

charm_unit_test #8680 nova-compute-next for 1chb1n mp269952
    UNIT OK: passed

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

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

charm_amulet_test #6249 nova-compute-next for 1chb1n mp269952
    AMULET OK: passed

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

Revision history for this message
James Page (james-page) :
review: Needs Fixing
Revision history for this message
Haw Loeung (hloeung) wrote :

Any updates on getting this landed?

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

I plan to revisit to address the review comments, with the intention of landing it by the 15.10 charm release.

Revision history for this message
Brad Marshall (brad-marshall) wrote :

Any plans to progress this? I'm trying to deploy nova-compute on ppc64el, and it would be useful.

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

Hi Brad - yes, today I resumed work on this as part of our revalidation efforts ahead of 16.04 release. This MP will be abandoned and work will resume against the git/gerrit flow.

Unmerged revisions

158. By Ryan Beisner

update comment

157. By Ryan Beisner

add ppc64_smt config option (needed in ppc64el scenarios)

156. By Ryan Beisner

add cpu_mode libvirt config option (needed in ppc64el scenarios)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-04-16 21:32:06 +0000
3+++ Makefile 2015-09-04 13:17:40 +0000
4@@ -7,7 +7,7 @@
5
6 unit_test:
7 @echo Starting unit tests...
8- @$(PYTHON) /usr/bin/nosetests --nologcapture --with-coverage unit_tests
9+ @$(PYTHON) /usr/bin/nosetests -v --nologcapture --with-coverage unit_tests
10
11 bin/charm_helpers_sync.py:
12 @mkdir -p bin
13
14=== modified file 'config.yaml'
15--- config.yaml 2015-08-13 09:11:23 +0000
16+++ config.yaml 2015-09-04 13:17:40 +0000
17@@ -257,3 +257,15 @@
18 description: |
19 The pecentage of system memory to use for hugepages eg '10%' or the total
20 number of 2M hugepages - eg "1024".
21+ cpu-mode:
22+ type: string
23+ default:
24+ description: |
25+ Sets the cpu_mode value in the nova.conf [libvirt] section. For example,
26+ with ppc64el compute nodes, cpu mode 'host-passthrough' may be needed.
27+ ppc64-cpu-smt-state:
28+ type: string
29+ default:
30+ description: |
31+ Sets the ppc64_cpu smt state value. Common values are 'on', 'off'
32+ or an integer. Typically, set to 'off' for ppc64el compute nodes.
33
34=== modified file 'hooks/nova_compute_context.py'
35--- hooks/nova_compute_context.py 2015-08-13 10:31:20 +0000
36+++ hooks/nova_compute_context.py 2015-09-04 13:17:40 +0000
37@@ -127,6 +127,9 @@
38 if config('hugepages'):
39 ctxt['hugepages'] = True
40
41+ if config('cpu-mode'):
42+ ctxt['cpu_mode'] = config('cpu-mode')
43+
44 ctxt['host_uuid'] = '%s' % uuid.uuid4()
45 return ctxt
46
47
48=== modified file 'hooks/nova_compute_hooks.py'
49--- hooks/nova_compute_hooks.py 2015-08-19 15:07:10 +0000
50+++ hooks/nova_compute_hooks.py 2015-09-04 13:17:40 +0000
51@@ -66,6 +66,7 @@
52 assert_charm_supports_ipv6,
53 manage_ovs,
54 install_hugepages,
55+ set_ppc64_cpu_smt_state
56 )
57
58 from charmhelpers.contrib.network.ip import (
59@@ -144,6 +145,9 @@
60 if config('hugepages'):
61 install_hugepages()
62
63+ if config('ppc64-cpu-smt-state'):
64+ set_ppc64_cpu_smt_state(config('ppc64-cpu-smt-state'))
65+
66 CONFIGS.write_all()
67
68
69
70=== modified file 'hooks/nova_compute_utils.py'
71--- hooks/nova_compute_utils.py 2015-08-13 14:39:13 +0000
72+++ hooks/nova_compute_utils.py 2015-09-04 13:17:40 +0000
73@@ -471,6 +471,13 @@
74 check_output(['chown', '-R', user, ssh_dir])
75
76
77+def set_ppc64_cpu_smt_state(smt_state):
78+ """Set ppc64_cpu smt state."""
79+ log('Setting ppc64_cpu smt state: %s' % smt_state)
80+ cmd = ['ppc64_cpu', '--smt=%s' % smt_state]
81+ check_output(cmd)
82+
83+
84 def import_authorized_keys(user='root', prefix=None):
85 """Import SSH authorized_keys + known_hosts from a cloud-compute relation.
86 Store known_hosts in user's $HOME/.ssh and authorized_keys in a path
87
88=== modified file 'templates/icehouse/nova.conf'
89--- templates/icehouse/nova.conf 2015-08-25 17:40:00 +0000
90+++ templates/icehouse/nova.conf 2015-09-04 13:17:40 +0000
91@@ -157,4 +157,6 @@
92 {% if disk_cachemodes -%}
93 disk_cachemodes = {{ disk_cachemodes }}
94 {% endif -%}
95-
96+{% if cpu_mode -%}
97+cpu_mode = {{ cpu_mode }}
98+{% endif -%}
99
100=== modified file 'templates/juno/nova.conf'
101--- templates/juno/nova.conf 2015-08-25 17:40:00 +0000
102+++ templates/juno/nova.conf 2015-09-04 13:17:40 +0000
103@@ -161,3 +161,6 @@
104 {% if disk_cachemodes -%}
105 disk_cachemodes = {{ disk_cachemodes }}
106 {% endif -%}
107+{% if cpu_mode -%}
108+cpu_mode = {{ cpu_mode }}
109+{% endif -%}
110
111=== modified file 'templates/kilo/nova.conf'
112--- templates/kilo/nova.conf 2015-08-25 17:40:00 +0000
113+++ templates/kilo/nova.conf 2015-09-04 13:17:40 +0000
114@@ -166,6 +166,9 @@
115 {% if disk_cachemodes -%}
116 disk_cachemodes = {{ disk_cachemodes }}
117 {% endif -%}
118+{% if cpu_mode -%}
119+cpu_mode = {{ cpu_mode }}
120+{% endif -%}
121
122 {% include "parts/section-database" %}
123
124
125=== modified file 'unit_tests/test_nova_compute_contexts.py'
126--- unit_tests/test_nova_compute_contexts.py 2015-03-31 08:46:52 +0000
127+++ unit_tests/test_nova_compute_contexts.py 2015-09-04 13:17:40 +0000
128@@ -210,6 +210,19 @@
129 'listen_tls': 0,
130 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'}, libvirt())
131
132+ @patch.object(context.uuid, 'uuid4')
133+ def test_libvirt_cpu_mode(self, mock_uuid):
134+ self.test_config.set('cpu-mode', 'host-passthrough')
135+ mock_uuid.return_value = 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7'
136+ libvirt = context.NovaComputeLibvirtContext()
137+
138+ self.assertEqual(
139+ {'libvirtd_opts': '-d',
140+ 'arch': platform.machine(),
141+ 'listen_tls': 0,
142+ 'host_uuid': 'e46e530d-18ae-4a67-9ff0-e6e2ba7c60a7',
143+ 'cpu_mode': 'host-passthrough'}, libvirt())
144+
145 @patch.object(context.NeutronComputeContext, 'network_manager')
146 @patch.object(context.NeutronComputeContext, 'plugin')
147 def test_disable_security_groups_true(self, plugin, nm):

Subscribers

People subscribed via source and target branches