nfv/mtce-guest/src
Andrei Suciu 987d5b9b77 Debian: Fix mtce-guest services on Debian
Modified mtce-guest to address the following failing services on Debian:
guestAgent.service
guestServer.service
(the service provides a means of guest heartbeat
orchestration under VIM (system management) control)

Applied fix:
- Included modified .service files for debian directly into
the deb_folder.
- Included "override_dh_installsystemd" section to rules in order
to start guestServer at boot and guestAgent with --no-enable option
- Removed guestAgent.service and guestServer.service install from
Makefile to spec, in order to override (for CentOS build)
- Modified service scripts to fork for Daemon location
- Move binaries to usr/local/bin

PASS: Package installed and ISO built on Debian successfully
PASS: Services are running correctly after loading the image:
guestServer is started automatically, guestAgent (--no-enable) runs
correctly when started via systemctl
PASS: guestServer runs as expected after bootstrap

PASS: Package installed and ISO built on CentOS successfully
PASS: Services are running on CentOS after bootstrap and
unlock correctly

Story: 2009101
Task: 44323


Change-Id: I856fcc78c41953ae37e7c2cf1361b4466b15720b
2022-04-01 00:58:42 +00:00
..
scripts Add Debian packaging for mtce-guest, nova-api-proxy and nfv. 2021-11-02 06:39:28 -05:00
LICENSE Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
Makefile Debian: Fix mtce-guest services on Debian 2022-04-01 00:58:42 +00:00
README.txt Change compute node to worker node personality 2018-12-14 14:15:16 -05:00
guestAgent.cpp Change compute node to worker node personality 2018-12-14 14:15:16 -05:00
guestBase.h Remove wrs-guest-heartbeat SDK Module 2019-04-17 16:34:14 -04:00
guestClass.cpp Change compute node to worker node personality 2018-12-14 14:15:16 -05:00
guestClass.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestHttpSvr.cpp Add Debian packaging for mtce-guest, nova-api-proxy and nfv. 2021-11-02 06:39:28 -05:00
guestHttpSvr.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestHttpUtil.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestHttpUtil.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestInstClass.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestInstClass.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestServer.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestStubs.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestSvrFsm.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestSvrHdlr.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestSvrMsg.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestSvrMsg.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestSvrUtil.cpp replace readdir_r with readdir in guestSvrUtil.cpp 2019-03-04 20:54:38 +08:00
guestSvrUtil.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestUtil.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestUtil.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestVimApi.cpp Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestVimApi.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guestVirtio.cpp Fix destination buffer too small issue by static analyze tool 2018-11-27 10:13:07 +08:00
guestVirtio.h Decouple Guest-server/agent from stx-metal 2018-09-19 11:38:04 -04:00
guest_heartbeat_msg_defs.h Remove wrs-guest-heartbeat SDK Module 2019-04-17 16:34:14 -04:00

README.txt

This maintenance common guest service provides a means of guest heartbeat
orchestration under VIM (system management) control.

1. Packaging and Initialization:

   The packaging of the heartbeat daemon and heartbeat_init
   script are modified:

   a. image.inc and filter_out packaging files are modified to exclude the
      heartbeat daemon from being packaged on the controller.

   b. because the heartbeat daemon is still packaged on the worker
      heartbeat_init script is modified to prevent the heartbeat
      daemon from being spawned on the worker host.

2. Compute Function: Heartbeats the guest and reports failures.

   Package: cgts-mtce-common-guestServer-1.0-r54.0.x86_64.rpm
   Binary: /usr/local/bin/guestServer
   Init: /etc/init.d/guestServer
   Managed: /etc/pmon.d/guestServer.pmon

3. Controller Function: Guest heartbeat control and event proxy

   Package: cgts-mtce-common-guestAgent-x.x-rxx.x86_64.rpm
   Binary: /usr/local/bin/guestAgent
   Init: /usr/lib/ocf/resource.d/platform/guestAgent
   Managed: by SM

   The heartbeat daemon that did run on the controller is replaced by a new
   guestAgent daemon performing the following functions

   a. HTTP Command Receiver : to which the VIM sends instance control commands.
   b. HTTP Event Transmitter: to which the daemon can send instance failure
                              events and state query commands to the VIM.
   c. State query audit

Behavioral Executive Summary:

The guestServer daemon (on the worker) listens for (using inotify) 'uuid'
UNIX named heartbeat communication channels that nova:libvirt creates and
opens in /var/lib/libvirt/qemu whenever an instance is created. Example: 

/var/lib/libvirt/qemu/cgcs.heartbeat.02e172a9-aeae-4cef-a6bc-7eb9de7825d6.sock

The guestServer connects (and auto reconnects) to these channels when they are
created or modified and disconnects from them when deleted.

Once connected, the guestServer listens for TCP messages over that UNIX named
socket. 

If a guest supports heartbeating then it will run the heartbeat_init script
during its initialization process. Once the heartbeat daemon is running it 
will periodically send init request messages to the libvirt pipe that, 
on the host side, the guestServer is listening for. 

on receipt of an init message, the guestServer will extract name, timeout
and corrective action info from it and then send back an 'init_ack' followed
by a continuous heartbeat cycle consisting of sending a 'challenge' request
messages and expecting a correct computational responses within a guest specified
heartbeat window. Failure to comply will result in a corrective action that was
specified in the init message from the guest.

The VIM is responsible for enabling and disabling heartbeat fault reporting as
well as taking the guest specified corrective action in he event of a heartbeat
failure.