GNU/Linux >> Tutoriels Linux >  >> Linux

Service d'exploitation Linux "xendomains"

Le service xendomains démarre, arrête et migre automatiquement les clients Oracle VM (domU) lorsque le serveur Oracle VM (dom0) démarre ou s'arrête. Essentiellement, le service xendomains émet automatiquement une série de commandes xm pour s'assurer que les clients Oracle VM appropriés sont démarrés et arrêtés lorsque le serveur dom0 est démarré ou arrêté. Aucun démon ou autre processus d'arrière-plan n'est contrôlé par le service xendomains ; uniquement les machines virtuelles clientes dom0.

Faisant partie du produit Oracle VM Server, le service xendomains est fourni dans le cadre du package RPM xen-tools et est généralement installé dans le cadre du produit Oracle VM Server.

Lors du démarrage du système dom0, le service xend (décrit ailleurs) est lancé. Peu de temps après, le service xendomains est exécuté. Tous les clients domU dont le statut a été enregistré par un arrêt antérieur sont démarrés par le script /etc/init.d/xendomains. Ensuite, tous les clients domU marqués pour un démarrage automatique sont également démarrés. Ceci fait, le service xendomains se termine alors.

Pour empêcher les tentatives d'exécution de

# service xendomains start

commande plusieurs fois et donc potentiellement exécuter plusieurs instances des clients domU, le script xendomains maintient le fichier de verrouillage /var/lock/subsys/xendomains, comme c'est la pratique courante parmi les services Linux. Si ce fichier de verrouillage existe, le service ne peut pas être redémarré; si aucun client virtuel n'a été démarré, ce fichier de verrouillage n'est pas créé.

Lors de l'arrêt du système dom0, avant que le service xend ne soit terminé, le service xendomains est exécuté à nouveau pour traiter tous les clients domU encore en cours d'exécution. L'arrêt du client est divisé en plusieurs étapes :

Étape Obligatoire ? Description
Sélectionner Oui Gérer tous les domaines domU ou uniquement ceux marqués comme AUTO
SysRQ Facultatif Les domaines clients peuvent éventuellement être contrôlés en envoyant des touches magiques Alt-SysRQ à la machine virtuelle.
Migrer Facultatif Les domaines clients toujours en cours d'exécution après les frappes de touche Alt-SysRQ peuvent être migrés vers un autre hôte dom0 en cours d'exécution à l'aide de la commande "xm migrate".
Enregistrer Facultatif Émettez une commande "xm save" à tous les domaines clients encore exécutés localement après l'étape de migration.
Arrêt Oui Émettez la commande "xm shutdown" pour arrêter correctement tous les clients virtuels encore en cours d'exécution localement.
Nettoyage Oui Supprimez le fichier de verrouillage de service.

Nature

Il s'agit d'un service qui s'exécute une fois au démarrage du système pour démarrer les machines clientes Oracle VM sélectionnées et une fois avant l'arrêt du système pour migrer, enregistrer ou arrêter toutes les machines clientes Oracle VM en cours d'exécution.

Contrôle des services

Pour exécuter automatiquement le service xendomains au prochain démarrage du système, utilisez la commande :

# chkconfig xendomains on
# chkconfig --list xendomains
xendomains   0:off  1:off  2:off  3:on   4:on   5:on   6:off

Pour invoquer manuellement le service xendomains, utilisez la commande :

# service xendomains help
Usage: /etc/init.d/xendomains  {start|stop|restart|reload|status}

Les détails de chaque fonction sont résumés ci-dessous :

Commande Description
démarrer Restaurer tous les clients domU enregistrés. Démarrez les clients domU marqués comme AUTO.
arrêter Arrêtez toutes les machines virtuelles clientes en cours d'exécution, en utilisant les méthodes décrites précédemment.
redémarrer Équivalent à une séquence d'arrêt / démarrage.
recharger Équivalent à redémarrer la commande.
statut Afficher une liste des domaines clients virtuels en cours d'exécution. Si aucun, renvoie le code de sortie 3.

Configuration

Le comportement du service xendomains est contrôlé par le fichier /etc/sysconfig/xendomains. Ce fichier bien commenté contrôle la façon dont les clients domU sont gérés par le service. Vous trouverez ci-dessous un exemple de fichier de configuration :

## Path: System/xen
## Description: xen domain start/stop on boot
## Type: string
## Default: 
#
# The xendomains script can send SysRq requests to domains on shutdown.
# If you don't want to MIGRATE, SAVE, or SHUTDOWN, this may be a possibility
# to do a quick and dirty shutdown ("s e i u o") or at least sync the disks
# of the domains ("s").
#
XENDOMAINS_SYSRQ=""

## Type: integer 
## Default: 100000
#
# If XENDOMAINS_SYSRQ is set, this variable determines how long to wait
# (in microseconds) after each SysRq, so the domain has a chance to react.
# If you want to a quick'n'dirty shutdown via SysRq, you may want to set
# it to a relatively high value (1200000).
#
XENDOMAINS_USLEEP=100000

