en HA RPC doit être accessible sur eth0

This commit is contained in:
Emmanuel Garette 2019-02-20 14:17:48 +01:00
parent 6d2199121d
commit 67c7ba9b97
5 changed files with 127 additions and 23 deletions

View File

@ -4,6 +4,7 @@
<!--file filelist='onesinglenode' name='/etc/one/sunstone-server.conf' rm='True' mkdir='True'/-->
<file filelist='onesinglenode' name='/etc/one/vmm_exec/vmm_exec_kvm.conf' rm='True' mkdir='True'/>
<file filelist='onesinglenode' name='/etc/one/oned.conf' rm='True'/>
<file filelist='onesinglenode' name='/etc/one/sched.conf' rm='True'/>
<file filelist='onesinglenode' name='/var/lib/one/remotes/etc/vnm/OpenNebulaNetwork.conf' rm='True' mkdir='True'/>
<file filelist='onesinglenode' name='/etc/one/auth/ldap_auth.conf'/>
@ -20,7 +21,6 @@
<service_access service='sunstone'>
<port port_type="SymLinkOption">port_sunstone</port>
<port port_type="SymLinkOption">vnc_proxy_port_sunstone</port>
<port port_type="SymLinkOption">xmlrpc_port_sunstone</port>
</service_access>
</files>
<variables>
@ -37,14 +37,6 @@
<value>default</value>
</variable>
<!-- XMLRPC -->
<variable name='activer_xmlrpc_port_sunstone' type='oui/non' description="Activer l'accès distant à l'API XML-RPC" mode='expert'>
<value>non</value>
</variable>
<variable name='xmlrpc_port_sunstone' type='number' description="Numéro de port d'écoute de l'API XML-RPC" mode='expert' mandatory="True">
<value>2633</value>
</variable>
<!-- Base de donnée -->
<variable name="one_database_type" description="Moteur de base de données a utiliser" type="string" mode="expert">
<value>sqlite</value>
@ -138,7 +130,6 @@
<variable name='hapy_user_hook_arguments' type='string' description="Arguments à passer au script (arguments)" mode='expert'/>
</family>
<separators>
<separator name='activer_xmlrpc_port_sunstone'>Configuration du service XML-RPC</separator>
<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>
@ -164,11 +155,6 @@
<param name='checkval'>False</param>
</check>
<condition name='disabled_if_in' source='activer_xmlrpc_port_sunstone'>
<param>non</param>
<target type='variable'>xmlrpc_port_sunstone</target>
</condition>
<condition name='disabled_if_in' source='activer_onesinglenode'>
<param>non</param>
<target type='filelist'>onesinglenode</target>

View File

@ -1,6 +1,13 @@
<?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'>
@ -10,8 +17,8 @@
</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_server_index" description="Index du serveur dans la liste des orchestrateurs follower" type="number" mandatory="True"/>
<variable name='one_followers_domain' description='Nom de domaine des orchestrateurs follower' multi="True" type="domain_strict" mandatory="True" auto_freeze="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>
@ -29,10 +36,10 @@
<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_followers_domain</target>
<target type='variable'>one_vip</target>
<target type='variable'>one_vip_mask</target>
</condition>

View File

@ -428,13 +428,10 @@ function manage_datastores()
}
function init_ha() {
onezone show 0 | grep -A 2 ^"HA & FEDERATION SYNC STATUS" | tail -n 1 | grep -q ^" 0 "
# 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
# server 0 not displayed with onezone
SERVER=$(CreoleGet one_master)
DOMAIN=$(CreoleGet nom_domaine_machine)
FOLLOWER=$(CreoleGet one_followers_domain)
onezone server-add 0 --name $SERVER --rpc http://$DOMAIN:2633/RPC2
for follower in $FOLLOWER; do
onezone server-add 0 --name $follower --rpc http://$follower:2633/RPC2
done

View File

@ -78,7 +78,11 @@ SCRIPTS_REMOTE_DIR=/var/tmp/one
PORT = 2633
%if %%one_ha_role == 'oui'
LISTEN_ADDRESS = %%adresse_ip_eth0
%else
LISTEN_ADDRESS = "127.0.0.1"
%end if
%if %%one_database_type == "sqlite"
DB = [ BACKEND = "sqlite" ]

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 %%one_ha_role == '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
]