-
Notifications
You must be signed in to change notification settings - Fork 16
How to source control xCAT Cluster configuration with "xcat inventory"?
For a xCAT cluster, xCAT manage the cluster through the manipulation of cluster inventory(consisting of objects and cluster configuration) in xCAT DB. xcat-inventory
provides the native capability to manage the xCAT cluster inventory under source control, thus Admins can persistent, rollback and versioning the cluster inventory, and collaborate across the team.
The source control feature requires a source control system, like "Git", installed as the Backend. Like the typical source control workflow, xcat-inventory
provides the interfaces to manage the inventory in xCAT DB directly, while the backend source control system and repository are transparent to the Admin. Unlike the typical source control system, xcat-inventory
simplifies the source control operations based on the understanding of configuragtion source control practices. For the experienced Admins with expertise on "Git", they can directly perform source control on the Local Repo with "Git" and interact with xCAT DB with import
and export
.
Backend: the source control system, currently only "Git" is supported
Local Repo: the local Git repo
Remote Repo: the remote Git repo on Github or other central Git repository. This is optional unless Admins need to collaborate on the inventory in a central repository
Workspace: Like "branch" in Git, an independent line to trace the evolution of cluster inventory. When you need to share the same cluster with others for different purpose, or you need to collaboration with you team members in 1 cluster, "workspace" is for you.
Revision: the identity of a inventory version in the workspace, i.e, the state of cluster inventory, like "tag" or "commit" in Git except that Revision is bound to the workspace
There are 2 kinds of configuration files, global configuration file(/etc/xcat/inventory.cfg
) and local configuration file(~/.xcatinv/inventory.cfg
, for each user). If local configuration file does not exist, the global configuration file will be used.
The configuration file is to specify the backend options, it is a self-explanation file, please refer to the description(or comments) to specify the options.
-
initialize backend with
xcat-inventory init
if the backend is not initialized or the configuration file/etc/xcat/inventory.cfg
is modified. The Local Repo will be configured with the options in configuration file, the remote repository will be cloned if not cloned before, the initial workspace in the configuration file will be checkout(not imported to xCAT DB by default, runxcat-inventory checkout
to checkout the current workspace to xCAT DB). Nothing will be done if configuration file has been already applied. -
switch to the workspace you want to work on with
xcat-inventory workspace-checkout <workspace>
. To list all the existing workspaces, runxcat-inventory workspace-list
. If "" has not been created, create it withxcat-inventory workspace-new <workspace>
based on the current workspace you are on. To find out which workspace you are currently on, runxcat-inventory whereami
. To drop a workspace "", runxcat-inventory workspace-delete
-
if you want to check the difference between current inventory in xCAT DB and the current Revision in current workspace, run
xcat-inventory diff
to get an object based view -
if you want to create a new revision "" to save the current cluster inventory, run
xcat-inventory commit <Rev1> -m <comment>
. To list all the Revisions in current workspace, runxcat-inventory revlist
. To display the detail of specific Revision "", runxcat-inventory revlist <Rev1>
. If you want to rollback the a revision "", runxcat-inventory checkout <Rev1>
. -
if you have configured the "[remote_repo]" in configuration file and want to manage the cluster inventory in a central repolistory, you can run
xcat-inventory push
to push all the local Revisions in current workspace to remote repositry. You can also runxcat-inventory pull
to pull all the remote revisions on current workspace down to local repository. If you want to scan the remote repository and detect all the available workspaces and Revisions on the remote repository, runxcat-inventory radar