
Creating a Cloud Template yaml file using chatgpt v.3.5:
Aria Automation Cloud Templates are based on yaml files and powershell scripts, as well as some Orchestrator Workflows.
I was curious about using ChatGPT to create the basic config in the template, creating a cloud template *.yaml file and a powershell script for formatting the disks and set the blocksize, so i logged in and started with:
Me:
“create a aria automation cloud template for a windows2019 server with 4cpu, 12gb memory and 3 virtual disk with 100gb each”
ChatGPT:
To create an Aria Automation Cloud template for a Windows Server 2019 with the specified configuration (4 CPUs, 12GB memory, and 3 virtual disks of 100GB each), you would typically use a YAML configuration file. Below is an example YAML configuration that you can use:

Explanation:
name: Specifies the name of the template.version: Specifies the version of the template.description: Provides a description of the template.resources: Defines the resources for the template.name: Specifies the name of the virtual machine.type: Specifies the type of resource, in this case, a virtual machine (vm).image: Specifies the image or operating system for the virtual machine, in this case, Windows Server 2019.cpus: Specifies the number of CPUs for the virtual machine.memory: Specifies the memory size for the virtual machine.disks: Specifies the virtual disks for the virtual machine, each with a size of 100GB.
You can save this configuration in a file with a .yaml extension, for example, windows2019_template.yaml. Then, you can use this YAML file to create the template in Aria Automation Cloud. Make sure to adjust the image name according to the available Windows Server 2019 image in your Aria Automation Cloud environment.
Me:
and can you add nsx network vlan203?
ChatGPT:
To add an NSX network with VLAN 203 to the Aria Automation Cloud template, you would typically include network configuration within the YAML file. Here’s an updated version of the previous YAML configuration that includes the NSX network VLAN 203:

To add an NSX network with VLAN 203 to the Aria Automation Cloud template, you would typically include network configuration within the YAML file. Here’s an updated version of the previous YAML configuration that includes the NSX network VLAN 203:
Me:
and can you say first disk 100gb disk letter c:, second disk 120gb disk letter E:, and third disk 200gb disk letter F: ?
ChatGPT:
Certainly! To specify disk letters for each virtual disk in the Aria Automation Cloud template, you can use the disk_letter property. Here’s the updated YAML configuration:

Explanation:
disks: Specifies the virtual disk configuration for the virtual machine.- Each disk entry includes the
sizeproperty for specifying the size of the disk. - The
disk_letterproperty is used to assign the desired disk letter to each disk.
- Each disk entry includes the
With this configuration, the first disk will be assigned the letter C:, the second disk will be assigned E:, and the third disk will be assigned F:. You can adjust the disk sizes and letters according to your requirements. After updating the YAML file, use it to create the template in Aria Automation Cloud.
Me:
and are the disks formatted and ready to use?
ChatGPT:
In the context of the Aria Automation Cloud template, the disks specified in the configuration are typically presented to the virtual machine but are not automatically formatted or prepared for use.
Once the virtual machine is provisioned based on the template, it’s up to the user or administrator to perform any necessary disk management tasks, such as formatting the disks, creating partitions, and assigning drive letters within the guest operating system (in this case, Windows Server 2019).
You would typically use automation scripts, configuration management tools, or manual steps within the guest operating system to initialize and prepare the disks for use according to your specific requirements. This might involve using disk management tools within Windows to format the disks, create volumes, and assign drive letters as needed.
Me:
do you have an example for a automation script that format the disks?
ChatGPT:
Sure, here’s an example PowerShell script that you can use to format disks and assign drive letters in Windows. This script assumes that the disks have already been presented to the virtual machine and you know their disk numbers (e.g., Disk 1, Disk 2, Disk 3).

Explanation:
- The script uses the
Format-Volumecmdlet in PowerShell to format the volumes of the disks and assign drive letters. - Each disk is formatted with the NTFS file system.
- The
-Confirm:$falseparameter is used to suppress confirmation prompts.
Make sure to adjust the $disk1Number, $disk2Number, and $disk3Number variables with the appropriate disk numbers assigned to the virtual disks in your environment. Also, adjust the $disk1Letter, $disk2Letter, and $disk3Letter variables to specify the desired drive letters for each disk.
You can save this script as a .ps1 file and then run it within the guest operating system of the virtual machine to format and assign drive letters to the disks. Make sure to run the script with appropriate permissions, typically as an administrator.
Me:
and can you add blocksize to that script?
ChatGPT:
Certainly! You can specify the allocation unit size (block size) when formatting the volumes in Windows. Here’s the updated script with the block size specified:

