fusion one_followers_domain et one_nodes
This commit is contained in:
parent
693532b324
commit
8c28ae6e6b
|
@ -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'>
|
||||
|
@ -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>
|
|
@ -446,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
|
||||
|
@ -456,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 none)" = "leader" ]; then
|
||||
if [ "$(CreoleGet one_ha_server_index)" = "0" ]; then
|
||||
init_ha
|
||||
fi
|
||||
#
|
||||
|
|
|
@ -43,7 +43,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
|
||||
|
|
|
@ -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,7 +155,7 @@ VNC_PORTS = [
|
|||
FEDERATION = [
|
||||
MODE = "STANDALONE",
|
||||
ZONE_ID = 0,
|
||||
%if %%enable_one_ha == 'oui'
|
||||
%if %%activer_one_ha == 'oui'
|
||||
SERVER_ID = %%one_server_index,
|
||||
%else
|
||||
SERVER_ID = -1,
|
||||
|
@ -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