Implement Nova PowerVM Virt Driver

Add powervm playbooks to enable PowerVM platform as Openstack
compute node and also to support to configure the PowerVM NovaLink
feature (required for OpenStack integration) as well as
the PowerVM OpenStack drivers.

Change-Id: Ic6197ea8940a7958d8b422b2627e6e96fd6deb21
Partially-Implements: blueprint powervm-virt-driver
This commit is contained in:
Qing Wu Wang 2016-05-19 21:10:02 -05:00
parent 3ad2855393
commit a92777f7e0
6 changed files with 219 additions and 7 deletions

View File

@ -124,8 +124,16 @@ nova_virt_types:
nova_firewall_driver: nova.virt.firewall.NoopFirewallDriver nova_firewall_driver: nova.virt.firewall.NoopFirewallDriver
nova_scheduler_use_baremetal_filters: False nova_scheduler_use_baremetal_filters: False
nova_scheduler_tracks_instance_changes: True nova_scheduler_tracks_instance_changes: True
powervm:
nova_compute_driver: nova_powervm.virt.powervm.driver.PowerVMDriver
nova_scheduler_host_manager: host_manager
nova_reserved_host_memory_mb: 8192
nova_compute_manager: nova.compute.manager.ComputeManager
nova_firewall_driver: nova.virt.firewall.NoopFirewallDriver
nova_scheduler_use_baremetal_filters: False
nova_scheduler_tracks_instance_changes: True
# Current supported choice: qemu or kvm or ironic # Current supported choice: qemu or kvm or ironic or powervm
# If this is not set, then the playbook will try to guess it. # If this is not set, then the playbook will try to guess it.
#nova_virt_type: kvm #nova_virt_type: kvm
@ -414,3 +422,28 @@ uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}" uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main" uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
# nova powervm virt driver
nova_compute_powervm_apt_packages:
- bridge-utils
- genisoimage
- kpartx
- open-iscsi
- python-libguestfs
- sysfsutils
- vlan
- nfs-common
- dosfstools
- dosfstools-dbg
- multipath-tools
- pvm-novalink
nova_compute_powervm_pip_packages:
- nova-powervm
novalink_apt_repo:
repo: "deb [arch=ppc64el] ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/ novalink_1.0.0 non-free"
state: "present"
novalink_gpg_keys:
- url: "ftp://public.dhe.ibm.com/systems/virtualization/Novalink/debian/novalink-gpg-pub.key"
state: "present"

View File

@ -0,0 +1,5 @@
---
features:
- The os_nova role can now detect and support basic deployment of a PowerVM environment.
This sets the virtualization type to 'powervm' and installs/updates the PowerVM NovaLink
package and nova-powervm driver.

View File

@ -16,6 +16,9 @@
- include: nova_compute_kvm.yml - include: nova_compute_kvm.yml
when: nova_virt_type == 'kvm' or nova_virt_type == 'qemu' when: nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
- include: nova_compute_powervm.yml
when: nova_virt_type == 'powervm'
- include: nova_compute_key_populate.yml - include: nova_compute_key_populate.yml
- include: nova_compute_key_distribute.yml - include: nova_compute_key_distribute.yml

View File

@ -0,0 +1,29 @@
---
# Copyright 2016, IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- include: nova_compute_powervm_install.yml
- name: Add nova user to pvm_admin group
user:
name: "{{ nova_system_user_name }}"
groups: "pvm_admin"
append: "yes"
tags:
- nova-powervm
- name: Ensure powervm permissions
shell: "udevadm trigger"
tags:
- nova-powervm

View File

@ -0,0 +1,124 @@
---
# Copyright 2016, IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Add novalink keys
apt_key:
url: "{{ item.url }}"
state: "{{ item.state }}"
register: add_nv_keys
until: add_nv_keys|success
retries: 5
delay: 2
ignore_errors: True
with_items: novalink_gpg_keys
tags:
- novalink-apt-keys
- name: Add novalink repo
apt_repository:
repo: "{{ novalink_apt_repo.repo }}"
state: "{{ novalink_apt_repo.state }}"
register: add_nv_repos
until: add_nv_repos|success
retries: 5
delay: 2
tags:
- novalink-repo
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
tags:
- nova-apt-packages
- nova-compute-powervm-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: |
"ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
or add_nv_repos|changed
tags:
- nova-apt-packages
- nova-compute-powervm-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: nova_compute_powervm_apt_packages
tags:
- nova-apt-packages
- nova-compute-powervm-apt-packages
- name: Register pypowervm module path (venv)
command: python -c 'import pypowervm; print pypowervm.__file__'
register: pypowervm_module_path
when:
- nova_venv_enabled | bool
tags:
- nova-powervm-libs
- name: Link pypowervm module into the venv
file:
src: "{{ pypowervm_module_path.stdout | dirname }}"
dest: "{{ nova_venv_bin | dirname }}/lib/python2.7/site-packages/pypowervm"
state: link
force: "yes"
when:
- nova_venv_enabled | bool
tags:
- nova-powervm-libs
- name: Install pip packages (venv)
pip:
name: "{{ item }}"
state: latest
virtualenv: "{{ nova_venv_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: nova_compute_powervm_pip_packages
when:
- nova_venv_enabled | bool
tags:
- nova-install
- nova-pip-packages
- name: Install pip packages (no venv)
pip:
name: "{{ item }}"
state: latest
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: nova_compute_powervm_pip_packages
when: not nova_venv_enabled | bool
tags:
- nova-install
- nova-pip-packages

View File

@ -13,17 +13,35 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Get virt type value and store as var - name: Get CPU info content and store as var
shell: | shell: cat /proc/cpuinfo
`which egrep` -c '(vmx|svm|PowerNV)' /proc/cpuinfo register: cpuinfo_contents
register: virt_type_value
changed_when: false changed_when: false
failed_when: false failed_when: false
tags: tags:
- always - always
- name: Register a fact for the nova virt type - name: Register a fact for the nova kvm virt type
set_fact: set_fact:
nova_virt_type: "{{ ((virt_type_value.stdout | int) > 0) | ternary('kvm', 'qemu') }}" nova_virt_type: "kvm"
when: cpuinfo_contents.stdout.find('vmx') != -1
or cpuinfo_contents.stdout.find('svm') != -1
or cpuinfo_contents.stdout.find('PowerNV') != -1
tags:
- nova-virt-type-set
- name: Register a fact for the nova powervm virt type
set_fact:
nova_virt_type: "powervm"
when:
- cpuinfo_contents.stdout.find('pSeries') != -1
- ansible_architecture == 'ppc64le'
tags:
- nova-virt-type-set
- name: Register a fact for the nova qemu virt type
set_fact:
nova_virt_type: "qemu"
when: nova_virt_type is not defined
tags: tags:
- always - always