xscontainer is the back-end of XenServer's Container Management.
There are 3 main entry points:
- src/xscontainer-monitor: Monitors "container managed" DomUs on the same host.
- src/xscontainer-prepare-vm: Prepares Ubuntu 14.04, RHEL/CentOS/OEL 7 DomUs to be "container managed".
- src/overlay/etc/xapi.d/plugins/xscontainer: Means for XenCenter and other components to interact with xscontainer.
This plugin is a XAPI plugin, which can be called through the host.call_plugin
method.
Reminder from the XAPI documentation:
string call_plugin (session ref, host ref, string, string, (string → string) map)
Parameters:
- session ref session_id Reference to a valid session
- host ref host The host
- string plugin The name of the plugin
- string fn The name of the function within the plugin
- (string → string) map args Arguments for the function
Result: Result from the plugin
In this case, a typical call should look like this:
host.call_plugin(sessionRef,hostRef,'xscontainer',function,args)
Example for starting a container:
host.call_plugin(sessionRef,hostRef,'xscontainer','start',(vmuuid: '<VM.UUID>', container: '<Container.UUID>'))
All the life cycle operation are defined in the function
parameters from the prototype given above. It could take those values:
- start
- stop
- restart
- pause
- unpause
args
is be a map with vmuuid: '<VM.UUID>', container: '<Container.UUID>'
The plugin returns data on a VM if it's registered.
The function
parameter could be:
- register
- deregister
args
is a map with only the VM: vmuuid: '<VM.UUID>'
TODO