Ajout du support OpenNebula HA dans Hâpy

Ajouter la possibilité de créer une grappe haute disponibilité entre
plusieurs Hâpy (https://docs.opennebula.org/5.6/advanced_components/ha/index.html)

Pré-requis : Les datastores doivent être partagés entre tous les Hâpy
via NFS ou tout autre système de fichiers accécibles de manière
concurrente entre les serveurs (Glusterfs, Ceph, DRBD).

Pour faire ce développement nous nous sommes basés sur eole-glusterfs
qui permet de créer une grappe glusterfs (https://dev-eole.ac-dijon.fr/projects/eole-glusterfs)
This commit is contained in:
2019-02-06 14:14:03 +01:00
parent 850585af21
commit 78a27b4fdd
13 changed files with 548 additions and 104 deletions

5
tmpl/60-one Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
%for %%host in %%one_nodes
/sbin/iptables -A eth%%{one_node_int}-root -s %%host -p tcp --syn -j ACCEPT
%end for

2
tmpl/oned-ha-mysql.conf Normal file
View File

@ -0,0 +1,2 @@
%set global %%activer_one_ha='non'
%include '/var/lib/creole/oned.conf'

View File

@ -78,18 +78,22 @@ SCRIPTS_REMOTE_DIR=/var/tmp/one
PORT = 2633
%if %%activer_one_ha == 'non'
LISTEN_ADDRESS = "127.0.0.1"
%end if
%if %%one_database_type == "sqlite"
DB = [ BACKEND = "sqlite" ]
%else
# Sample configuration for MySQL
# DB = [ BACKEND = "mysql",
# SERVER = "localhost",
# PORT = 0,
# USER = "oneadmin",
# PASSWD = "oneadmin",
# DB_NAME = "opennebula",
# CONNECTIONS = 50 ]
DB = [ BACKEND = "mysql",
SERVER = "%%one_database_host",
PORT = %%one_database_port,
USER = "%%one_database_user",
PASSWD = "%%one_database_pass",
DB_NAME = "%%one_database_name",
CONNECTIONS = %%one_database_connections ]
%end if
VNC_PORTS = [
START = 5900
@ -151,7 +155,11 @@ VNC_PORTS = [
FEDERATION = [
MODE = "STANDALONE",
ZONE_ID = 0,
%if %%activer_one_ha == 'oui'
SERVER_ID = %%one_ha_server_index,
%else
SERVER_ID = -1,
%end if
MASTER_ONED = ""
]
@ -164,17 +172,19 @@ RAFT = [
XMLRPC_TIMEOUT_MS = 450
]
%if %%activer_one_ha == 'oui'
# Executed when a server transits from follower->leader
# RAFT_LEADER_HOOK = [
# COMMAND = "raft/vip.sh",
# ARGUMENTS = "leader <interface> <ip_cidr>"
# ]
RAFT_LEADER_HOOK = [
COMMAND = "raft/vip.sh",
ARGUMENTS = "leader %%nom_zone_eth0 %%one_vip/%%calc_classe(%%one_vip_mask)"
]
# Executed when a server transits from leader->follower
# RAFT_FOLLOWER_HOOK = [
# COMMAND = "raft/vip.sh",
# ARGUMENTS = "follower <interface> <ip_cidr>"
# ]
RAFT_FOLLOWER_HOOK = [
COMMAND = "raft/vip.sh",
ARGUMENTS = "follower %%nom_zone_eth0 %%one_vip/%%calc_classe(%%one_vip_mask)"
]
%end if
#*******************************************************************************
# Default showback cost

110
tmpl/sched.conf Normal file
View File

@ -0,0 +1,110 @@
#*******************************************************************************
# OpenNebula Configuration file
#*******************************************************************************
#*******************************************************************************
# Daemon configuration attributes
#-------------------------------------------------------------------------------
# MESSAGE_SIZE: Buffer size in bytes for XML-RPC responses.
#
# XMLRPC_TIMEOUT: Seconds to timeout XML-RPC calls to oned
#
# ONE_XMLRPC: URL to connect to the OpenNebula daemon (oned)
#
# SCHED_INTERVAL: Seconds between two scheduling actions
#
# MAX_VM: Maximum number of Virtual Machines scheduled in each scheduling
# action. Use 0 to schedule all pending VMs each time.
#
# MAX_DISPATCH: Maximum number of Virtual Machines actually dispatched to a
# host in each scheduling action
#
# MAX_HOST: Maximum number of Virtual Machines dispatched to a given host in
# each scheduling action
#
# LIVE_RESCHEDS: Perform live (1) or cold migrations (0) when rescheduling a VM
#
# DEFAULT_SCHED: Definition of the default scheduling algorithm
# - policy:
# 0 = Packing. Heuristic that minimizes the number of hosts in use by
# packing the VMs in the hosts to reduce VM fragmentation
# 1 = Striping. Heuristic that tries to maximize resources available for
# the VMs by spreading the VMs in the hosts
# 2 = Load-aware. Heuristic that tries to maximize resources available for
# the VMs by using those nodes with less load
# 3 = Custom.
# - rank: Custom arithmetic expression to rank suitable hosts based in their
# attributes
# 4 = Fixed. Hosts will be ranked according to the PRIORITY attribute found
# in the Host or Cluster template.
#
# DEFAULT_DS_SCHED: Definition of the default storage scheduling algorithm
# - policy:
# 0 = Packing. Tries to optimize storage usage by selecting the DS with
# less free space
# 1 = Striping. Tries to optimize I/O by distributing the VMs across
# datastores.
# 2 = Custom.
# - rank: Custom arithmetic exprission to rank suitable datastores based on
# their attributes
# 3 = Fixed. Datastores will be ranked according to the PRIORITY attribute
# found in the Datastore template.
#
#
# LOG: Configuration for the logging system
# - system: defines the logging system:
# file to log in the sched.log file
# syslog to use the syslog facilities
# - debug_level:
# 0 = ERROR
# 1 = WARNING
# 2 = INFO
# 3 = DEBUG Includes general scheduling information (default)
# 4 = DDEBUG Includes time taken for each step
# 5 = DDDEBUG Includes detailed information about the scheduling
# decision, such as VM requirements, Host ranking for
# each VM, etc. This will impact the performance
#
# MEMORY_SYSTEM_DS_SCALE: This factor scales the VM usage of the system DS with
# the memory size. This factor can be use to make the scheduler consider the
# overhead of checkpoint files:
# system_ds_usage = system_ds_usage + memory_system_ds_scale * memory
#
#*******************************************************************************
MESSAGE_SIZE = 1073741824
TIMEOUT = 60
%if %%activer_one_ha == 'oui'
ONE_XMLRPC = "http://%%adresse_ip_eth0:2633/RPC2"
%else
ONE_XMLRPC = "http://localhost:2633/RPC2"
%end if
SCHED_INTERVAL = 30
MAX_VM = 5000
MAX_DISPATCH = 30
MAX_HOST = 1
LIVE_RESCHEDS = 0
MEMORY_SYSTEM_DS_SCALE = 0
DEFAULT_SCHED = [
policy = 1
]
DEFAULT_DS_SCHED = [
policy = 1
]
#DEFAULT_SCHED = [
# policy = 3,
# rank = "- (RUNNING_VMS * 50 + FREE_CPU)"
#]
LOG = [
system = "file",
debug_level = 3
]