Explanation:
- The
$blockSizevariable is set to specify the desired allocation unit size in bytes (e.g., 4096 for a 4KB allocation unit). - The
-AllocationUnitSizeparameter is added to theFormat-Volumecmdlet to specify the block size for formatting the volumes.
Adjust the $blockSize variable according to your requirements. The script will format the volumes of the disks with the specified block size and assign drive letters to them. Save the script as a .ps1 file and run it within the guest operating system of the virtual machine with appropriate permissions.
This shows us the many uses of ChatGPT and AI, and in this case giving us a quick start for creating our blueprint in Aria Automation.
Copy of the *.yaml file:
name: Windows2019_Template
version: 1
description: Template for Windows Server 2019 with 4 CPUs, 12GB memory, 3 virtual disks of 100GB, 120GB, and 200GB each, NSX network VLAN 203, and disk letters assigned.
resources:
– name: windows2019_server
type: vm
image: windows2019
cpus: 4
memory: 12GB
disks:
– size: 100GB
disk_letter: C:
– size: 120GB
disk_letter: E:
– size: 200GB
disk_letter: F:
networks:
– name: vlan203_network
type: nsx
vlan: 203
Copy of the disk format powershell script:
# Initialize variables for disk numbers and drive letters
$disk1Number = 1
$disk2Number = 2
$disk3Number = 3
$disk1Letter = “C”
$disk2Letter = “E”
$disk3Letter = “F”
$blockSize = 4096 # Specify the desired block size in bytes (e.g., 4096 for 4KB)
# Format and assign drive letters to disks with specified block size
Format-Volume -DriveLetter $disk1Letter -FileSystem NTFS -AllocationUnitSize $blockSize -Confirm:$false
Format-Volume -DriveLetter $disk2Letter -FileSystem NTFS -AllocationUnitSize $blockSize -Confirm:$false
Format-Volume -DriveLetter $disk3Letter -FileSystem NTFS -AllocationUnitSize $blockSize -Confirm:$false
New yaml and powershell:
Looking at the config, i realized that i had to change the c disk, because the image will already have a C, so i changed the question a bit to include the existing disk:
Me:
create a aria automation cloud template for a windows2019 server with 4cpu, 12gb memory and 3 virtual disks, nsx network vlan 203, image has a c disk 100gb, add disk 2 letter d 100gb, disk 3 letter e 120gb ,disk 4 letter f 200gb
ChatGPT:
Below is the updated Aria Automation Cloud template YAML configuration based on your requirements:

Explanation:
- The template defines a Windows Server 2019 virtual machine with 4 CPUs and 12GB of memory.
- The
diskssection includes the existing disk (C:) from the image and additional disks (D:, E:, F:) with their respective sizes and drive letters specified. - The NSX network with VLAN 203 is also included in the template configuration.
Ensure to adjust the disk sizes, drive letters, and network details according to your requirements. Once you have saved this YAML configuration file, you can use it to create the template in Aria Automation Cloud.
I then needed to update the powershell script:
Me:
do you have an example for a automation script that format the disks with block size?
ChatGPT:
Certainly!

Explanation:
- This script formats disks with drive letters D:, E:, and F: with the specified block size.
- It uses the
Format-Volumecmdlet to format the volumes of the disks and assigns the desired block size using the-AllocationUnitSizeparameter. - The
-Confirm:$falseparameter suppresses confirmation prompts during the formatting process.
Make sure to adjust the $disk2Letter, $disk3Letter, and $disk4Letter variables according to the drive letters you want to assign to the disks. Additionally, modify the $blockSize variable to specify the desired block size in bytes. Save this script as a .ps1 file and run it within the guest operating system of the virtual machine to format the disks with the specified block sizes and assign drive letters.
And the new files:
Cloud template *.yaml file:
name: Windows2019_Template
version: 1
description: Template for Windows Server 2019 with 4 CPUs, 12GB memory, NSX network VLAN 203, and additional disks with specific drive letters.
resources:
– name: windows2019_server
type: vm
image: windows2019
cpus: 4
memory: 12GB
disks:
– size: 100GB
disk_letter: C:
– size: 100GB
disk_letter: D:
– size: 120GB
disk_letter: E:
– size: 200GB
disk_letter: F:
networks:
– name: vlan203_network
type: nsx
vlan: 203
And the powershell format disk script:
formatdisk.ps
# Define disk numbers and drive letters
$disk1Letter = “C”
$disk2Letter = “D”
$disk3Letter = “E”
$disk4Letter = “F”
$blockSize = 4096 # Specify the desired block size in bytes (e.g., 4096 for 4KB)
# Format and assign drive letters to disks with specified block size
Format-Volume -DriveLetter $disk2Letter -FileSystem NTFS -AllocationUnitSize $blockSize -Confirm:$false
Format-Volume -DriveLetter $disk3Letter -FileSystem NTFS -AllocationUnitSize $blockSize -Confirm:$false
Format-Volume -DriveLetter $disk4Letter -FileSystem NTFS -AllocationUnitSize $blockSize -Confirm:$false
“Automation frees humans from the mundane and repetitive, allowing us to focus on creativity, innovation, and problem-solving. It’s not about replacing people; it’s about empowering them to do more meaningful work.”
Next post i will add the 2019 image to Aria Automation, and import the files to test and see if it works.

Leave a comment