Merge "Pike support for Nova allocation ratio adjustment playbook"
This commit is contained in:
@@ -2,25 +2,27 @@
|
|||||||
#
|
#
|
||||||
# Playbook to adjust Nova allocation ratios
|
# 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:
|
# Examples:
|
||||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml -e "cpu_allocation_ratio=24"
|
# ansible-playbook -i hosts browbeat/adjust-nova-allocation.yml -e "cpu_allocation_ratio=100.0"
|
||||||
# ansible-playbook -i hosts browbeat/adjustment-nova-allocation.yml -e "cpu_allocation_ratio=24 ram_allocation_ratio=10.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/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 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
|
# 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.
|
# 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
|
# * 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)
|
# 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 }}"
|
remote_user: "{{ host_remote_user }}"
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars_files:
|
vars_files:
|
||||||
@@ -49,6 +51,11 @@
|
|||||||
nova_config_file: /etc/nova/nova.conf
|
nova_config_file: /etc/nova/nova.conf
|
||||||
when: "('Newton' in osp_version['content'] | b64decode or 'Ocata' in osp_version['content'] | b64decode)"
|
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
|
- name: Set default cpu_allocation_ratio/ram_allocation_ratio/disk_allocation_ratio configuration for Nova
|
||||||
set_fact:
|
set_fact:
|
||||||
nova_configuration:
|
nova_configuration:
|
||||||
@@ -93,3 +100,30 @@
|
|||||||
|
|
||||||
roles:
|
roles:
|
||||||
- nova-config
|
- 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:
|
roles:
|
||||||
- nova-config
|
- 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
|
backup: yes
|
||||||
with_items:
|
with_items:
|
||||||
- "{{nova_configuration}}"
|
- "{{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)"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user