Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F4525095
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
12 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/man/fence_virt.conf.5 b/man/fence_virt.conf.5
index 68738478..82b00dd7 100644
--- a/man/fence_virt.conf.5
+++ b/man/fence_virt.conf.5
@@ -1,283 +1,284 @@
.TH fence_virtd.conf 5
.SH NAME
fence_virt.conf - configuration file for fence_virtd
.SH DESCRIPTION
The fence_virt.conf file contains configuration information for fence_virtd,
a fencing request routing daemon for clusters of virtual machines.
The file is tree-structured. There are parent/child relationships and sibling
relationships between the nodes.
foo {
bar {
baz = "1";
}
}
There are three primary sections of fence_virt.conf.
.SH SECTIONS
.SS fence_virtd
This section contains global information about how fence_virtd is to operate.
The most important pieces of information are as follows:
.TP
.B listener
.
the listener plugin for receiving fencing requests from clients
.TP
.B backend
.
the plugin to be used to carry out fencing requests
.TP
.B foreground
.
do not fork into the background.
.TP
-.B wait_for_backend
+.B wait_for_init
.
-wait for the backend management layer to initialize rather than giving up immediately
+wait for the frontend and backends to become available rather than giving up immediately.
+This replaces wait_for_backend in 0.2.x.
.TP
.B module_path
.
the module path to search for plugins
.SS listeners
This section contains listener-specific configuration information; see the
section about listeners below.
.SS backends
This section contains listener-specific configuration information; see the
section about listeners below.
.SS groups
This section contains static maps of which virtual machines
may fence which other virtual machines; see the section
about groups below.
.SH LISTENERS
There are various listeners available for fence_virtd, each one handles
decoding and authentication of a given fencing request. The following
configuration blocks belong in the \fBlisteners\fP section of fence_virt.conf
.SS multicast
.TP
.B key_file
.
the shared key file to use (default: /etc/cluster/fence_xvm.key).
.TP
.B hash
.
the hashing algorithm to use for packet signing (default: sha256, but could
be sha1, sha512, or none)
.TP
.B auth
.
the hashing algorithm to use for the simplistic challenge-response authentication
(default: sha256, but could be sha1, sha512, or none)
.TP
.B family
.
the IP family to use (default: ipv4, but may be ipv6)
.TP
.B address
.
the multicast address to listen on (default: 225.0.0.12)
.TP
.B port
.
the multicast port to listen on (default: 1229)
.TP
.B interface
.
interface to listen on. By default, fence_virtd listens on all interfaces.
However, this causes problems in some environments where the host computer
is used as a gateway.
.SS serial
The serial listener plugin utilizes libvirt's serial (or VMChannel)
mapping to listen for requests. When using the serial listener, it is
necessary to add a serial port (preferably pointing to /dev/ttyS1) or
a channel (preferrably pointing to 10.0.2.179:1229) to the
libvirt domain description. Note that only type
.B unix
, mode
.B bind
serial ports and channels are supported. Example libvirt XML:
.in 8
<\fBserial\fP type='unix'>
<source mode='bind' path='/sandbox/guests/fence_socket_molly'/>
<target port='1'/>
</serial>
<\fBchannel\fP type='unix'>
<source mode='bind' path='/sandbox/guests/fence_molly_vmchannel'/>
<target type='guestfwd' address='10.0.2.179' port='1229'/>
</serial>
.in 0
.TP
.B uri
.
the URI to use when connecting to libvirt by the serial plugin.
.TP
.B path
.
Sockets must reside in this directory in order to be considered
valid. This can be used to prevent fence_virtd from using the wrong
sockets.
.TP
.B mode
.
This selects the type of sockets to register. Valid values are "serial"
(default) and "vmchannel".
.SH BACKENDS
There are various backends available for fence_virtd, each one handles
routing a fencing request to a hypervisor or management tool. The following
configuration blocks belong in the \fBbackends\fP section of fence_virt.conf
.SS libvirt
The libvirt plugin is the simplest plugin. It is used in environments where
routing fencing requests between multiple hosts is not required, for example
by a user running a cluster of virtual machines on a single desktop computer.
.TP
.B uri
.
the URI to use when connecting to libvirt.
.SS libvirt-qpid
The libvirt-qpid plugin acts as a QMF Console to the libvirt-qpid daemon in
order to route fencing requests over AMQP to the appropriate computer. There
are currently no configuration options for libvirt-qpid.
.TP
.B host
.
host or IP address of qpid broker. Defaults to 127.0.0.1.
.TP
.B port
.
IP port of qpid broker. Defaults to 5672.
.TP
.B username
.
Username for GSSAPI, if configured.
.TP
.B service
.
Qpid service to connect to.
.TP
.B gssapi
.
If set to 1, have fence_virtd use GSSAPI for authentication when communicating
with the Qpid broker. Default is 0 (off).
.SS checkpoint
The checkpoint plugin uses CMAN, CPG, and OpenAIS checkpoints to track virtual
machines and route fencing requests to the appropriate computer.
.TP
.B uri
.
the URI to use when connecting to libvirt by the checkpoint plugin.
.TP
.B name_mode
.
The checkpoint plugin, in order to retain compatibility with fence_xvm,
stores virtual machines in a certain way in the OpenAIS checkpoints. The
default was to use 'name' when using fence_xvm and fence_xvmd, and so this
is still the default. However, it is strongly recommended to use 'uuid'
instead of 'name' in all cluster environments involving more than one
physical host in order to avoid the potential for name collisions.
.SH GROUPS
Fence_virtd supports static maps which allow grouping of VMs. The
groups are arbitrary and are checked at fence time. Any member of
a group may fence any other member. Hosts may be assigned to multiple
groups if desired.
.SS group
This defines a group.
.TP
.B uuid
.
defines UUID as a member of a group.
.TP
.B ip
.
defines an IP which is allowed to send fencing requests
for members of this group (e.g. for multicast). It is
highly recommended that this be used in conjunction with
a key file.
.SH EXAMPLE
fence_virtd {
listener = "multicast";
backend = "checkpoint";
}
# this is the listeners section
listeners {
multicast {
key_file = "/etc/cluster/fence_xvm.key";
}
}
backends {
libvirt {
uri = "qemu:///system";
}
}
groups {
group {
ip = "192.168.1.1";
uuid = "44179d3f-6c63-474f-a212-20c8b4b25b16";
uuid = "1ce02c4b-dfa1-42cb-b5b1-f0b1091ece60";
}
}
.SH SEE ALSO
fence_virtd(8), fence_virt(8), fence_xvm(8), fence(8)
diff --git a/server/main.c b/server/main.c
index c5507dc5..a1f381c5 100644
--- a/server/main.c
+++ b/server/main.c
@@ -1,241 +1,247 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
/* Local includes */
#include <stdint.h>
#include <fence_virt.h>
#include <simpleconfig.h>
#include <static_map.h>
#include <server_plugin.h>
#include <debug.h>
#include <syslog.h>
/* configure.c */
int do_configure(config_object_t *config, const char *filename);
int daemon_init(const char *prog, int nofork);
int daemon_cleanup(void);
void
usage(void)
{
printf("Usage: fence_virtd [options]\n");
printf(" -F Do not daemonize.\n");
printf(" -f <file> Use <file> as configuration file.\n");
printf(" -d <level> Set debugging level to <level>.\n");
printf(" -c Configuration mode.\n");
printf(" -l List plugins.\n");
}
static int run = 1;
void
exit_handler(int sig)
{
run = 0;
}
int
main(int argc, char **argv)
{
char val[4096];
char listener_name[80];
char backend_name[80];
const char *config_file = DEFAULT_CONFIG_FILE;
config_object_t *config = NULL;
map_object_t *map = NULL;
const listener_plugin_t *lp;
const backend_plugin_t *p;
listener_context_t listener_ctx = NULL;
backend_context_t backend_ctx = NULL;
int debug_set = 0, foreground = 0, wait_for_init = 0;
int opt, configure = 0;
config = sc_init();
map = map_init();
if (!config || !map) {
perror("malloc");
return -1;
}
while ((opt = getopt(argc, argv, "Ff:d:cwlh")) != EOF) {
switch(opt) {
case 'F':
printf("Background mode disabled\n");
foreground = 1;
break;
case 'f':
printf("Using %s\n", optarg);
config_file = optarg;
break;
case 'd':
debug_set = atoi(optarg);
break;
case 'c':
configure = 1;
break;
case 'w':
wait_for_init = 1;
break;
case 'l':
plugin_dump();
return 0;
case 'h':
case '?':
usage();
return 0;
default:
return -1;
}
}
if (configure) {
return do_configure(config, config_file);
}
if (sc_parse(config, config_file) != 0) {
printf("Failed to parse %s\n", config_file);
return -1;
}
if (debug_set) {
snprintf(val, sizeof(val), "%d", debug_set);
sc_set(config, "fence_virtd/@debug", val);
} else {
if (sc_get(config, "fence_virtd/@debug", val, sizeof(val))==0)
debug_set = atoi(val);
}
dset(debug_set);
if (!foreground) {
if (sc_get(config, "fence_virtd/@foreground",
val, sizeof(val)) == 0)
foreground = atoi(val);
}
if (!wait_for_init) {
if (sc_get(config, "fence_virtd/@wait_for_init",
val, sizeof(val)) == 0)
wait_for_init = atoi(val);
+ if (!wait_for_init) {
+ /* XXX compat */
+ if (sc_get(config, "fence_virtd/@wait_for_backend",
+ val, sizeof(val)) == 0)
+ wait_for_init = atoi(val);
+ }
}
if (dget() > 3)
sc_dump(config, stdout);
if (sc_get(config, "fence_virtd/@backend", backend_name,
sizeof(backend_name))) {
printf("Failed to determine backend.\n");
printf("%s\n", val);
return -1;
}
dbg_printf(1, "Backend plugin: %s\n", backend_name);
if (sc_get(config, "fence_virtd/@listener", listener_name,
sizeof(listener_name))) {
printf("Failed to determine backend.\n");
printf("%s\n", val);
return -1;
}
dbg_printf(1, "Listener plugin: %s\n", listener_name);
#ifdef _MODULE
if (sc_get(config, "fence_virtd/@module_path", val,
sizeof(val))) {
#ifdef MODULE_PATH
snprintf(val, sizeof(val), MODULE_PATH);
#else
printf("Failed to determine module path.\n");
return -1;
#endif
}
dbg_printf(1, "Searching %s for plugins...\n", val);
opt = plugin_search(val);
if (opt > 0) {
dbg_printf(1, "%d plugins found\n", opt);
} else {
printf("No plugins found\n");
return 1;
}
#endif
if (dget() > 3)
plugin_dump();
lp = plugin_find_listener(listener_name);
if (!lp) {
printf("Could not find listener \"%s\"\n", listener_name);
return 1;
}
p = plugin_find_backend(backend_name);
if (!p) {
printf("Could not find backend \"%s\"\n", backend_name);
return 1;
}
daemon_init(basename(argv[0]), foreground);
signal(SIGINT, exit_handler);
signal(SIGTERM, exit_handler);
signal(SIGQUIT, exit_handler);
syslog(LOG_NOTICE, "fence_virtd starting. Listener: %s Backend: %s", backend_name, listener_name);
while (p->init(&backend_ctx, config) < 0) {
if (!wait_for_init) {
if (foreground) {
printf("Backend plugin %s failed to initialize\n",
backend_name);
}
syslog(LOG_ERR,
"Backend plugin %s failed to initialize\n",
backend_name);
return 1;
}
sleep(5);
}
if (map_load(map, config) < 0) {
syslog(LOG_WARNING, "Failed to load static maps\n");
}
/* only client we have now is mcast (fence_xvm behavior) */
while (lp->init(&listener_ctx, p->callbacks, config, map,
backend_ctx) != 0) {
if (!wait_for_init)
if (foreground) {
printf("Listener plugin %s failed to initialize\n",
listener_name);
}
syslog(LOG_ERR,
"Listener plugin %s failed to initialize\n",
listener_name);
return 1;
}
sleep(5);
}
while (run && lp->dispatch(listener_ctx, NULL) >= 0);
syslog(LOG_NOTICE, "fence_virtd shutting down");
map_release(map);
sc_release(config);
lp->cleanup(listener_ctx);
p->cleanup(backend_ctx);
daemon_cleanup();
return 0;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Jun 26, 5:46 PM (22 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1959271
Default Alt Text
(12 KB)
Attached To
Mode
rF Fence Agents
Attached
Detach File
Event Timeline
Log In to Comment