What is StarWind VSAN?

StarWind VSAN eliminates any need in physical shared storage by simply mirroring internal hard disks and flash between hypervisor servers. StarWind Virtual SAN delivers performance and reliability using commercial off-the-shelf hardware, removing the need for costly proprietary components.

StarWind Virtual SAN® is entirely software-based, hypervisor-centric virtual machine storage. It creates a fault-tolerant and high-performing storage pool that is built for the virtualization workload “from scratch”. StarWind Virtual SAN® basically “mirrors” inexpensive internal storage between hosts

How to Install StarWind VSAN?

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:

PS > Get-Module 1 PS > Get-Module

Now, you can list all the available cmdlets:

PS > Get-Command -Module *Starwind* 1 PS > Get-Command -Module * Starwind *

Cool!

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

PS > Import-Module StarWindX 1 PS > Import-Module StarWindX

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:

c:\Program Files\StarWind Software\StarWind\StarWindX\Samples\powershell 1 c : \ Program Files \ StarWind Software \ StarWind \ StarWindX \ Samples \ powershell

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:

PS > New-SWServer <IP_StarWind_SERVER> <PORT_NUMBER> <LOGIN> <PWD> 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

and the number The Targets : I don’t have any target yet

: I don’t have any target yet The Devices : I don’t have any devices yet

: I don’t have any devices yet ServerInformation: I can see the StarWind version

You can easily filter and get a specific information:

PS > $server.ServerInformation 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:

PS > Set-SWLicense $server <YOUR_LICENSE_FILE> 1 PS > Set -SWLicense $server < YOUR_LICENSE_FILE >

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

PS > $server.Disconnect() 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:

PS > Add-ImageDevice PS > New-Target 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!

Thanks for reading! You can follow me on Twitter @PrigentNico