Ubuntu HPC linux Container Creation on Infra Node

From Notes_Wiki

Home > Ubuntu > Ubuntu HPC setup with slurm and linux containers > Ubuntu HPC linux Container Creation on Infra Node

LXD Container Setup for Slurm Controller

This section covers the steps to configure LXD containers for different roles in the Slurm cluster — including the Slurm controller, LDAP server, and login node.

All these Linux containers will be created on top of the infra node, which acts as the NFS server and central point of control for the cluster.

  • Create a storage pool
  • Create and customize a profile with bridged networking and custom storage
  • Create and launch a container using the above profile

Note: Before performing the above step, make sure to create the Linux bridge on the infra node using Netplan. For detailed instructions, please refer to the link below: https://fabianlee.org/2022/09/20/kvm-creating-a-bridged-network-with-netplan-on-ubuntu-22-04/

1. Create Storage Pool

First, create a storage pool to hold container data.
 
$ lxc storage list 
$ lxc storage create hpc-store dir 
$ lxc storage list 
hpc-store is the name of the new storage pool using the dir backend.

2. Create and Configure a Profile

Clone the default profile to a new one called hpc-profile:
 
$ lxc profile list 
$ lxc profile copy default hpc-profile 
Attach the storage pool to the new profile:
 
$ lxc profile device add hpc-profile root disk path=/ pool=hpc-store 
Add bridged network interfaces (eno1 and eno2) to the profile:
 
$ lxc profile device add hpc-profile eno1 nic nictype=bridged parent=br–eno1 name=eno1 
$ lxc profile device add hpc-profile eno2 nic nictype=bridged parent=br–eno2 name=eno2 
Replace br–eno1 and br–eno2 with the actual Linux bridge names on your system.

3. Create and Start the Container

Create a new container named slurm-login using Ubuntu 22.04 and the custom hpc-profile:
 
$ lxc init -p hpc-profile ubuntu:22.04 slurm-login 
List and start the container:
 
$ lxc list 
$ lxc start slurm-login

Note

In the above steps, we are creating only the login node. Similarly, we need to create three other containers, each with a specific role:

  • slurm-master – for configuring the Slurm controller (master node)
  • slurm-db – for configuring the Slurm accounting database (slurmdbd)
  • slurm-ldap – for configuring the LDAP server used for user synchronization across the cluster

All of these containers will be hosted on the infra node (which also acts as the NFS server).

User Access Model

  • All cluster users will have access only to the login node.
  • They will not have access to other nodes (e.g., slurm-master, slurm-db, or slurm-ldap).
  • Only administrators will have access to manage those service containers.

This access model ensures that users cannot introduce misconfigurations or create package conflicts on critical nodes. It helps maintain a stable, centralized, and secure cluster environment.

Home > Ubuntu > Ubuntu HPC setup with slurm and linux containers > Ubuntu HPC linux Container Creation on Infra Node