17 April 2023
This is an example PowerShell version 7 script that creates/deploys a single or multinode ONTAP Select cluster using the Deploy Utility REST API. Settings are defined in a separate configuration file in standard .ini format.
The script is idempotent and can be re-executed without any known issues.
The script and associated components are provided as-is and are intended to provide an example of utilizing PowerShell version 7 and the Invoke-RestMethod cmdlet. Fully test in a non-production enviornment before implementing. Feel free to utilize/modify any portion of code for your specific needs.
- ONTAP Select 9.8 or later
- PowerShell 7.x
- vSphere 6.5 or later with ESXi hosts managed by vCenter
None
- Windows 2019 Server (jumpbox used to execute scripts)
- PowerShell version 7.2
- ONTAP Select 9.12.1
- VMware vSphere 6.7 and 7.0
- Example: PS C:\Scripts > ./otsclustercreate.ps1 -Configfile singlenode
- Implement password security in compliance with the environment and best practices. If passwords are not included in the .ini file, the script will prompt for them.
- Sample configuration files are provided for 1 and 2 node Select clusters
- Verify Settings and Environment
- Prompt for missing passwords (if not in configuration file)
- Generate Deploy credential
- Check for Existing cluster
- Add vCenter Credential
- Register ESXi Hosts - vCenter
- Get ESXi Host IDs
- Create Cluster (Initialize)
- Get Cluster ID
- Get Cluster State
- Get Node IDs
- Configure Nodes
- Get Network IDs
- Configure Networks
- Configure Storage Pools
- Deploy Cluster
None