Sunday, October 21, 2018

Series 8 - Build Windows 2017 clusters with built-in shared storage

In Series 2, we talked about providing clusters with shared storage via StarWind Virtual SAN. If you want to explore an alternative way for shared storage i'm going to show you one in this post - That is, leveraging Windows Server built-in "iSCSI Target Server" feature. Before we start, let's get familiar with a few terms -

iSCSI - It stands for "Internet Small Computer System Interface". An industry standard protocol allowing sharing block storage over the Ethernet.

iSCSI Target - An object allowing iSCSI initiator to establish a connection.

iSCSI Initiator - Usually an application server that consumes iSCSI shared storage

iSCSI virtual disk - An vhd file that can be mounted as shared disk by iSCSI initiator


Here are the steps to create three node windows cluster using this feature.

Step 1. Enable iSCSI target

In Server Manager, choose "Add roles and features" -> Role-based installation ->  Next to select HPV-HOST from server pool -> Check "File and Storage Services" -> Check "File and iSCSI Services" -> Check iSCSI Target Server -> Restart vm host to complete the feature installation.


Step 2. Configure iSCSI target Server

On HPV-HOST, launch Server Manager -> choose "File and Storage Services" -> iSCSI -> Under "TASKS" choose New iSCSI Virtual Disk 


Then pick whatever disk drive we'd like to share storage.


Give it a name and optional description.


Specify size and type of disks. We prefer Dynamic disks as we can always expand it if needed. Starting size is 30 GB


Choose New iSCSI target.


Name it as the vm host name "HPV-HOST".


Repeat above steps for E:, F: drives. Just use Existing iSCSI target which is already created for Mars.





In Access Servers pane, click Add to add Mars from initiator cache on the target server


Repeat the above steps for Jupiter and Saturn who will be two more nodes in the cluster.


Click Next button to enable authentication. Leave "Enable CHAP" and "Enable reverse CHAP" as is. Review summary page.


Click on "Create" button to create iSCSI disks. 



Step 3. Configure iSCSI initiators on cluster nodes

On Mars, go to Admin Tools -> iSCSI Initiator. Type in "HPV-HOST" in the Target box. Click Quick Connection button. If connection is successful you'll see the name and connected status. 



Repeat these steps to establish connections to the target from nodes Jupiter and Saturn.

Step 3. Configure iSCSI disks on cluster nodes

On Mars, Jupiter and Saturn you should see the following screenshot in Disk Manager. Notice the iSCSI shared disks all are shown as "Offline" and "Unknown"


Right click a disk and choose "Online". Notice the disk is now changed from "Offline" to "Not initialized". 


Richt click on the disk again and choose "Initialize Disk". 


Take default in disk initialization. After clicking OK, the disk shows up as "Basic" and "Online".


Notice the status difference among the three disks 


Right click on the disk and choose "New Simple Volume". Give it a size. 


Next assign a drive letter to the new disk. We call it X for data as D: is being used by CD-ROM


Click on Next to format the drive. Label it as "Data" and use 64KB for allocation unit size.


When format is complete, the disk drive X shows up in Windows Explorer and Disk Manager.


Repeat the above steps for log, tempdb, quorum and MSDTC drives. After all disk drives have been formatted successfully, they should look like the diagram below:


Step 4. Verify iSCSI disks on cluster nodes via Validation. We choose all tests including shared disk storage and the result is success. 







Saturday, October 20, 2018

Series 7 - How to Clone Jupiter from Mars

No, That's not what you're thinking. No celestial bodies here.

It's my personal adoption of astronomical nomenclature when naming lab computers. When building clusters i hate to go through OS installation and update patches on each node. So making a vm template is very useful. In this post I'll elaborate on how to create a vm template called "Mars" and make clone vms out of it - Jupiter, Saturn, and so forth.

Step 1. Prepare Mars as a template

1. Prep source vm server:
On Windows 2016 server Mars, prepare all stuff that needs to be replicated on other clones -
(a) Activate Windows
(b) Install Windows updates to current
(c) Install cluster service
(d) Start Microsoft iSCSI Initiator Service
(e)  Ensure two NICs exist, one for public and one for private. If you use iSCSI for storage connection you'll need three NICs
(f) Configure IE
(g) Enable remote desktop access

2. Strip SID:
Because no two identical machines can coexist on the same network at the same time, cloned vm and its source template vm must be striped of computer name, domain membership, IP address, etc. There is a Windows built-in program called SysPrep.exe we can use to make sure the internal security identifier does not duplicate. Launch the utility from Mars' C:\Windows\System32\Sysprep. Choose shutdown option to make sure the machine is off when strip operation is completed.





3. In Hyper-V Manager right click Mars and choose "Export". The vm can be in off or running state.



4. Specify the location to store the template then hit Export button. We leave it on the Hyper-V host



5. Minutes later check the file system to verify the completed template.



Step 2. Cloning of Jupiter

1. In Hyper-V Manager click on Actions "Import Virtual Machine...":


2. Choose where Mars template is stored. Note: choose the virtual machine folder


3. Click Next to confirm the source file to import.


4. Next we will select new SID.


5. Next choose the clone destination for Jupiter. 


6. As well as for the vhd file location.


7. Review the summary  and click finish.



Step 3. Cleanup

1. Upon completion of cloning we end up with two identical vms. Which one is the source and which one is the clone? Let's check vm settings to distinguish them by comparing hard disk path.


2. Click on Browse button to go to Mars.vhdx under Jupiter folder and rename it to Jupiter. Click Apply then OK. While the cloned Mars is still in highlight in Hyper-V Manager, rename it to Jupiter.

3. Start Mars and Jupiter from Hyper-V Manager. Login in console as Administrator. Both vms will go through a brief startup processes. Click on Next and Accept license terms.


4. Upon login in to Windows, compare the following items:
- Windows will take a little while to get activated
- Computer names are no longer retained (descriptions are still "Mars")
- Domain name changed to Workgroup
- Both NICs are present but their names are changed: public -> Ethernet. Private -> Ethernet 2
- IPv4 address becomes DHCP enabled
- IPv6 protocol is checked again despite being unchecked before
- On cloned vm Jupiter, Windows updates are current.


5. If you want to make more clones from Mars, then no need to change anything on it. On Jupiter make the following changes to turn it into a functional vm node.
- IP address for public and private NICs
- Subnet mask or public and private NICs
- Default gateway for public NIC only
- DNS for public NIC only
- computer name
- Join domain

6. Repeat most of the above steps to clone more vms (Saturn, Neptune, Uranus, Nibiru, etc). Since Mars can be reused there's no need to prep for template again. You can start straight from Importing vm. Also newly cloned vm is in off state which makes it easier to distinguish from its source vm (running).