Вы находитесь на странице: 1из 18

4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog

39;s Blog - Site Home - TechNet Blogs

All About Cloud OS Blogs Datacenter Client Virtualization, File & Storage & Windows Server Identity & Access
Windows Server Management Management VDI & Remote High Availability Management
Desktop

Jose Barreto's Blog


A blog by Jose Barreto, a member of the File Server team at Microsoft.

Deploying a Windows Server 2012 R2 Scale-Out File Server


Cluster using Azure VMs
Jose Barreto - MSFT 29 Mar 2014 10:36 AM 5

0) Overview

In this document, I am sharing the steps I used to create a Windows Server 2012 R2 Scale-Out File Server Cluster
environment using only Azure VMs, for demo, test or development purposes.

This includes a few important tips and tricks to install Active Directory and Windows Server Failover Clustering in an Azure
VM environment which are not well known.

Following these steps will probably requires a reasonable amount of work, but it is a great way to experiment with a large
set of Microsoft technologies in or related to Windows Server 2012 R2, including:

Azure VMs
Azure Virtual Networks
Domain Name Services (DNS)
Active Directory Domain Services (AD-DS)
Failover Clustering
Scale-Out File Servers
PowerShell

You will need the following to perform the steps described here:

Any computer with access to the internet that can connect to Azure
An active Azure subscription (you can get a free trial from http://azure.com)
No server hardware is required. No download of Windows Server 2012 R2 is required.

Notes and disclaimers:

A certain familiarity with Windows administration and configuration is assumed.


Very little knowledge of Azure is assumed. If you’re already familiar with it, sorry for boring you with all the details.
If you are asked a question or required to perform an action that you do not see described in these steps, go with
the default option.
There are usually several ways to perform a specific configuration or administration task. What I describe here is
one of those many ways. It's not necessarily the best way, just the one I personally like best at the moment.
Throughout these instructions, I’ll prefix all items with “JOSE-324”. For your specific setup, choose your own unique
prefix to avoid naming conflicts with other users in the Azure cloud.
The iSCSI Target Server configuration shown here is not highly available. For this reason, this setup should only be
used for demo, test or development purposes.
IMPORTANT NOTE: Due to the item above this should *not* be used for Production
environments.

1) Get to the portal

Browse to http://azure.com, then click on “portal” in the top bar.

Sign in with your Microsoft account to view the Azure Portal.

2) Create an Azure Virtual Network

Click on the “Virtual Networks” icon (shown above).

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 1/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Click on the “Create a Virtual Network” link.

Enter the name for the virtual network, the region closest to you and an affinity group name for the new virtual network.
Click on the right arrow on the bottom right to continue.

Leave everything blank on the “DNS Servers and VPN Connectivity” page. Click on the right arrow to continue.

Accept the default 10.0.0.0/8 address space and configure a subnet for 10.1.1.0/24. Click on the Check icon to finish
creating the virtual network. Then wait until the virtual network is created (this will take a moment).

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 2/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Review the configuration of the virtual network.

3) Create an Azure Storage Account

Click on the “Storage” icon (shown above).

Click on the “Create a Storage Account” link.

Enter the name for the storage account (URL), the affinity group (same you used on the virtual network) and click on
“Create Storage Account”. Wait for the storage account to be created (this will take a moment).

Review the configuration of the storage account.

4) Create an Azure Virtual Machine for the domain controller

Click on the “Virtual Machines” icon (shown above).

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 3/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Click on the “Create a Virtual Machine” link.

Instead of using the “Quick Create” option, click on the “From Gallery” option to bring in the full wizard.

On the “Choose an Image” page, click on “Windows Server 2012 R2 Datacenter”. Click on the right arrow on the bottom
right to continue.

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 4/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs
Use the latest release date, enter a virtual machine name for your domain controller, select the small size, enter a user
name and type in a password twice. Click on the right arrow on the bottom right to continue.

On this page, keep the default to “create a new cloud service”, keep the cloud service DNS name the same as the virtual
machine name, select the virtual name we created previously, select the subnet that we created previously, select the
storage account we created previously and keep the availability set to “(None)”. Click on the right arrow on the bottom
right to continue.

