VMware Aria Automation | Working with Windows Server Drives
How to add Windows Server Drives to VMware Aria Automation Cloud Templates.
I want to create new Windows Servers in VMware Aria Automation that will be production ready when the server build process is complete. One item when building new Windows Servers is adding drives. I want a way to add additional drives and have the drive be online and formatted properly. Non SQL Windows Servers will have data drives formatted with 4k allocation unit size and Windows SQL Servers will have the data drives formatted with 64k allocation unit size. VMware Aria Automation provides a way to add drives OOTB (Out of the Box) but does not automatically format the drives. That is why I use a Salt state in my example. I use the salt state to bring the new drive online and format. This Blog post shows one way to accomplish these tasks. I always say, with automation there a 100 ways to do the same process. Hopefully this Blog gives you some ideas and options.
- Add Cloud Agnostic Volumes to a VMware Aria Automation Cloud Template.
- To make New Windows Server Builds consistent I show the drives that are available on the Catalog Item Custom Form. You don’t need to add any additional drives. Keep the drive sizes at the default size of “0” and the drives DO NOT get created.
- At the end of the new server build I want the new Windows Server drives to be online and formatted properly. Be production ready!
Steps to complete the process:
- Automated Salt minion installation. See the Blog Post I wrote that completes this step. Click Here
- Add grains data about the drives to minion when the minion installation completes. See example yaml code.
- Run a state file when the minion installation completes that brings the new drive online and formats the drive so that it is ready to use immediately. See example yaml code.
- This blog was created using VMware Aria Automation and VMware Aria Automation Config version 8.11.0 (Salt version 3005.1). The process may vary for different versions of VMware Aria Automation and Salt.
Cloud Template | Windows 2019 Server:
- There are (3) Cloud Agnostic Volumes on the Cloud Template for my use case. You can have as many as you want for your environment.
- The SaltStack Config Resource is added to the Cloud Template.
VMware Aria Automation Cloud Template file:
- Key elements to review in the yaml code:
- The yaml code includes grains that saves the drive information. These values are based on input from the Catalog custom form.
- the yaml code includes stateFiles to run.
- If the drive size input specified is equal to “0” then the drive count will be “0”. Drive will NOT be created.
- Click to expand yaml code
Service Broker Catalog item:
- Show the (3) drives that are available as a Standard Windows Server Build.
- To create the drives is an option. Make drive size a “0” (default Value) and the drive will NOT be created.
- Select SQL “True” will make the data drives be formatted with 64k allocation unit size, “false” will be 4k allocation unit size.
Completed Windows Server Deployment:
- Shows which salt states were used with the deployment.
- You can view the grains data that was added to the minion.
VMware Aria Automation Config State file:
- Screen shot shows the state file in SaltTack Config File Server.
- The state file is very simple. Tells the minion which PowerShell script to run.
- Click to expand yaml code
PowerShell Script to online and format new drives:
- The PowerShell file is saved within the VMware Aria Automation Config file server.
- The PowerShell script gets the grain data and stores it as variables.
- If the drive letter capacity is greater than “0” it will execute.
- Script will only run on new drives in offline mode as a safety feature. Will not do anything with existing online drives. If state is run by accident after server is in production nothing will change.
- Script uses the grain data SQL to determine how to format the drives. If grains value SQL is equal to “True” the it will use 64k allocation unit size, otherwise it uses 4k allocation unit size.
- Click to expand PowerShell code
- This screen shot shows how the drives status will be in the Windows Server Disk Management when the New Server Build is Complete. No additional steps are required to start using the drives.
- This screen shot shows where the grains file is saved.
- This screen shot shows the grains file contents.
- Saving information as grains data is a great way to save input data when creating new servers.
- The combination of having Salt State files run PowerShell scripts is very powerful when creating new Windows Servers with VMware Aria Automation.
When I write about VMware Aria Automation, I always say there are many ways to accomplish the same task. VMware Aria Automation Config is the same way. I am showing what I felt was important to see but every organization/environment will be different. There is no right or wrong way to use Salt. This is a GREAT Tool that is included with your VMware Aria Suite Advanced/Enterprise license. If you own the VMware Aria Suite, you own VMware Aria Automation Config.
- VMware Aria Automation = vRealize Automation
- VMware Aria Automation Config = SaltStack Config
- I will never add advertising to my Blog Site. If you find this blog useful and want to show your appreciation, use the Buy me a Coffee link and let me enjoy a cup of coffee on you. Thanks!