Modified on: Fri, Jan 19, 2018 at 3:00 PM





This post will show you how to setup a high availability iSCSI volume across two Windows Server 2016 Core installations for testing.

We will be using some batch files and powershell scripts (attached to this post) for this process.



You will need to download StarWind vSAN Free and attain a license for this to work.



NOTE:

This is "fine" for a lab or testing environment but should not be used for production (due to slow sync times of the HA iSCSI volume being handled by only one NIC).

Please check back to this site for a more in-depth HOW-TO on setting this up on Microsoft Hyper-V Core and creating a, virtually, free HA Hyper-V cluster!!

Overview:

We are going to build out this model (see image below) on VirtualBox for testing.





As you can see from the image...





We will be setting up 3 NICs on each system.

The NIC on 10.1.1.x will be used for iSCSI connectivity and system management.

The NIC on 10.1.4.x will be used for the StarWind vSAN Free heartbeat status.

The NIC on 10.1.5.x will be used for the StarWind vSAN Free volume sync.





The systems will have their names changed to VSAN001 and VSAN002.

VirtualBox:

The configuration of each machine, in VirtualBox, is:

Please note that each machine only has 2048MB (2GB) of RAM (the minimum required for Windows Server 2016 Core).

Please note that each machine has 3 NICs all on the "Internal" network named "intnet".

In this example my image has a 50GB dynamic volume assigned to each VM. This could be any size you desire as long as it will hold the iSCSI volume.

A note on scripts:

For this example to work you will need to download the attached filed, extract them and get them onto your machines.

I will be using the shared folder option with VirtualBox to get the files to my machines.

All batch files, scripts, executables and licenses will be run from C:\Install

The PowerShell scripts will be run from the command prompt using this syntax: C:\Install\powershell .\script_name.ps1

Power on your systems that you need for this example and login as administrator. Download the ZIP file attached to this post and save it. Extract that ZIP file to a folder to be copied to each system. Register for your StarWind vSAN Free software and license here. Download the EXE file and save the license file to the prior used location. Once you have all your files, transfer them to each system and into the C:\Install directory. It should look like this when complete (files in yellow ARE NOT included in my ZIP file).

Let's look at the file "!_TOPOLOGY.txt" file to verify we have the correct download. It should look like this.

Let's make sure the NICs are installed and ready. Run the batch file "STEP01_show_nics.bat" on your system. It should display something like this on both systems.

On each system you will need to run the PowerShell script "STEP02_change_ip_on_VSAN00X.ps1" (whereas X=1 on VSAN001 and X=2 on VSAN002). When done you should see this.



NOTE: We can only see the last NIC that had it's IP address changed. We should verify our IP addressing with IPCONFIG if we are uncertain it worked. On each system you will need to run the PowerShell script "STEP03_change_pc_name_to_VSAN00X.ps1" (whereas X=1 on VSAN001 and X=2 on VSAN002). You will be prompted for your password and your system WILL reboot during this process. You should see something like this.

Once rebooted, re-login to each system. On each system you will need to run the batch file "STEP04_disable_firewall.bat". This just runs the command "NetSh AdvFirewall set allprofiles state off". I'm doing to this simplify this example. In your environment you may choose to manage this differently and open only specific ports. Once complete you should see this.

On each system we need to run the batch file STEP05_install_vsan.bat to install the StarWind vSAN Free software. I'm doing this on Windows Server 2016 Core. If you try to run the GUI installation, you will run into problems (I've found). It will also prompt you to start the Microsoft iSCSI Initiator service, click OK to allow this. It will look like this when it does.

Then like this close to the end of the install. It only takes a few moments.

If you are unsure if the install completed properly, you can run NET START to check what services are running. This is not a script I wrote... just a nice to do kinda thing.

On each machine you will need to run the PowerShell script STEP06_create_VSAN_directory.ps1. This will create the folder C:\VSAN on each machine it is run on. It looks like this.

At this point we have the PC name change, the IP addresses changed, the directory made and the software installed. We are now going to create a 20GB iSCSI SAN volume in the C:\VSAN folder using the script STEP07_Create_2_node_HA_volume.ps1. While running it will look like this.

You can monitor, or check, the sync status from VSAN002 by running the PowerShell script STEP08_check_sync_state_VSAN002.ps1. It will show you this.

NOTE: The RED arrow points to the result on the server VSAN002. The GREEN arrows point to the sync status and should be noted that they are the same. When complete, you have a 20GB High Availability, redundant, iSCSI volume... albeit slow and for testing only. It will end its process like this.





Now you have some "know-how" and some scripts. With this, you can go and build out a larger, production, setup.





Keep in mind that if you do this all within the 1st 30 days of your license, you have access to the GUI.

In my example I did not install the GUI and thus it would make no difference.





Check out the scripts in the OPT folder, there is one in there for expanding your iSCSI volume!!





I hope this works for you.