Keep all the defaults for the virtual machine configuration. Click on the Check icon to finish creating the virtual machine.
Then wait until the virtual machine is created (this will take a moment).

Review the configuration of the Virtual Machine.

5) Review the items created so far

Click on the “Virtual Networks” icon (shown above).

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 5/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs
Click on the network we created previously, then click on the option to show the “Dashboard”.

Verify that the newly created virtual machine is using the 10.1.1.4 IP address on the subnet specified.

Click on the “Storage” icon (shown above).

Click on the Storage Account we created previously, then click on the option to show the “Containers”.

Click on the container called “vhds”.

Verify that you have the blobs for the virtual machine VHD file and its associated status.

Click on the “Cloud Services” icon (shown above).

Verify you have a cloud service associated with the newly created virtual machine, using the correct availability group.

Click on the “All Items” icon (shown above).

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 6/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Review all the items we created so far.

6) Connect to the Azure Virtual Machine

Click on the “Virtual Machines” icon (shown above).

On the bar at the bottom of the screen, click on the “Connect” icon to connect to your virtual machine.

You will be offered a link to a Remote Desktop session file. Click on the “Open” button to start the remote desktop session.

On the Remote Desktop Connection dialog (shown above), click “Connect”.

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 7/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

On the Window Security dialog, enter a dot (.), followed by a backslash (\) and the name of the user you specified when
creating the virtual machine. The dot means "this computer". Enter the password you specified previously and Click “OK” to
continue.

In the final “Remote Desktop Connection” dialog, click “Yes” to accept the certificate. You will be connected to the virtual
machine.

NOTE: To avoid this warning (and, more importantly, to be more secure), you can create certificates to use with these RDP
connections by checking this page: http://msdn.microsoft.com/en-us/library/windowsazure/gg432987.aspx .

7) Install Active Directory in the Azure VM

Inside the virtual machine, bring up a PowerShell command line and use the following two cmdlets to load the Active
Directory Domain Services role and promote this machine to a domain controller. This will take a while.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools


Install-ADDSForest -DomainName "JOSE.TEST"

You will be prompted for a Safe Mode Administrator password twice. You will also be asked to confirm the operation.
After this, the configuration will start. This will take a while and you will see a few warnings.

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 8/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

After the script finishes, the virtual machine will reboot and your Remote Desktop session will be disconnected.

8) Review DNS and Active Directory configuration

Reconnect to the Azure VM using the instructions on step 6, this time using the new domain name instead of the dot (.)
used in the first logon. You should use the same username, though. Note that the first logon on the freshly installed
domain controller will take a little longer than usual.

Use the DNS Manager tool to verify that the DNS was properly configured:

Use the Active Directory Users and Computers tool to verify that the domain was properly configured:

9) Configure the DNS for your Azure Virtual Network

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 9/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Click on the “Virtual Networks” icon (shown above).

Click on the network we created previously, then click on the option to “Configure”.

Add a DNS Server to the empty list, specifying the name and IP address of the virtual machine you configured (10.1.1.4).

Click on the “Save” button on the bottom bar (shown above) to save the changes.

Confirm the changes to the virtual network. Wait for the configuration to complete (this will take a moment).

10) Create two additional virtual machines

Click on the “Virtual Machines” icon (shown above).

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 10/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Use the “+ New” link on the bottom left of the screen to add two virtual machines that we’ll use as file server cluster nodes.

Use steps similar to what you did in item 4, being careful to use the same Image, Storage Account, Virtual Network and
Subnet as the first one. Use an FS1 and FS2 suffix for their names.

Here’s what the configuration should look like after you create them:

Make sure the VMs all use the same location.

Click on the “Virtual Networks” icon (shown above).

Click on the network we created previously, then click on the option to show the “Dashboard”.

Make sure the VMs all use the same subnet. Note the IP addresses used by each one.

11) Configure the two file server nodes

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 11/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs
Using steps similar to item 6, connect to each of the two new virtual machines. Note that, on the first boot, you must use
the computer name when logging in.

The steps are described here just once, but you must perform them for both VMs.

After the first login, verify that the DNS configuration received via DHCP is correct by running this cmdlet from PowerShell
inside the virtual machine:

