Pike support for Nova allocation ratio adjustment playbook
The Nova Allocation ratio adjustment playbook has been modified to support both Newton, Ocata and Pike builds. Note Newton and Ocata requires changes to the Nova configuration on the Controllers as Pike requires changes on the Computes due to placement API usage. Change-Id: I30149b5cc1c47dd5fa02a68d1ccbb2cc5adfe31e
This commit is contained in:
parent
ff13703dd5
commit
c948d579b0
@ -2,25 +2,27 @@
|
||||
#
|
||||
# Playbook to adjust Nova allocation ratios
|
||||
#
|
||||
# Versions tested: Newton, Ocata
|
||||
# Versions tested: Newton, Ocata, Pike
|
||||
#
|
||||
# Newton, Ocata apply changes to the Controllers as Pike applies changes to the Computes
|
||||
#
|
||||
# Examples:
|
||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml -e "cpu_allocation_ratio=24"
|
||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml -e "cpu_allocation_ratio=24 ram_allocation_ratio=10.0"
|
||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml -e "cpu_allocation_ratio=24 ram_allocation_ratio=10.0 disk_allocation_ratio=10.0"
|
||||
# ansible-playbook -i hosts browbeat/adjust-nova-allocation.yml -e "cpu_allocation_ratio=100.0"
|
||||
# ansible-playbook -i hosts browbeat/adjust-nova-allocation.yml -e "cpu_allocation_ratio=100.0 ram_allocation_ratio=100.0"
|
||||
# ansible-playbook -i hosts browbeat/adjust-nova-allocation.yml -e "cpu_allocation_ratio=100.0 ram_allocation_ratio=100.0 disk_allocation_ratio=100.0"
|
||||
#
|
||||
# In order for new settings to take affect, you need to restart the Nova services
|
||||
# by adding variable restart_nova=true into the extra vars.
|
||||
#
|
||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml -e "cpu_allocation_ratio=24 ram_allocation_ratio=10.0 disk_allocation_ratio=10.0 restart_nova=true"
|
||||
# ansible-playbook -i hosts browbeat/adjust-nova-allocation.yml -e "cpu_allocation_ratio=100.0 ram_allocation_ratio=100.0 disk_allocation_ratio=100.0 restart_nova=true"
|
||||
#
|
||||
# * Note not setting a variable does not change that configuration item then. Setting no variables
|
||||
# and running the playbook sets all configuration items to defaults (cpu/ram/disk - 16/1/1)
|
||||
#
|
||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml
|
||||
# ansible-playbook -i hosts browbeat/adjust-nova-allocation.yml
|
||||
#
|
||||
|
||||
- hosts: controller
|
||||
- hosts: controller,compute
|
||||
remote_user: "{{ host_remote_user }}"
|
||||
gather_facts: false
|
||||
vars_files:
|
||||
@ -49,6 +51,11 @@
|
||||
nova_config_file: /etc/nova/nova.conf
|
||||
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode)"
|
||||
|
||||
- name: (Pike) Set Config File based on OpenStack Version
|
||||
set_fact:
|
||||
nova_config_file: /var/lib/config-data/puppet-generated/nova_libvirt/etc/nova/nova.conf
|
||||
when: "'Pike' in osp_version['content'] | b64decode"
|
||||
|
||||
- name: Set default cpu_allocation_ratio/ram_allocation_ratio/disk_allocation_ratio configuration for Nova
|
||||
set_fact:
|
||||
nova_configuration:
|
||||
@ -93,3 +100,30 @@
|
||||
|
||||
roles:
|
||||
- nova-config
|
||||
|
||||
post_tasks:
|
||||
|
||||
- name: (Newton, Ocata) Restart Nova Services
|
||||
become: true
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: restarted
|
||||
with_items:
|
||||
- openstack-nova-scheduler
|
||||
- openstack-nova-api
|
||||
- openstack-nova-conductor
|
||||
- openstack-nova-novncproxy
|
||||
- openstack-nova-consoleauth
|
||||
- httpd
|
||||
when:
|
||||
- "'Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode"
|
||||
- "'controller' in group_names"
|
||||
- restart_nova
|
||||
|
||||
- name: (Pike) Restart Nova Compute Container
|
||||
become: true
|
||||
command: docker restart nova_compute
|
||||
when:
|
||||
- "'Pike' in osp_version['content'] | b64decode"
|
||||
- "'compute' in group_names"
|
||||
- restart_nova
|
@ -114,3 +114,25 @@
|
||||
|
||||
roles:
|
||||
- nova-config
|
||||
|
||||
post_tasks:
|
||||
- name: (Newton, Ocata) Restart Nova Services
|
||||
become: true
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: restarted
|
||||
with_items:
|
||||
- openstack-nova-scheduler
|
||||
- openstack-nova-api
|
||||
- openstack-nova-conductor
|
||||
- openstack-nova-novncproxy
|
||||
- openstack-nova-consoleauth
|
||||
- httpd
|
||||
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode) and (restart_nova)"
|
||||
|
||||
- name: (Pike) Restart Nova Scheduler Container
|
||||
become: true
|
||||
command: "docker restart {{item}}"
|
||||
with_items:
|
||||
- nova_scheduler
|
||||
when: "('Pike' in osp_version['content'] | b64decode) and (restart_nova)"
|
||||
|
@ -16,24 +16,3 @@
|
||||
backup: yes
|
||||
with_items:
|
||||
- "{{nova_configuration}}"
|
||||
|
||||
- name: (Newton, Ocata) Restart Nova Services
|
||||
become: true
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: restarted
|
||||
with_items:
|
||||
- openstack-nova-scheduler
|
||||
- openstack-nova-api
|
||||
- openstack-nova-conductor
|
||||
- openstack-nova-novncproxy
|
||||
- openstack-nova-consoleauth
|
||||
- httpd
|
||||
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode) and (restart_nova)"
|
||||
|
||||
- name: (Pike) Restart Nova Scheduler Container
|
||||
become: true
|
||||
command: "docker restart {{item}}"
|
||||
with_items:
|
||||
- nova_scheduler
|
||||
when: "('Pike' in osp_version['content'] | b64decode) and (restart_nova)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user