Dell Infrastructure-as-a-code: Terraforming with PowerScale/OneFS

Ambar Hassani
3 min readFeb 28, 2024

This blog is part of the Dell Infrastructure-as-a-code saga series. In this blog, we will explore and experience the Terraform integration for Dell PowerScale. By doing so., the simplicity, scalability of PowerScale gets further amplified with the agility of Infrastructure-as-a-code.

The extensible attributes of Dell’s PowerScale, whether delivered on-prem, co-located OR as a software defined storage in the public cloud makes it an impeccable choice for a broad range of workloads that depend on file services and alike. Under the hood, OneFS, which is a multiprotocol software framework delivers remarkable performance especially for highly demanding workloads.

Such is the nature of PowerScale platform, that it can accommodate a range of use-cases from traditional file workloads to latest advents in AI/ML and GenAI.

Let’s roll in!

The above visual is self-explanatory and the outcome we are looking for is an automated deployment of PowerFlex filesystem, NFS exports using Terraform and ability to mount the same in a ubuntu machine.

The entire demo can be seen in this video

For reference the configurations used in this demo are documented below. The demo configurations serve as starting point for the PowerScale Terraform provider. However, the possibilities are immense with the full range of capabilities documented on the Terraform site Docs overview | dell/powerscale | Terraform | Terraform Registry and the GitHub site dell/terraform-provider-powerscale: Terraform Provider for Dell PowerScale (github.com)

variables.tf file

variable "username" {
type = string
default = "root"
}

variable "password" {
type = string
default = "Test@1234"
}

variable "endpoint" {
type = string
default = "https://10.204.111.100:8080"
}

variable "insecure" {
type = bool
default = true
}

In this configuration set, we are creating a user, group, filesystem with user/group ownership and a NFS export with access control.

main.tf file

terraform {
required_providers {
powerscale = {
source = "registry.terraform.io/dell/powerscale"
version = "1.1.0"
}
}
}

provider "powerscale" {
username = var.username
password = var.password
endpoint = var.endpoint
insecure = var.insecure
}

resource "powerscale_user" "example_user" {
name = "ubuntu"
enabled = true
}

resource "powerscale_user_group" "example_user_group" {
name = "ubuntu"
users = [powerscale_user.example_user.name]
}

resource "powerscale_filesystem" "example_file_system" {
directory_path = "/ifs"
name = "data1"
group = {
id = format("%s:%s", "GID", powerscale_user_group.example_user_group.gid)
name = powerscale_user_group.example_user_group.name
type = "group"
}
owner = {
id = format("%s:%s", "UID", powerscale_user.example_user.uid)
name = powerscale_user.example_user.name,
type = "user"
}
access_control = "public_read_write"
recursive = true
}

resource "powerscale_nfs_export" "example_export" {
paths = [powerscale_filesystem.example_file_system.full_path]
clients = ["0.0.0.0"]
map_all = {
enabled = true,
primary_group = {
id = format("%s:%s", "GROUP", powerscale_user_group.example_user_group.gid)
}
user = {
id = format("%s:%s", "USER", powerscale_user.example_user.uid)
}
}
}

output "powerscale_nfs_export" {
value = powerscale_nfs_export.example_export
}

Happy PowerScaling with Terraform,

cheers

Ambar@thecloudgarage

#iwork4dell

--

--

Ambar Hassani

24+ years of blended experience of technology & people leadership, startup management and disruptive acceleration/adoption of next-gen technologies