Get-DnsClientServerAddress -InterfaceAlias Ethernet* | FL

Next, configure the roles and features to be used (File Server and Clustering) using these PowerShell cmdlets:

Install-WindowsFeature File-Services, FS-FileServer, Failover-Clustering –


IncludeManagementTools

Next, use the following cmdlet to join the domain:

Add-Computer -DomainName JOSE.TEST –Restart

Enter the domain credentials when prompted. The virtual machine will restart after that and you will be disconnected.

Reconnect to the Azure VM using the instructions on step 6, this time using the new domain name instead of the dot (.)
used in the first logon. You should use the same username, though.

Note that the first logon after you joined the domain will take a little longer than usual.

Don’t forget to repeat these steps on the other VM.

11) Confirm that the two file server nodes have joined the domain

Reconnect to the Azure VM running the DNS/domain controller using the instructions on step 8.

Use the DNS Manager tool to verify that the DNS is showing all three virtual machines:

Use the Active Directory Users and Computers tool to verify that the two file servers are now part of the domain:

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 12/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

12) Configure the iSCSI Target in the DNS/Domain Controller

Connect to the Azure VM running the DNS/domain controller using the instructions on step 8.

Enable the iSCSI Target Server and configure it using the following PowerShell cmdlets:

Install-WindowsFeature FS-iSCSITarget-Server
MD C:\LUN
New-IscsiServerTarget -TargetName FileCluster -InitiatorID IPAddress:10.1.1.5,
IPAddress:10.1.1.6
New-IscsiVirtualDisk -DevicePath C:\LUN\LUN0.VHDX -Size 1GB
1..2 | % {New-IscsiVirtualDisk -DevicePath C:\LUN\LUN$_.VHDX -Size 20GB}
0..2 | % {Add-iSCSIVirtualDiskTargetMapping -TargetName FileCluster -DevicePath
C:\LUN\LUN$_.VHDX}

Verify using Server Manager that the iSCSI Target Server was properly created and that the LUNs are properly associated
with it. See sample below:

13) Configure the iSCSI Initiator on the File Server virtual machine

Reconnect to the two File Server virtual machines.

Configure them to use the newly created iSCSI Target using the following PowerShell cmdlets:

Set-Service MSiSCSI -StartupType automatic


Start-Service MSiSCSI
New-iSCSITargetPortal -TargetPortalAddress 10.1.1.4
Get-iSCSITarget | Connect-iSCSITarget
Get-iSCSISession | Register-iSCSISession

IMPORTANT: The next step should be performed only on first of the File Server VM, not both.

On the first File Server VM, initialize the iSCSI LUNs (disks 2, 3 and 4) using the following PowerShell cmdlets:

2..4 | % {
$d = “--WXY”[$_]
Set-Disk -Number $_ -IsReadOnly 0

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 13/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs
Set-Disk -Number $_ -IsOffline 0
Initialize-Disk -Number $_ -PartitionStyle MBR
New-Partition -DiskNumber $_ -DriveLetter $d –UseMaximumSize
Start-Sleep –Seconds 10
Initialize-Volume -DriveLetter $d -FileSystem NTFS -Confirm:$false
}

Verify using the Disk Management tool that you see the

14) Run Cluster Validation and create the cluster

From one of the two File Server cluster nodes, run cluster validation using the following PowerShell cmdlet:

Test-Cluster JOSE-324-FS1, JOSE-324-FS2

Validation will take a while to complete. Here’s what you should expect as the output of that cmdlet:

Note that you have a warning. If you look into the report, you’ll see that it relates to the fact that you have a single network
for the cluster. Since this is a test configuration only, that’s fine.

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 14/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

Now go ahead and create the cluster using the following PowerShell cmdlet:

New-Cluster –Name JOSE-324-CL -Node JOSE-324-FS1, JOSE-324-FS2

15) Fixing the issue with the Cluster IP address

There is one issue you will see in this environment, which is the fact that the DHCP address assigned to the Cluster Name
resource is invalid.

The Azure Network will give you the same IP that is already in use by one of the existing nodes, creating an IP Address
conflict. I assume this issue is caused by the fact that this Cluster Name resource is not known to Azure.

