Merge branch 'develop' into dist/eole/2.7.0/develop
This commit is contained in:
commit
6def855fc4
@ -23,6 +23,14 @@
|
||||
<port port_type="SymLinkOption">port_sunstone</port>
|
||||
<port port_type="SymLinkOption">vnc_proxy_port_sunstone</port>
|
||||
</service_access>
|
||||
|
||||
<service_access service='sunstone_xmlrpc'>
|
||||
<port service_accesslist="sunstone_xmlrpc">2633</port>
|
||||
</service_access>
|
||||
|
||||
<service_restriction service='sunstone_xmlrpc'>
|
||||
<ip interface='eth0' ip_type='SymLinkOption'>one_nodes</ip>
|
||||
</service_restriction>
|
||||
</files>
|
||||
<variables>
|
||||
<family name='general'>
|
||||
@ -53,7 +61,7 @@
|
||||
<value>one</value>
|
||||
</variable>
|
||||
<variable name="one_database_pass" description="Mot de passe pour se connecter à la base de données" type="password" mandatory="True"/>
|
||||
<variable name="one_database_connections" description="Nombre de connection à la base de données" type="number" mandatory="True" mode="expert"><value>50</value></variable>
|
||||
<variable name="one_database_connections" description="Nombre de connection à la base de données" type="number" mandatory="True" mode="expert"><value>50</value></variable>
|
||||
|
||||
<!-- VNETS -->
|
||||
<variable name='vnet_pilote' type='string' description='Pilote utilisé pour le réseau virtuel' hidden='True' />
|
||||
@ -94,11 +102,14 @@
|
||||
<variable name='activer_hooks' type='oui/non' description="Utiliser des hooks personnalisés" mode='expert'>
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable name='activer_multinode' description="Activer l'intégration de plusieurs nœuds de virtualisation" mode='expert' type='oui/non'>
|
||||
<variable name='activer_one_ha' type='oui/non' description="Activer le support pour la haute disponibilité OpenNebula" mode='expert'>
|
||||
<value>non</value>
|
||||
</variable>
|
||||
<variable name='one_nodes' type='string' description="Nom du nœud de virtualisation" multi='True' mandatory='True'/>
|
||||
<variable name='node_ip' type='ip' description="Adresse IP du nœud de virtualisation" mandatory='True'/>
|
||||
<variable name='activer_multinode' description="Activer l'intégration de plusieurs nœuds de virtualisation" mode='expert' type='oui/non'/>
|
||||
<variable name='one_nodes' type='domain' description="Nom du nœud de virtualisation" multi='True' mandatory='True'/>
|
||||
<variable name="one_ha_server_index" description="Index du serveur dans la liste des nœuds de virtualisation" type="number" mandatory="True"/>
|
||||
<variable name="one_vip" description="Adresse IP de la VIP OpenNebula" type="ip" mandatory="True"/>
|
||||
<variable name="one_vip_mask" description="Masque de sous-réseau de la VIP OpenNebula" type="netmask" mandatory="True"/>
|
||||
</family>
|
||||
<family name='Modèle' icon='cloud'>
|
||||
<variable name='hapy_init_master' type='oui/non' description="Activer l'auto-création du modèle de machine virtuelle pour installer un module EOLE">
|
||||
@ -135,7 +146,7 @@
|
||||
<separator name="one_database_type">Configuration de la base de données</separator>
|
||||
<separator name='vnet_pilote'>Configuration des réseaux de l'orchestrateur</separator>
|
||||
<separator name='one_ds_system_prefix'>Configuration de l'orchestrateur</separator>
|
||||
<separator name='activer_multinode'>Configuration des nœuds de virtualisation</separator>
|
||||
<separator name='activer_one_ha'>Configuration des nœuds de virtualisation</separator>
|
||||
</separators>
|
||||
</variables>
|
||||
|
||||
@ -194,8 +205,36 @@
|
||||
<condition name='disabled_if_in' source='activer_multinode'>
|
||||
<param>non</param>
|
||||
<target type='variable'>one_nodes</target>
|
||||
<target type='variable'>node_ip</target>
|
||||
</condition>
|
||||
<fill name='calc_val' target='activer_multinode'>
|
||||
<param type='eole' name='valeur'>activer_one_ha</param>
|
||||
</fill>
|
||||
<condition name='frozen_if_in' source='activer_one_ha'>
|
||||
<param>oui</param>
|
||||
<target type='variable'>activer_multinode</target>
|
||||
</condition>
|
||||
|
||||
<condition name='disabled_if_in' source='activer_one_ha'>
|
||||
<param>non</param>
|
||||
<target type='variable'>one_ha_server_index</target>
|
||||
<target type='variable'>one_vip</target>
|
||||
<target type='variable'>one_vip_mask</target>
|
||||
<target type='service_accesslist'>sunstone_xmlrpc</target>
|
||||
</condition>
|
||||
|
||||
<fill name='calc_val' target='one_vip_mask'>
|
||||
<param type='eole' name='valeur'>adresse_netmask_eth0</param>
|
||||
</fill>
|
||||
|
||||
<check name="valid_differ" target="adresse_ip_eth0">
|
||||
<param type='eole' hidden='False'>one_vip</param>
|
||||
</check>
|
||||
<check name="valid_differ" target="adresse_ip_gw">
|
||||
<param type='eole' hidden='False'>one_vip</param>
|
||||
</check>
|
||||
<check name="valid_ipnetmask" target="one_vip_mask" level="warning">
|
||||
<param type='eole'>one_vip</param>
|
||||
</check>
|
||||
|
||||
<group master='vnets'>
|
||||
<slave>vnet_range_start</slave>
|
||||
@ -215,10 +254,6 @@
|
||||
<slave>l2_vnet_vlan_trunk</slave>
|
||||
</group>
|
||||
|
||||
<group master='one_nodes'>
|
||||
<slave>node_ip</slave>
|
||||
</group>
|
||||
|
||||
<check name='valid_enum' target='vnets'>
|
||||
<param>['internet','admin','pedago','dmzpub','dmzpriv','wifi']</param>
|
||||
<param name='checkval'>False</param>
|
||||
@ -326,5 +361,8 @@
|
||||
<variable name='hapy_init_master_iso_version'>Version de l'ISO EOLE à télécharger lors de l'initialisation</variable>
|
||||
<variable name='vnets'>Réseau de type IPv4 (niveau 3 du modèle OSI)</variable>
|
||||
<variable name='l2_vnets'>Réseau de type ethernet (niveau 2 du modèle OSI)</variable>
|
||||
<variable name='one_ha_server_index'>Le leader à l'index 0, les followers commencent à 1</variable>
|
||||
<variable name='activer_one_ha'>Active la possibilité d'intégrer Hâpy dans une grappe de haute disponibilité OpenNebula</variable>
|
||||
<variable name="one_vip">Adresse IP virtuelle (VIP) utilisée pour joindre le "Leader" de la grappe, les usagés utiliseront cette IP pour contacter la grappe</variable>
|
||||
</help>
|
||||
</creole>
|
||||
|
@ -1,78 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
<files>
|
||||
<service_access service='sunstone_xmlrpc'>
|
||||
<port service_accesslist="sunstone_xmlrpc">2633</port>
|
||||
</service_access>
|
||||
|
||||
<service_restriction service='sunstone_xmlrpc'>
|
||||
<ip interface='eth0' ip_type='SymLinkOption'>one_followers_domain</ip>
|
||||
</service_restriction>
|
||||
</files>
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='enable_one_ha' type='oui/non' description="Activer le support pour la haute disponibilité OpenNebula" mode='expert'>
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name='Haute disponibilité' icon='cloud'>
|
||||
<variable name="one_ha_role" description="Rôle initial dans la grappe OpenNebula" type="string" mandatory="True"/>
|
||||
<variable name='one_followers_domain' description='Nom de domaine ordonnée de tous les orchestrateurs' multi="True" type="domain_strict" mandatory="True" auto_freeze="True"/>
|
||||
<variable name="one_server_index" description="Index du serveur dans la liste des orchestrateurs" type="number" mandatory="True"/>
|
||||
<variable name="one_vip" description="Adresse IP de la VIP OpenNebula" type="ip" mandatory="True"/>
|
||||
<variable name="one_vip_mask" description="Masque de sous-réseau de la VIP OpenNebula" type="netmask" mandatory="True"/>
|
||||
</family>
|
||||
<separators>
|
||||
<separator name='one_ha_role'>Rôle du nœud de virtualisation</separator>
|
||||
<separator name='one_vip'>Configuration de la VIP</separator>
|
||||
</separators>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<check name="valid_enum" target="one_ha_role">
|
||||
<param>['leader','follower']</param>
|
||||
</check>
|
||||
|
||||
<condition name='disabled_if_in' source='enable_one_ha'>
|
||||
<param>non</param>
|
||||
<target type='family'>Haute disponibilité</target>
|
||||
<target type='service_accesslist'>sunstone_xmlrpc</target>
|
||||
</condition>
|
||||
<condition name='disabled_if_in' source='one_ha_role'>
|
||||
<param>follower</param>
|
||||
<target type='variable'>one_vip</target>
|
||||
<target type='variable'>one_vip_mask</target>
|
||||
</condition>
|
||||
|
||||
<condition name='frozen_if_in' source='one_ha_role'>
|
||||
<param>leader</param>
|
||||
<target type='variable'>one_server_index</target>
|
||||
</condition>
|
||||
<auto name='calc_multi_condition' target='one_server_index'>
|
||||
<param>leader</param>
|
||||
<param type='eole' name='condition_1'>one_ha_role</param>
|
||||
<param name='match' type='number'>0</param>
|
||||
<param name='default_mismatch'>None</param>
|
||||
</auto>
|
||||
<fill name='calc_val' target='one_vip_mask'>
|
||||
<param type='eole' name='valeur'>adresse_netmask_eth0</param>
|
||||
</fill>
|
||||
<check name="valid_differ" target="adresse_ip_eth0">
|
||||
<param type='eole' hidden='False'>one_vip</param>
|
||||
</check>
|
||||
<check name="valid_differ" target="adresse_ip_gw">
|
||||
<param type='eole' hidden='False'>one_vip</param>
|
||||
</check>
|
||||
<check name="valid_ipnetmask" target="one_vip_mask" level="warning">
|
||||
<param type='eole'>one_vip</param>
|
||||
</check>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
<variable name='enable_one_ha'>Active la possibilité d'intégrer Hâpy dans une grappe de haute disponibilité OpenNebula</variable>
|
||||
<family name='Haute disponibilité'>Configuration du comportement du noeud dans la grappe</family>
|
||||
<variable name="one_ha_role">Rôle initial du noeud dans la grappe, permet de déterminer comment le serveur commence sa vie dans la grappe</variable>
|
||||
<variable name="one_vip">Adresse IP virtuelle (VIP) utilisée pour joindre le "Leader" de la grappe, les clients utiliseront cette IP pour contacter la grappe</variable>
|
||||
<variable name="one_vip_mask">Masque de sous réseau du réseau de la VIP au format CIDR (ex: 24 pour 255.255.255.0)</variable>
|
||||
</help>
|
||||
</creole>
|
@ -69,6 +69,21 @@ function check_host()
|
||||
return ${res}
|
||||
}
|
||||
|
||||
# Fix host creation error from 5.6.1 with sync methode rsync
|
||||
function sync_host()
|
||||
{
|
||||
CMD="onehost"
|
||||
OPT="sync -f --rsync"
|
||||
AUTH=$(get_one_auth)
|
||||
res=$(su - oneadmin -c "${CMD} ${OPT} --user ${AUTH%:*} --password ${AUTH#*:}")
|
||||
if [[ ${?} -ne 0 ]]
|
||||
then
|
||||
error "Hosts sync failed"
|
||||
else
|
||||
echo "Hosts sync OK"
|
||||
fi
|
||||
}
|
||||
|
||||
function manage_host()
|
||||
{
|
||||
NAME=${1}
|
||||
@ -431,7 +446,7 @@ function init_ha() {
|
||||
# server with index 1 exists if already instanciate
|
||||
onezone show 0 | grep -A 3 ^"HA & FEDERATION SYNC STATUS" | tail -n 1 | grep -q ^" 1 "
|
||||
if [ ! $? = 0 ]; then
|
||||
FOLLOWER=$(CreoleGet one_followers_domain)
|
||||
FOLLOWER=$(CreoleGet one_nodes)
|
||||
for follower in $FOLLOWER; do
|
||||
onezone server-add 0 --name $follower --rpc http://$follower:2633/RPC2
|
||||
done
|
||||
@ -441,7 +456,7 @@ function init_ha() {
|
||||
function main()
|
||||
{
|
||||
wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null"
|
||||
if [ $(CreoleGet one_ha_role) = "leader" ]; then
|
||||
if [ "$(CreoleGet activer_one_ha)" = "oui" ] && [ "$(CreoleGet one_ha_server_index)" = "0" ]; then
|
||||
init_ha
|
||||
fi
|
||||
#
|
||||
@ -466,6 +481,11 @@ function main()
|
||||
#
|
||||
attach_host ${host} "${clst_name}"
|
||||
|
||||
#
|
||||
# Force host synchronisation
|
||||
#
|
||||
sync_host
|
||||
|
||||
#
|
||||
# Création des Datastores
|
||||
#
|
||||
|
@ -33,7 +33,13 @@ function updateDB()
|
||||
|
||||
if [[ -f ${dbfile} ]]
|
||||
then
|
||||
$cmd upgrade -f -s ${dbfile}
|
||||
if [ $(CreoleGet one_database_type) = "mysql" ]; then
|
||||
if [ $(CreoleGet one_ha_server_index 0) = "0" ]; then
|
||||
$cmd sqlite2mysql -u $USER -p $PASS -d $DB -S $HOST
|
||||
fi
|
||||
else
|
||||
$cmd upgrade -f -s ${dbfile}
|
||||
fi
|
||||
res=${?}
|
||||
clean_backups ${dbfile}
|
||||
return ${res}
|
||||
@ -43,7 +49,7 @@ function updateDB()
|
||||
}
|
||||
|
||||
function to_mysql() {
|
||||
if [ "$script" = 'instance' ] && [ $(CreoleGet one_database_type) = "mysql" ] && [ $(CreoleGet one_ha_role leader) = "leader" ]; then
|
||||
if [ "$script" = 'instance' ] && [ $(CreoleGet one_database_type) = "mysql" ] && [ $(CreoleGet one_ha_server_index 0) = "0" ]; then
|
||||
Question_ouinon "Voulez-vous migrer de SQLite à Mysql ?" "True" "oui" "warn"
|
||||
rep=$(echo "$?")
|
||||
if [ "$rep" == "0" ]; then
|
||||
@ -52,20 +58,20 @@ function to_mysql() {
|
||||
DB=$(CreoleGet one_database_name)
|
||||
USER=$(CreoleGet one_database_user)
|
||||
PASS=$(CreoleGet one_database_pass)
|
||||
cp -a /etc/one/oned.conf /etc/one/oned.conf.ori
|
||||
# HA ne doit pas être activer pour la migration
|
||||
CreoleCat -s /usr/share/eole/creole/distrib/oned-ha-mysql.conf -o /etc/one/oned.conf
|
||||
oned -i
|
||||
cp -a /etc/one/oned.conf /etc/one/oned.conf.ori
|
||||
# HA ne doit pas être activer pour la migration
|
||||
CreoleCat -s /usr/share/eole/creole/distrib/oned-ha-mysql.conf -o /etc/one/oned.conf
|
||||
oned -i
|
||||
onedb sqlite2mysql -s /var/lib/one/one.db -u $USER -p $PASS -d $DB -S $HOST
|
||||
cp -a /etc/one/oned.conf.ori /etc/one/oned.conf
|
||||
cp -a /etc/one/oned.conf.ori /etc/one/oned.conf
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
echo
|
||||
to_mysql
|
||||
echo
|
||||
EchoGras "Mise à jour de la base de données ONE"
|
||||
echo
|
||||
updateDB
|
||||
echo
|
||||
to_mysql
|
||||
exit ${?}
|
||||
|
@ -90,10 +90,8 @@ then
|
||||
exit 1
|
||||
fi
|
||||
declare -a HAPY_SLV=('')
|
||||
declare -a HAPY_SLV_IP=('')
|
||||
ONEUSER=$(CreoleGet virt_user)
|
||||
HAPY_SLV=$(echo $(CreoleGet one_nodes) | sed -e "s/\n/ /g")
|
||||
HAPY_SLV_IP=$(echo $(CreoleGet node_ip) | sed -e "s/\n/ /g")
|
||||
|
||||
echo -e "\n"
|
||||
EchoBleu "Vous allez inscrire un noeud dans une grappe Hâpy"
|
||||
@ -112,7 +110,7 @@ do
|
||||
echo
|
||||
EchoVert " * Gestion des clés SSH"
|
||||
echo
|
||||
copy_ssh_id ${HAPY_SLV_IP[${i}]}
|
||||
copy_ssh_id ${HAPY_SLV[${i}]}
|
||||
[[ ${?} -ne 0 ]] && EchoRouge "Erreur lors de l'échange de clés SSH avec le noeud ${HAPY_SLV[${i}]}}"
|
||||
|
||||
EchoVert " * Enregistrement du noeud"
|
||||
|
@ -1,2 +1,2 @@
|
||||
%set global %%enable_one_ha='non'
|
||||
%set global %%activer_one_ha='non'
|
||||
%include '/var/lib/creole/oned.conf'
|
||||
|
@ -78,7 +78,7 @@ SCRIPTS_REMOTE_DIR=/var/tmp/one
|
||||
|
||||
PORT = 2633
|
||||
|
||||
%if %%enable_one_ha == 'non'
|
||||
%if %%activer_one_ha == 'non'
|
||||
LISTEN_ADDRESS = "127.0.0.1"
|
||||
%end if
|
||||
|
||||
@ -155,8 +155,8 @@ VNC_PORTS = [
|
||||
FEDERATION = [
|
||||
MODE = "STANDALONE",
|
||||
ZONE_ID = 0,
|
||||
%if %%enable_one_ha == 'oui'
|
||||
SERVER_ID = %%one_server_index,
|
||||
%if %%activer_one_ha == 'oui'
|
||||
SERVER_ID = %%one_ha_server_index,
|
||||
%else
|
||||
SERVER_ID = -1,
|
||||
%end if
|
||||
@ -172,7 +172,7 @@ RAFT = [
|
||||
XMLRPC_TIMEOUT_MS = 450
|
||||
]
|
||||
|
||||
%if %%enable_one_ha == 'oui' and %%one_ha_role == 'leader'
|
||||
%if %%activer_one_ha == 'oui' and %%one_ha_server_index == 0
|
||||
# Executed when a server transits from follower->leader
|
||||
RAFT_LEADER_HOOK = [
|
||||
COMMAND = "raft/vip.sh",
|
||||
|
@ -75,7 +75,7 @@
|
||||
MESSAGE_SIZE = 1073741824
|
||||
TIMEOUT = 60
|
||||
|
||||
%if %%enable_one_ha == 'oui'
|
||||
%if %%activer_one_ha == 'oui'
|
||||
ONE_XMLRPC = "http://%%adresse_ip_eth0:2633/RPC2"
|
||||
%else
|
||||
ONE_XMLRPC = "http://localhost:2633/RPC2"
|
||||
|
Loading…
Reference in New Issue
Block a user