From e32dfe62008cf85cda46222e8708dc15b253130c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 20 Aug 2020 21:39:44 -0400 Subject: [PATCH] Add additional configuration to group_vars Also include defaults and the new pvc_vm_shutdown_timeout option. --- group_vars/default/pvc.yml | 29 ++++++++++++++++-------- roles/pvc/defaults/main.yml | 19 ++++++++++++++++ roles/pvc/templates/pvc/pvcnoded.yaml.j2 | 13 ++++++----- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/group_vars/default/pvc.yml b/group_vars/default/pvc.yml index 52a6e7b..f40117f 100644 --- a/group_vars/default/pvc.yml +++ b/group_vars/default/pvc.yml @@ -1,13 +1,22 @@ --- -# Logging configuration -pvc_log_to_file: False -pvc_log_to_stdout: True -pvc_log_colours: False -pvc_log_dates: False -pvc_log_keepalives: True -pvc_log_keepalive_cluster_details: True -pvc_log_keepalive_storage_details: True -pvc_log_console_lines: 1000 +# Logging configuration (uncomment to override defaults) +#pvc_log_to_file: False # Log to a file in /var/log/pvc +#pvc_log_to_stdout: True # Log to stdout (i.e. journald) +#pvc_log_colours: True # Log colourful prompts for states instead of text +#pvc_log_dates: False # Log dates (useful with log_to_file, not useful with log_to_stdout as journald adds these) +#pvc_log_keepalives: True # Log keepalive event every pvc_keepalive_interval seconds +#pvc_log_keepalive_cluster_details: True # Log cluster details (VMs, load, etc.) duing keepalive events +#pvc_log_keepalive_storage_details: True # Log storage details (OSDs, pools, health) during keepalive events +#pvc_log_console_lines: 1000 # The number of VM console log lines to store in Zookeeper for 'vm log' commands. + +# Timing and fencing configuration (uncomment to override defaults) +#pvc_vm_shutdown_timeout: 180 # Number of seconds before a 'shutdown' VM is forced off +#pvc_keepalive_interval: 5 # Number of seconds between keepalive ticks +#pvc_fence_intervals: 6 # Number of keepalive ticks before a node is considered dead +#pvc_suicide_intervals: 0 # Number of keepalive ticks before a node consideres itself dead (0 to disable) +#pvc_fence_successful_action: migrate # What to do with VMs when a fence is successful (migrate, None) +#pvc_fence_failed_action: None # What to do with VMs when a fence is failed (migrate, None) - migrate is DANGEROUS without pvc_suicide_intervals set to < pvc_fence_intervals +#pvc_fence_migrate_target_selector: mem # The selector to use for migrating VMs after a fence # Client API configuration pvc_api_listen_address: "{{ pvc_upstream_floatingip }}" @@ -49,7 +58,7 @@ pvc_routers: # Node list # > Every node configured with this playbook must be specified in this list. pvc_nodes: - - hostname: "pvchv1" + - hostname: "pvchv1" # This name MUST match the Ansible inventory_hostname is_coordinator: yes node_id: 1 router_id: "192.168.100.11" diff --git a/roles/pvc/defaults/main.yml b/roles/pvc/defaults/main.yml index 71d778b..5f0557b 100644 --- a/roles/pvc/defaults/main.yml +++ b/roles/pvc/defaults/main.yml @@ -1,4 +1,23 @@ --- +# Logging configuration (uncomment to override defaults) +pvc_log_to_file: False +pvc_log_to_stdout: True +pvc_log_colours: True +pvc_log_dates: False +pvc_log_keepalives: True +pvc_log_keepalive_cluster_details: True +pvc_log_keepalive_storage_details: True +pvc_log_console_lines: 1000 + +# Timing and fencing configuration (uncomment to override defaults) +pvc_vm_shutdown_timeout: 180 # Number of seconds before a 'shutdown' VM is forced off +pvc_keepalive_interval: 5 # Number of seconds between keepalive ticks +pvc_fence_intervals: 6 # Number of keepalive ticks before a node is considered dead +pvc_suicide_intervals: 0 # Number of keepalive ticks before a node consideres itself dead (0 to disable) +pvc_fence_successful_action: migrate # What to do with VMs when a fence is successful (migrate, None) +pvc_fence_failed_action: None # What to do with VMs when a fence is failed (migrate, None) - migrate is DANGEROUS without pvc_suicide_intervals set to < pvc_fence_intervals +pvc_fence_migrate_target_selector: mem # The selector to use for migrating VMs after a fence + # Ceph storage ceph_storage_secret_key: "" ceph_storage_secret_uuid: "" diff --git a/roles/pvc/templates/pvc/pvcnoded.yaml.j2 b/roles/pvc/templates/pvc/pvcnoded.yaml.j2 index 9bdf5be..da92614 100644 --- a/roles/pvc/templates/pvc/pvcnoded.yaml.j2 +++ b/roles/pvc/templates/pvc/pvcnoded.yaml.j2 @@ -46,13 +46,14 @@ pvc: pass: {{ pvc_prov_database_password }} system: intervals: - keepalive_interval: 5 - fence_intervals: 6 - suicide_intervals: 0 + vm_shutdown_timeout: {{ pvc_vm_shutdown_timeout }} + keepalive_interval: {{ pvc_keepalive_interval }} + fence_intervals: {{ pvc_fence_intervals }} + suicide_intervals: {{ pvc_suicide_intervals }} fencing: actions: - successful_fence: migrate - failed_fence: None + successful_fence: {{ pvc_fence_successful_action }} + failed_fence: {{ pvc_fence_failed_action }} ipmi: host: {% for node in pvc_nodes if node.hostname == inventory_hostname %}{{ node.ipmi_host }}{% endfor %} @@ -61,7 +62,7 @@ pvc: pass: {% for node in pvc_nodes if node.hostname == inventory_hostname %}{{ node.ipmi_password }}{% endfor %} migration: - target_selector: mem + target_selector: {{ pvc_fence_migrate_target_selector }} configuration: directories: dynamic_directory: "/run/pvc"