You can confirm the issue using the Failover Cluster Manager tool to view the Cluster Core Resources:

If you dig deeper in the event log, you will find the message about the duplicate IP address:

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 15/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

There is a workaround, though. You need to:

Remove the existing DHCP-based Cluster IP Address Resource


Add a new Cluster IP Address Resource with a Static IP
Make sure all the dependencies are properly set with the new resource

You can do this via the GUI or you can run the following PowerShell script:

Stop-ClusterResource "Cluster Name"


Get-ClusterResource | ? { (($_.ResourceType -like "*Address*") -and
($_.OwnerGroup -eq "Cluster Group")) } | Remove-ClusterResource –Force
Add-ClusterResource -Name "Cluster IP Address" -Group "Cluster Group" -
ResourceType "IP Address"
Get-ClusterResource –Name "Cluster IP Address" | Set-ClusterParameter -Multiple
@{ “Network”=”Cluster Network 1”; "Address"="10.1.1.100";
”SubnetMask”=”255.255.255.0”; "EnableDhcp"=0 }
Get-ClusterResource “Cluster Name” | Add-ClusterResourceDependency –Resource
"Cluster IP Address"
Start-ClusterResource "Cluster Name"

After that, you will have the cluster fully functional.

16) Create the File Server Scale-Out Cluster

With the cluster created, you can go ahead and configure it for a Scale-Out File Server and create a few continuously
available file shares.

You can do it from either of the two File Server cluster nodes, using the following PowerShell cmdlets:

Get-ClusterResource | ? OwnerGroup -like Available* | Add-ClusterSharedVolume


Add-ClusterScaleOutFileServerRole -Name JOSE-324-FS

MD C:\ClusterStorage\Volume1\DATA1
New-SmbShare -Name Share1 -Path C:\ClusterStorage\Volume1\DATA1 -FullAccess
JOSE.TEST\Jose
Set-SmbPathAcl –ShareName Share1

MD C:\ClusterStorage\Volume2\DATA2
New-SmbShare -Name Share2 -Path C:\ClusterStorage\Volume2\DATA2 -FullAccess
JOSE.TEST\Jose
Set-SmbPathAcl –ShareName Share2

You can check the configuration using the Failover Cluster Manager:

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 16/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs

You can also use PowerShell to verify that configuration:

Get-ClusterResource | FT -AutoSize
Get-ClusterSharedVolume | FT -AutoSize
Get-SmbShare | FT -AutoSize

17) Final Notes

After you’re done with the demo/test/dev environment, don’t forget shutdown the VMs to save on your Azure
resources.
When bringing the VMs up again, make sure to start the DC VM first, so it gets the 10.1.1.4 IP address. The other
option would be to use a separate subnet just for the DC VM.
I hope you enjoyed these step-by-step instructions. I strongly encourage you to try them out and perform the entire
installation yourself. It’s a good learning experience.
Let me know how these steps worked for you using the comment section. If you run into any issues or found
anything particularly interesting, don’t forget to mention the number of the step.

Tweet 45 Share 40 Save this on Delicious

Comments
31 Mar 2014 7:34 PM
Eric

Can this be done with a DC on-prem using Azure S2S?

Jose Barreto - MSFT 1 Apr 2014 4:27 AM

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 17/18
4/16/2014 Deploying a Windows Server 2012 R2 Scale-Out File Server Cluster using Azure VMs - Jose Barreto's Blog - Site Home - TechNet Blogs
@Eric

Yes, if you have the site-to-site VPN configured.


See http://msdn.microsoft.com/library/azure/jj156210.aspx.

2 Apr 2014 1:00 AM


Alan

Hi Jose, everything worked a treat. Thanks a lot.


Al.

Thorsten _ 16 Apr 2014 11:55 AM


In Step 4 you create the 1. VM and assign the previously created virtual network. If I do exactly the same thing, I
do not have the chance to configure the network. There is no configuration entry, nothing. I also do not see where
this can be configured later.
The newly created VM does not get an IP from the desired scope.
What did I do wrong?

http://blogs.technet.com/b/josebda/archive/2014/03/29/deploying-a-windows-server-2012-r2-scale-out-file-server-cluster-using-azure-vms.aspx 18/18

Вам также может понравиться