~openstack-charmers-next/charms/xenial/nova-compute/trunk

« back to all changes in this revision

Viewing changes to hooks/nova_compute_hooks.py

  • Committer: Ryan Beisner
  • Date: 2016-04-07 17:18:34 UTC
  • Revision ID: ryan.beisner@canonical.com-20160407171834-sadfjmzcj065x912
Set smt off and cpu-mode to host-passthrough for ppc64 architectures

When deploying a ppc64el compute node, smt needs to be
turned off and cpu-mode needs to be set to host-passthrough
for nova/libvirt/kvm use.

Change-Id: I48bd8f9e42dbc5f7c626addaa2fdd1e3f8fdd97e

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
 
2
import platform
2
3
import sys
3
4
 
4
5
from charmhelpers.core.hookenv import (
73
74
    install_hugepages,
74
75
    get_hugepage_number,
75
76
    assess_status,
 
77
    set_ppc64_cpu_smt_state,
76
78
)
77
79
 
78
80
from charmhelpers.contrib.network.ip import (
164
166
    if config('hugepages'):
165
167
        install_hugepages()
166
168
 
 
169
    # Disable smt for ppc64, required for nova/libvirt/kvm
 
170
    arch = platform.machine()
 
171
    log('CPU architecture: {}'.format(arch))
 
172
    if arch in ['ppc64el', 'ppc64le']:
 
173
        set_ppc64_cpu_smt_state('off')
 
174
 
167
175
    if (config('libvirt-image-backend') == 'rbd' and
168
176
            assert_libvirt_imagebackend_allowed()):
169
177
        for rid in relation_ids('ceph'):