The mini design of using xcat inventory templates to setup xCAT cluster with ansible - xcat2/xcat-core GitHub Wiki

User case:

As a xCAT user, I can setup xCAT testing/production cluster rapidly with ansible, I can testing things in a testing environment, then rapidly setup production cluster.

The summary of the user case:

As a xCAT user, I have ansible node host1, xCAT automation playbook and xcat-inventory data in github. I want to use ansible to setup host2 as xCAT MN cluster rapidly. (host1 and host2 can be the same host) The steps:

  1. Make sure ssh password-less between host1 and host2.
  2. git checkout xCAT ansible playbook xcat-automation on host1, run ansible-playbook command using main playbook under xcat-automation diretory to setup and configure xCAT cluster on host2. After the command is finished, xCAT cluster is ready on host2.

Playbook workflow to setup a xCAT cluster:

  1. download xCAT from xcat.org, and install xCAT on target MN ------(Done, need to formalize the structure)

  2. configure xCAT MN using xcat-inventory templates ------(#task55)

    • configure site object
    • configure passwd object
    • configure networks object
    • configure route object
    • configure policy object
    • import node object
    • import osimage object (pending)
  3. switch Database (Mysql or Postgresql) ------(Not Done)

  4. OS image management ------(partially Done, osimage template is not ready in xcat-inventory )

  5. xCAT nodes management ------(Not Done)

    • node.list
    • node.delete
    • node.update
  6. xCAT network service management ------(Not Done)

    • DNS
    • DHCP
  7. invoke OS provision ------(Not Done)

    • rinstall/nodeset/rsetboot/rpower to invoke OS provision

The structure of the playbooks design

The playbook is named xcat-automation, its structure is at the end of this part. Here is the explanation of the structure.

  1. xcat-automation is the playbooks top directory name. It contains fast_cluster.yaml and 3 directories (templates, cluster.example and ansible).

  2. fast_cluster.yaml is basic cluster configuration file

  3. templates stores xcat-inventory templates file

  4. cluster.example stores configuration example files for advanced scenarios, for example, configuration files for using mellanox_cuda osimage cluster.

  5. ansible directory contains ansible playbooks.

    • the common directory contains non-xcat function playbook.
    • the xcat directory contains xcat function playbook.
      • install.xcat is to install xCAT using go-xcat.
      • configure.xcat is to configure xCAT MN using xcat-inventory templates
      • nodes is to manage node object
      • osimage is to manage osimage object
      • database is to switch db ( mysql, postgresql)
      • provision is to use rinstall or nodeset,rsetboot,rpower to invoke OS provision
xcat-automation
β”œβ”€β”€ fast_cluster.yaml
β”‚
β”œβ”€β”€ cluster.exmaple
β”‚   β”œβ”€β”€ hierarchy_cluster.yaml
β”‚   β”œβ”€β”€ mellanox_cuda.yaml
β”‚   └── ... ...
β”‚ 
β”œβ”€β”€ templates
β”‚   └── xcat_inventory_template.yaml
β”‚ 
└── ansible
    └──roles
         β”œβ”€β”€ common   
         └── xcat
             β”œβ”€β”€ install.xcat
             β”‚ 
             β”œβ”€β”€ configure.xcat 
             β”‚   └── tasks
             β”‚        β”œβ”€β”€ main.yaml
             β”‚        β”œβ”€β”€ networks.yaml
             β”‚        β”œβ”€β”€ passwd.yaml
             β”‚        β”œβ”€β”€ site.yaml
             β”‚        β”œβ”€β”€ node.yaml
             β”‚        └── ... ...
             β”‚    
             β”œβ”€β”€ network.service
             β”‚   β”œβ”€β”€ DHCP
             β”‚   └── DNS
             β”œβ”€β”€ nodes
             β”‚   β”œβ”€β”€ node.list
             β”‚   β”œβ”€β”€ node.update       
             β”‚   └── node.delete
             β”œβ”€β”€ osimage
             β”‚ 
             β”œβ”€β”€ database
             β”‚       β”œβ”€β”€ mysql
             β”‚       └── postgresql
             └── provision