xCAT is an opensource automating deployment, scaling, and management of bare metal servers and virtual machines developed by IBM. It has been widely used in top tier super computers in the world.
With Terraform, xCAT can provide a self-serving way for the cluster user to apply compute resources, no need to go though xCAT documentation and follow the complex steps to finish jobs like node provision, hardware control, etc.
- Terraform v0.11.13
mkdir -p /git/
cd /git/
git clone [email protected]:xcat2/terraform-provider-xcat.git
glide up --strip-vendor
make
then you can find the built terraform-provider-xcat
binary in $GOROOT/bin
directory
or leverage the xCAT terraform builder docker image on https://cloud.docker.com/u/xcat/repository/docker/xcat/tfpbuilder
Download Terraform binary from https://github.com/xcat2/terraform-provider-xcat/releases
$ wget [Terraform Binary URL] -O /usr/bin/terraform
$ chmod +x /usr/bin/terraform
Download xCAT Terraform provider binary from https://github.com/xcat2/terraform-provider-xcat/releases
$ wget [xCAT Terraform Provider URL] -O ~/.terraform.d/plugins/terraform-provider-xcat
$ chmod +x ~/.terraform.d/plugins/terraform-provider-xcat
$ chdef <xCAT nodes to be added into the pool> groups=free usercomment=","
Label the nodes with IB
$ chdef <xCAT nodes with IB> usercomment=",ib=1,"
Label the nodes with GPU
$ chdef <xCAT nodes with IB> usercomment=",gpu=1,"
$ mkdir -p ~/mycluster/
$ cd ~/mycluster/
$ terraform init
An example cluster TF files can be found in https://github.com/xcat2/terraform-provider-xcat/tree/master/templates/devcluster. Modify the TF files according to your need
Refer https://www.terraform.io/docs/configuration/index.html for the Terraform HCL syntax
- plan:
$ cd ~/mycluster/
$ terraform plan
- resource apply:
$ terraform apply
- resource update:
modify the tf file and run
$ terraform apply
- resource release:
$ terraform destroy