2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-11-21 17:11:52 +00:00
5 The mini design of using xcat inventory templates to setup xCAT cluster with ansible
Yuan Bai edited this page 2018-04-27 16:05:44 +08:00

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