## Type: integer
## Default: 5000000
#
# When creating a guest domain, it is sensible to allow a little time for it
# to get started before creating another domain or proceeding through the
# boot process. Without this, the booting guests will thrash the disk as they
# start up. This timeout (in microseconds) specifies the delay after guest
# domain creation.
#
XENDOMAINS_CREATE_USLEEP=5000000

## Type: string
## Default: ""
#
# Set this to a non-empty string if you want to migrate virtual machines
# on shutdown. The string will be passed to the xm migrate DOMID command
# as is: It should contain the target IP address of the physical machine
# to migrate to and optionally parameters like --live. Leave empty if
# you don't want to try virtual machine relocation on shutdown.
# If migration succeeds, neither SAVE nor SHUTDOWN will be executed for
# that domain.
#
XENDOMAINS_MIGRATE=""

## Type: string
## Default: /var/lib/xen/save
#
# Directory to save running domains to when the system (dom0) is
# shut down. Will also be used to restore domains from if # XENDOMAINS_RESTORE
# is set (see below). Leave empty to disable domain saving on shutdown 
# (e.g. because you rather shut domains down).
# If domain saving does succeed, SHUTDOWN will not be executed.
#
XENDOMAINS_SAVE=/var/lib/xen/save

## Type: string
## Default: "--halt --wait"
#
# If neither MIGRATE nor SAVE were enabled or if they failed, you can
# try to shut down a domain by sending it a shutdown request. To do this,
# set this to "--halt --wait". Omit the "--wait" flag to avoid waiting
# for the domain to be really down. Leave empty to skip domain shutdown.
#
XENDOMAINS_SHUTDOWN="--halt --wait"

## Type: string
## Default: "--all --halt --wait"
#
# After we have gone over all virtual machines (resp. all automatically
# started ones, see XENDOMAINS_AUTO_ONLY below) in a loop and sent SysRq,
# migrated, saved and/or shutdown according to the settings above, we
# might want to shutdown the virtual machines that are still running
# for some reason or another. To do this, set this variable to
# "--all --halt --wait", it will be passed to xm shutdown.
# Leave it empty not to do anything special here.
# (Note: This will hit all virtual machines, even if XENDOMAINS_AUTO_ONLY
# is set.)
# 
XENDOMAINS_SHUTDOWN_ALL="--all --halt --wait"

## Type: boolean
## Default: true
#
# This variable determines whether saved domains from XENDOMAINS_SAVE
# will be restored on system startup. 
#
XENDOMAINS_RESTORE=true

## Type: string
## Default: /etc/xen/auto
#
# This variable sets the directory where domains configurations
# are stored that should be started on system startup automatically.
# Leave empty if you don't want to start domains automatically
# (or just don't place any xen domain config files in that dir).
# Note that the script tries to be clever if both RESTORE and AUTO are 
# set: It will first restore saved domains and then only start domains
# in AUTO which are not running yet. 
# Note that the name matching is somewhat fuzzy.
#
XENDOMAINS_AUTO=/etc/xen/auto

## Type: boolean
## Default: false
# 
# If this variable is set to "true", only the domains started via config 
# files in XENDOMAINS_AUTO will be treated according to XENDOMAINS_SYSRQ,
# XENDOMAINS_MIGRATE, XENDOMAINS_SAVE, XENDMAINS_SHUTDOWN; otherwise
# all running domains will be. 
# Note that the name matching is somewhat fuzzy.
# 
XENDOMAINS_AUTO_ONLY=false

## Type: integer
## Default: 300
#
# On xendomains stop, a number of xm commands (xm migrate, save, shutdown,
# shutdown --all) may be executed. In the worst case, these commands may
# stall forever, which will prevent a successful shutdown of the machine.
# If this variable is non-zero, the script will set up a watchdog timer
# for every of these xm commands and time it out after the number of seconds
# specified by this variable.
# Note that SHUTDOWN_ALL will not be called if no virtual machines or only
# zombies are still running, so you don't need to enable this timeout just
# for the zombie case.
# The setting should be large enough to make sure that migrate/save/shutdown
# can succeed. If you do live migrations, keep in mind that live migration
# of a 1GB machine over Gigabit ethernet may actually take something like
# 100s (assuming that live migration uses 10% of the network # bandwidth).
# Depending on the virtual machine, a shutdown may also require a significant
# amount of time. So better setup this variable to a huge number and hope the
# watchdog never fires.
#
XENDOMAINS_STOP_MAXWAIT=300


Linux
  1. Service du système d'exploitation Linux "dhcpd"

  2. Service d'exploitation Linux "anacron"

  3. Service d'exploitation Linux "iptables"

  4. Service de système d'exploitation Linux "réseau"

  5. Service d'exploitation Linux "portmap"

Service du système d'exploitation Linux 'microcode_ctl'

Service d'exploitation Linux "hplip"

Service d'exploitation Linux "irqbalance"

Service de système d'exploitation Linux "rpcgssd"

Service d'exploitation Linux "yum-updatesd"

Service d'exploitation Linux "acpid"