Add os-xenapi library¶
XenAPI is currenly involved in several OpenStack projects (e.g. Nova, Neutron, Ceilometer) and may be involved in other projects in the future. By creating a new common project to hold the common XenAPI code, it will help to reduce the duplication between these projects; and also making it easier to maintain, review and propose new changes to current and future projects.
There are serveral almost identical XenAPI classes existing in different projects.
We can refactor these classes to the common project os-xenapi. So it will reduce the code duplication and make it easier to maintain.
Specially there is currently duplication among session management and XAPI plugins.
Further, these XAPI plugins cannot conform to new Python standards as they run in XenServer’s dom0 where there is only Python2.4 (XenServer 6.5 and older releases). It makes things tricky when modify plugins and also bring trouble to add unit tests for these plugins in a way compatible with the rest of Nova.
This blueprint impacts Developers and Reviewers.
Developers will be able to submit xenapi related commits directly to os-xenapi.
Nova reviewers will not have to review low level xenapi related code.
The primary changes that needs to be done on nova are as follows:
Copy the classes from nova/virt/xenapi/client/ to os-xenapi.
Copy the plugins from
Add os-xenapi in requirements.txt
nova.virt.xenapi.clientimports used by the XenAPI driver with “os_xenapi.client”.
Improve interface between Nova and os-xenapi so dom0 plugins are invoked through python calls to os-xenapi so version consistency is provided using os-xenapi rather than an explicit API check against the plugins in dom0.
Continue to duplicate session handling and XenServer plugins between OpenStack projects.
Data model impact¶
REST API impact¶
Other end user impact¶
Other deployer impact¶
os-xenapi dependency will have to be installed in order for the XenAPI driver to be used.
In a typical scenario, a blueprint implementation for the Nova XenAPI driver may require 2 parts:
os-xenapi release, adding xenapi related utils required in order to implement the blueprint.
nova commit, implementing the blueprint and using the changes made in os-xenapi.
If a Nova commit needs changes in os-xenapi, we must release a new version of os-xenapi. The Nova change needs to bump Nova’s requirements file so we pull in the required changes and it must depends-on the global requirements change that bumps the global minimal version for os-xenapi.
If we need to backport a Nova fix to a pre-os-xenapi world and this fix depends on changes which are merged in os-xenapi, the Nova backport commit should also cover the needed changes which are equivalent of the os-xenapi changes.
As described in the ‘Proposed change’ section.
The os-xenapi library must be implemented.
os-xenapi will contain unit tests for all moved functionality
Citrix’s Xenserver CI will continue to test XenAPI changes when os-xenapi is in use.
 XenAPI support in Ceilometer: https://specs.openstack.org/openstack/ceilometer-specs/specs/juno/xenapi-support.html