First, you must create a Windows Server based Virtual Machine, install the StarWind EXE on this Windows Server 2016. All the machines are domain joined. Let’s start by downloading the EXE from the following link: https://www.starwindsoftware.com/registration-starwind-virtual-san. You will also receive a TRIAL license key that you must copy on your StarWind server. Run the package and Accept le license agreement.

I wrote an article that describes how to install StarWind VSAN, so please read this article before going deeper: http://get-cmd.com/?p=5028

How to Manage StarWind VSAN?

In order to manage StarWind VSAN, you can use the GUI or Windows PowerShell. In this article, I will explain how to use PowerShell and especially the StarWindX Module.

Once the installation is done, you can start a PowerShell console with the StarWindX module:

Run the following command to confirm that the StarWindX module is loaded:

PowerShell

1

PS>Get-Module

Now, you can list all the available cmdlets:

PowerShell

1

PS>Get-Command-Module*Starwind*

Cool!

So, now you can also open a simple PowerShell console and then import the StarWindX module:

PowerShell

1

PS>Import-ModuleStarWindX

At this step, you machine is ready to manage your StarWind infrastructure. If don’t know how to manage StarWind, you will notice that a lot of PowerShell scripts are at your disposal. These scripts have been created by the StarWind Team and they are located in the following directory:

Before going deeper, it is a good idea to open these scripts and check their content.

Managing StarWind VSAN

First of all, we need to get some basic information about our StarWind server. So, the first thing to do is to connect to the server with the New-SWServer cmdlet:

PowerShell

1

PS>New-SWServer<IP_StarWind_SERVER><PORT_NUMBER><LOGIN><PWD>

By default, the login is ‘root’ and the password is ‘starwind’.

Import the module

Set the StarWind Server information

Connect to the server

Display the result

This script is essential to work with StarWindX. You must be connected before running any cmdlet:

Here, I can notice:

The IP and the port number

The Targets: I don’t have any target yet

The Devices: I don’t have any devices yet

ServerInformation: I can see the StarWind version

You can easily filter and get a specific information:

PowerShell

1

PS>$server.ServerInformation

Licensing

If you have a valid license file, it easy to import this file using PowerShell. Here, I copy/paste my license key in the ‘C:\Temp\’ folder and then use the Set-SWLicense cmdlet:

PowerShell

1

PS>Set-SWLicense$server<YOUR_LICENSE_FILE>

After running your script, it is still a best practice to run the ‘Disconnect’ command:

PowerShell

1

PS>$server.Disconnect()

To finish, you can create your targets and devices using PowerShell. To perform these tasks, you can run the following command:

PowerShell

1

2

3

PS>Add-ImageDevice

PS>New-Target

To get more information about the ouput, run the ‘$target’ variable:

Great! A target has been created which is called ‘targetimg1’ with a device called ‘img1’.

If you have more than one target, then you can use the ‘foreach-loop’:

Conclusion

For those of you who are wondering why using PowerShell instead of the GUI, then I can only say: ‘Just for automation’. The StarWind VSAN GUI is nice and very responsive, but sometimes it could be very useful to automate some tasks to save time. StarWind VSAN allows you to manage the infrastructure by command line which is not always the case for the others softwares. Of course, if you just have to create one target, then don’t worry about automation!

I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers.
.
I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.

About Nicolas

I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers.
.
I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am “MCSE: Cloud Platform and Infrastructure”,”MCSA: Windows Servers” and “Administering & Deploying SCCM” certified.