Authenticating to an Azure CycleCloud Slurm cluster with Azure Active Directory
Overview:
Azure CycleCloud is an enterprise-friendly tool for orchestrating and managing High Performance Computing (HPC) environments on Azure. With CycleCloud, users can provision infrastructure for HPC systems, deploy familiar HPC schedulers, and automatically scale the infrastructure to run jobs efficiently at any scale.
As enterprises increasingly move to using Azure Active Directory for their authentication needs this blog explores how Azure AD and OpenSSH certificate-based authentication may be used to provide authentication to a Slurm cluster. We also utilise the recent Azure Bastion native client support feature to provide remote access to the Login Node over the public internet.
Summarising, we will use the native Azure AD Linux authentication to access the Login Node through the Azure Bastion host, using a temporal, provisioned ssh key. Once logged into the Login Node, the CycleCloud provisioned user account and ssh keys will guarantee authentications to the scheduler and compute nodes. AAD authentication can improve the security to access our environment by enabling the possibility to use conditional access enabling for example multi-factor authentication before being able to use SSH.
Components:
This solution uses an existing Azure AD Tenant and very standard deployments of CycleCloud 8.2, Azure Files NFS (to provide a persistent /shared folder), a Login Node (more details later) and Azure Bastion (Standard SKU). I prefer to deploy these using Bicep. The OS used for all VMs is the AlmaLinux 8.5 HPC image.
Solution:
1) Azure Bastion, this is a typical deployment of Azure Bastion with the only additional considerations being to ensure it is the Standard SKU and that enableTunneling is set to true.
2) Login Node, again a standard virtual machine deployment. To interact with the Slurm cluster it should have Slurm and Munge installed with configurations matching your Slurm cluster. The /shared folder is also mounted to provide access to the shared home folders. Typically to enable AAD auth for Linux we would ensure the VM has a System Assigned Managed Identity and add the AADSSHLoginForLinux extension. As the extension does not currently support AlmaLinux it has been installed using Cloud Init referencing the RHEL 8 RPMs. Additionally note how the default home directory for new users has been changed to /shared/home and use of NFS for home directories enabled.
To be able to access the VM, the last thing to do is to assign an RBAC role to allow the user to login. This could be the Vitual Machine User Login role, for normal users, or the Virtual Machine Administrator Login, for system administrators. Here an example to assign the role to a standard user:
More details about the necessary steps to enable the SSH login on the VM can be found here.
With this in place we now configure Azure role assignments authorizing our user to log in to the VM and use the Azure CLI to connect to the Login Node via Azure Bastion.
Note the user’s home directory name, uid/gid and create an ssh pubkey pair for use with the cluster. This will be used to create a matching ‘local’ user in the CycleCloud user management system.
3) CycleCloud, with the user access to the Login Node now established we must grant the user access to the Compute Nodes. For this the built-in CycleCloud user management system is used and we will create a matching ‘local’ user to our AAD principal.
The default CycleCloud Slurm template is used to create the cluster with the default NFS share mounted from the Azure Files NFS share.
Conclusion:
With the cluster started and ‘local’ user assigned we can update the Login Node to ensure it has the correct munge key and the slum.conf is pointing to the scheduler. From the Login Node our AAD Authenticated user can now submit and run jobs on the cluster.
Reference:
Published on:
Learn moreWe can help you with Authenticating to an Azure CycleCloud Slurm cluster with Azure Active Directory
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
Upcoming Changes to Instance Size Flexibility Ratios for Reserved VM Instances for M-series: What Yo
Overview In the ever-evolving landscape of cloud computing, it is crucial to stay informed about changes that may affect your usage and busine...
Exploring SUSE Enterprise Linux on Azure
Exploring SUSE Enterprise Linux on Azure In today's cloud-centric world, leveraging robust and reliable operating systems is crucial for busin...
Announcing Public Preview of new attach/detach disks API for VMs/VMSS
We are excited to announce the public preview of a new API that will make attaching and detaching disks to a VM faster and easier. The new API...
Fine-tuning a Hugging Face Diffusion Model on CycleCloud Workspace for Slurm
Introduction Azure CycleCloud Workspace for Slurm (CCWS) is a new Infrastructure as a Service (IaaS) solution which allows the users to purpos...
Public Preview Announcement-On Demand Capacity Reservation in Azure in China
Today, we're announcing the public preview of on demand capacity reservations for Azure Virtual Machines in Azure in China Cloud . Y...
Breaking change for Window Server 2022 Image Users with .NET 6
Azure Marketplace media images for Windows Server 2022 currently include .NET 6, but going forward will not include a .NET version with the im...
Announcing the public preview of the new Azure FXv2-series Virtual Machines
Today, Microsoft is announcing the public preview of the new Azure FXv2-series Virtual Machines (VMs), based on the 5th Generation Intel® Xeon...
Effortlessly Migrate Azure VMs between zones
For various reasons you might come across a situation when you need to migrate your Azure VMs from one zone to another. Migrating Azure VMs be...
Announcing Public Preview of Instance Mix on Virtual Machine Scale Sets
Today, we’re excited to announce that the ability to specify multiple different VM sizes in your Virtual Machine Scale Sets (VMSS) with Flexib...
Announcing General Availability of Attach & Detach of Virtual Machines on Virtual Machine Scale Sets
Today, we’re thrilled to announce that the ability to attach or detach Virtual Machines (VMs) to and from a Virtual Machine Scale Set (VMSS) w...