Fix libvirt_type kvm for overcloud deploy
Apparently after merging https://review.openstack.org/#/c/584380 we got a consistent failure in the 3node and scn008 jobs: invalid argument: could not find capabilities for domaintype=kvm Try to enable kvm nested virtualization and switch back to default qemu full emulation if kvm-{intel|amd} module cannot be loaded. In addition, remove the current logic behind ansible_distribution == 'RedHat' to enable kvm as this condition must run on overcloud and also depends on cpu capabilities. Change-Id: Iaa936facc5148ee6ff136db1524584785588c01e Closes-Bug: #1784017
This commit is contained in:
parent
7911b440dd
commit
416d1d1d78
@ -79,3 +79,9 @@
|
|||||||
roles:
|
roles:
|
||||||
- validate-undercloud
|
- validate-undercloud
|
||||||
|
|
||||||
|
- name: Set Libvirt type
|
||||||
|
hosts: overcloud
|
||||||
|
roles:
|
||||||
|
- set-libvirt-type
|
||||||
|
tags:
|
||||||
|
- overcloud-deploy
|
||||||
|
@ -41,8 +41,10 @@ A description of the settable variables for this role should go here, including
|
|||||||
environment in THT.
|
environment in THT.
|
||||||
* `deploy_steps_ansible_workflow`: false/true - whether to deploy the overcloud with
|
* `deploy_steps_ansible_workflow`: false/true - whether to deploy the overcloud with
|
||||||
config-download Ansible steps from a Mistral workflow.
|
config-download Ansible steps from a Mistral workflow.
|
||||||
* `libvirt_args`: qemu|kvm default is kvm
|
* `libvirt_args`: libvirt arguments used to deploy overcloud as the
|
||||||
|
--libvirt_type `virt_type`.
|
||||||
|
* `virt_type`: qemu|kvm default is qemu. kvm is only enabled when kvm-{intel|amd}
|
||||||
|
kernel module can be loaded.
|
||||||
|
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
|
@ -37,7 +37,7 @@ composable_args: ""
|
|||||||
extra_args: ""
|
extra_args: ""
|
||||||
topology: ""
|
topology: ""
|
||||||
ssl_overcloud: false
|
ssl_overcloud: false
|
||||||
libvirt_args: "--libvirt-type kvm"
|
libvirt_args: "--libvirt-type {{ virt_type|default('qemu') }}"
|
||||||
deploy_ha_ovn: false
|
deploy_ha_ovn: false
|
||||||
|
|
||||||
use_git_tht_repo: false
|
use_git_tht_repo: false
|
||||||
|
@ -180,13 +180,6 @@
|
|||||||
- release not in ['mitaka', 'liberty']
|
- release not in ['mitaka', 'liberty']
|
||||||
- set_overcloud_workers|bool
|
- set_overcloud_workers|bool
|
||||||
|
|
||||||
- name: Use KVM for Red Hat distro
|
|
||||||
set_fact:
|
|
||||||
libvirt_args: "--libvirt-type kvm"
|
|
||||||
when:
|
|
||||||
- ansible_distribution is defined
|
|
||||||
- ansible_distribution == 'RedHat'
|
|
||||||
|
|
||||||
- name: set container_args fact
|
- name: set container_args fact
|
||||||
set_fact:
|
set_fact:
|
||||||
container_args: >-
|
container_args: >-
|
||||||
|
45
roles/set-libvirt-type/README.md
Normal file
45
roles/set-libvirt-type/README.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
set-libvirt-type
|
||||||
|
================
|
||||||
|
|
||||||
|
Set Libvirt type for overcloud deploy.
|
||||||
|
This Ansible role allows provisioning overcloud with nested kvm or qemu full
|
||||||
|
virtualization mode based on cpu and OS capabilities.
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
No requirements.
|
||||||
|
|
||||||
|
Role Variables
|
||||||
|
--------------
|
||||||
|
|
||||||
|
No variables.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
No dependencies.
|
||||||
|
|
||||||
|
Example Playbook
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Including an example of how to use this role
|
||||||
|
|
||||||
|
---
|
||||||
|
- name: Set Libvirt type
|
||||||
|
hosts: overcloud
|
||||||
|
roles:
|
||||||
|
- set-libvirt-type
|
||||||
|
tags:
|
||||||
|
- overcloud-deploy
|
||||||
|
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
Apache 2.0
|
||||||
|
|
||||||
|
Author Information
|
||||||
|
------------------
|
||||||
|
|
||||||
|
OpenStack
|
30
roles/set-libvirt-type/tasks/main.yml
Normal file
30
roles/set-libvirt-type/tasks/main.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
- name: Enable kvm nested virtualization
|
||||||
|
block:
|
||||||
|
- name: Check cpu vendor
|
||||||
|
set_fact:
|
||||||
|
cpu_vendor: "{{ item }}"
|
||||||
|
when: ansible_processor[1]|lower is search(item)
|
||||||
|
with_items:
|
||||||
|
- intel
|
||||||
|
- amd
|
||||||
|
- name: Fail if cpu vendor is undefined
|
||||||
|
fail:
|
||||||
|
msg: 'WARNING: Unknown/unsupported CPU vendor'
|
||||||
|
when: cpu_vendor is not defined
|
||||||
|
- name: Make sure the kvm module is present
|
||||||
|
modprobe:
|
||||||
|
name: kvm-{{ cpu_vendor }}
|
||||||
|
state: present
|
||||||
|
params: 'nested=1'
|
||||||
|
become: true
|
||||||
|
- name: Set kvm as virt type
|
||||||
|
set_fact:
|
||||||
|
virt_type: kvm
|
||||||
|
- debug:
|
||||||
|
msg: 'KVM nested virtualization Enabled.'
|
||||||
|
rescue:
|
||||||
|
- name: Set qemu as virt type
|
||||||
|
set_fact:
|
||||||
|
virt_type: qemu
|
||||||
|
- debug:
|
||||||
|
msg: 'WARNING: Running QEMU full emulation.'
|
Loading…
Reference in New Issue
Block a user