Disclaimer
The following article details a configuration which is not officially supported by Microsoft for Production Environments at this time. You can read the official documentation about supported workloads at the following link: Microsoft server software support for Windows Azure Virtual Machines.
Introduction
Following my previous article, Installing an Exchange 2010 Test Environment on Windows Azure, it’s now time to move on to Exchange Server 2013. I strongly recommend the reading of the previous mentioned article before proceeding with this one, since there are similar configuration steps that I won’t describe so tx`horoughly in this article.
The main difference between these 2 articles, besides the Exchange version, is that now the base OS will be Windows Server 2012, instead of Windows Server 2008 R2.
To use the Infrastructure as a Service (IaaS) features of Windows Azure, Virtual Machines, I once again signed up for a Windows Azure 90-day free trial. With that, and without any costs besides an internet connection, you can immediately replicate the environment we are about to install.
If you are new to Windows Azure and/or Cloud technologies, I strongly advise you to watch some of the videos available at the Windows Azure site, and to download the latest Windows Azure Training Kit.
Solution Topology
For the purpose of writing this article, I installed the following environment on Windows Azure:
Figure 1: Solution topology
The following table details the server characteristics, in terms of software and hardware:
Server Name | VM Size | Role | Software |
AZ-DC-2K12 | Small
(1 core, 1.75GB) |
Domain Controller
DNS Server |
Windows Server 2012 |
AZ-EX-2K13 | Medium
(2 cores, 3.5GB) |
Mailbox role
Client Access role |
Windows Server 2012
Exchange Server 2013 |
Table 1: List of servers
Deployment Process
Provisioning the Exchange Server 2013 test environment on Windows Azure can be accomplished with these 5 configuration steps:
- Configure the virtual networking settings (optional)
- Create a storage account
- Provision a virtual machine from the Windows Azure Gallery and configure it as a Domain Controller
- Provision the Exchange Server virtual machine using PowerShell
- Install Exchange Server 2013
1. Configure Virtual Network
After signing up for the Windows Azure 90 day free trial, it’s time to start configuring the environment. Creating dedicated subnets is an optional step, but, from my point of view, it’s good practice.
We will also be configuring Affinity Groups, a way to guarantee that Windows Azure services are placed together and close to each other, within acceptable latency times.
- Open a browser and navigate to the Windows Azure Management Portal (http://management.windowsazure.com) and sign in using a Microsoft Account. To create an affinity group, open the NETWORKS area of the Management Portal, click AFFINITY GROUPS, and then click either ADD AN AFFINITY GROUP or CREATE (Figure 2).
- At the Specify Affinity Group Details screen, enter a NAME and select the REGION where you want to deploy your test environment (Figure 3).
- Wait for the operation to complete by checking the green bars animated icon at the lower right corner of the portal (Figure 4).
Figure 2: Windows Azure Affinity Groups
Figure 3: Create Affinity Group
Figure 4: Windows Azure operations completed
- Now let’s move to the subneting part. In the lower left-hand corner of the screen, click NEW. In the navigation pane, click NETWORKS, click VIRTUAL NETWORKS, and then click CUSTOM CREATE (Figure 5).
- On the Virtual Network Details screen (Figure 6), enter the NAME and select an AFFINITY GROUP from the drop-down list. Click the next arrow.
Figure 5: New Virtual Network
Figure 6: Virtual Network Details
- On the Address Space and Subnets screen (Figure 7), start by entering the desired ADDRESS SPACE (must be a private address range, 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, as specified by RFC 1918). Define new subnets, by entering a name, a valid subnet and clicking the add subnet button.
- On the DNS Servers and Local Network screen (Figure 8), on the lower right-hand of the screen, click the check button. If you want to use a public DNS service, you can enter that information on this screen. For more information, see Windows Azure Name Resolution Overview.
Figure 7: Address Space and Subnets
Figure 8: DNS Servers and Local Network
2. Create the Storage Account
The next step is to create a storage account so that we can instantiate and store the necessary VHD files of our virtual machines.
We’ll use Locally Redundant Storage instead of Geo-Redundant Storage in order to get a little bit more performance:
- Bandwidth for a Geo Redundant storage account
- Ingress – up to 5 gigabits per second
- Egress – up to 10 gigabits per second
- Bandwidth for a Locally Redundant storage account
- Ingress – up to 10 gigabits per second
- Egress – up to 15 gigabits per second
For more information, please read:
- Windows Azure’s Flat Network Storage and 2012 Scalability Targets
- Data Series: Introducing Locally Redundant Storage for Windows Azure Storage
- On the Windows Azure Management Portal select STORAGE from the left pane (Figure 9).
- Click NEW and then QUICK CREATE. Enter a name in the URL box, select the affinity group previously created at the REGION/AFFINITY GROUP box and then make sure the Enable Geo-Replication box is not selected (Figure 10).
Figure 9: Windows Azure Storage
Figure 10: Creating a storage account
3. Install and Configure the Domain Controller
Follow these simple steps to create a custom virtual machine running Windows Server 2012 using the Windows Azure Management Portal:
- At the Windows Azure Management Portal, on the command bar, click NEW, click VIRTUAL MACHINE, and then click FROM GALLERY (Figure 11).
- The VM OS Selection dialog box appears (Figure 12). We’ll select the latest Windows Server 2012 image available and then click the arrow to continue.
Figure 11: Create virtual machine from gallery
Figure 12: Virtual machine operating system selection
- At the VM Configuration dialog (Figure 13), type the VIRTUAL MACHINE NAME you want to use, type a (complex) PASSWORD for the Administrator account and select the SIZE of the virtual machine. For our Domain Controller, Small is just fine. Click the arrow to continue.
- At VM Mode dialog box (Figure 14), select STANDALONE VIRTUAL MACHINE. In DNS NAME type a name for the cloud service that is created for the virtual machine. Select the STORAGE ACCOUNT for the VHD file. In REGION/AFFINITY GROUP/VIRTUAL NETWORK, select e2k13-vnet previously created and select the DC-Subnet from the available VIRTUAL NETWORK SUBNETS. Click the arrow to continue.
- The VM Options dialog box (Figure 15) appears. We’ll create a new AVAILABILITY SET and define a new name for it. Click the check mark to create the virtual machine.
Figure 13: Virtual machine configuration
Figure 14: Virtual machine mode
Figure 15: Virtual machine options
- After Windows Azure creates the virtual machine, it is listed as Running in the Windows Azure Management Portal. Click the newly created virtual machine and notice the DNS name at the DASHBOARD (Figure 16). This will be the name used to connect by RDP to the server (Figure 17). Also notice the INTERNAL IP ADDRESS, as we’ll need to use it as the internal DNS server for the Exchange virtual machine.
- Connect to the machine and follow the regular steps to promote it to a Domain Controller (dcpromo). For more information, please read Install a new Active Directory forest in Windows Azure. All the virtual machines on Windows Azure must have a dynamically assigned IP by DHCP, so you’ll be presented a warning during the dcpromo process. Although the IP address on the Windows Azure Virtual Network is dynamic, its lease lasts for the duration of the VM. Setting a static IP address in the VM will cause communication failure.
Figure 16: Virtual machine dashboard
Figure 17: Remote Desktop Connection
4. Provision the Exchange Server Virtual Machine
To provision the virtual machine for the Exchange Server we’ll use a PowerShell script since it allows us more functionality than the portal (setting the DNS server and joining a domain, for example).
In order to run the PowerShell script, you must have Windows Azure PowerShell which can be installed from the Downloads for Managing Services in Windows Azure page. For detailed instruction, please read Windows Azure PowerShell.
To write the script we’ll need to know the name of the latest Windows Server 2012 image. That name can be obtained by running the PowerShell command:
Get-AzureVMImage | Select ImageName
Figure 18: Get-AzureVMImage | Select ImageName
The URL of the blob storage is also needed, and it can be obtained by clicking the storage account created (e2k13), and then clicking CONTAINERS (Figure 19).
Figure 19: Storage URL
This script will execute the following actions:
- Connect to our subscription
- Create a Medium virtual machine with Windows Server 2012 and connect it to the E2K13-Subnet
- Add 2 data disks to the virtual machine, one with 50GB for the DB, other with 10GB for the logs
- Open the necessary external endpoints: SMTP (25), HTTP (80) and HTTPS (443)
- Define the IP address of the domain controller (10.20.10.4) as the primary DNS
- Join the machine to the CONTOSO domain
# Create Exchange Server
CLS
# Your imported subscription name
$subscriptionName = "MSExchange.org"
$storageAccount = "e2k13"
Import-AzurePublishSettingsFile 'C:\Temp\e2k13-demo\MSExchange.org-credentials.publishsettings'
Select-AzureSubscription -SubscriptionName $subscriptionName
Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccount $storageAccount
# Cloud Service Paramaters
$e2k13ServiceName = "az-e2k13"
$e2k13ServiceLabel = "az-e2k13"
$e2k13ServiceDesc = "Cloud Service for Exchange Server 2013"
# Gallery Images
$e2k13image= ‘a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201212.01-en.us-30GB.vhd’
#Network Settings
$vnetname = 'e2k13-vnet'
$e2k13SubnetName = 'E2K13-Subnet'
$ag = 'e2k13-ag'
$primaryDNS = '10.20.10.4'
# Availability Sets
$avsete2k13 = 'e2k13-as'
# Domain Settings
$domain = 'contoso'
$joindom = 'contoso.com'
$domuser = 'administrator'
$dompwd = 'P@ssw0rd2012'
$advmou = 'OU=AzureVMs,DC=contoso,DC=com'
# MediaLocation
$mediaLocation = "http://e2k13.blob.core.windows.net/vhds/E2K13/"
# Create Exchange Server
$size = "Medium"
$vmStorageLocation = $mediaLocation + "AZ-EX-2K13.vhd"
$e2k13 = New-AzureVMConfig -Name 'AZ-EX-2K13' -AvailabilitySetName $avsete2k13 `
-ImageName $e2k13image -InstanceSize $size -MediaLocation $vmStorageLocation |
Add-AzureProvisioningConfig -WindowsDomain -Password $dompwd `
-Domain $domain -DomainUserName $domuser -DomainPassword $dompwd `
-MachineObjectOU $advmou -JoinDomain $joindom |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel 'ExDB' -LUN 0 |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 10 -DiskLabel 'ExLogs' -LUN 1 |
Add-AzureEndpoint -Name 'smtp' -LocalPort 25 -PublicPort 25 -Protocol tcp |
Add-AzureEndpoint -Name 'http' -LocalPort 80 -PublicPort 80 -Protocol tcp |
Add-AzureEndpoint -Name 'https' -LocalPort 443 -PublicPort 443 -Protocol tcp |
Set-AzureSubnet $e2k13SubnetName
$dns1 = New-AzureDns -Name 'E2K13-DNS' -IPAddress $primaryDNS
New-AzureVM -ServiceName $e2k13ServiceName -ServiceLabel $e2k13ServiceLabel `
-ServiceDescription $e2k13ServiceDesc `
-AffinityGroup $ag -VNetName $vnetname -DnsSettings $dns1 `
-VMs $e2k13
With the necessary management tools installed, we’ll use Windows PowerShell ISE to run the script:
- Paste the script into Windows PowerShell ISE and hit Run (F5). Wait for the virtual machine to be provisioned.
- After the completion of the provisioning process, at the Windows Azure Management Portal, click the newly created machine and select ENDPOINTS. Notice the endpoints were created (Figure 20) and take special attention to the remote desktop external port since most probably it won’t be 3389 (standard RDP port).
- Establish a remote desktop connection to the server and run Disk Management (Figure 21) in order to create volumes on the 2 data disks created during the provisioning process. After formatting the data disks, you can browse them in Windows Explorer. Please notice the Temporary Storage disk D: (Figure 22). This disk should not be used to store permanent data as it will be lost in case of a virtual machine refresh. Disk D: is used only for caching purposes and temporary data.
Figure 20: AZ-EX-2K13 Endpoints
Figure 21: Disk Management
Figure 22: Hard Disk Drives
5. Install Exchange Server 2013
Since there are no significant differences installing Exchange on Windows Azure when compared to installing it on any other virtualization environment, this article won’t cover the setup process in detail.
After downloading the Exchange 2013 ISO file and mounting it on the Windows Server 2012 machine, I just had to run Setup (Figure 23). All the Readiness Checks were completed and the only warning was that the AD Forest was going to be prepared for Exchange Server 2013 (Figure 24), as expected.
The complete setup process, for a typical Exchange Server 2013 installation (CAS and Mailbox), took only a few minutes and went very smoothly (Figure 25).
All the services came up without any glitch (Figure 26). We even have Outlook Web App available, since we opened the necessary endpoints, by accessing the URL https://az-e2k10.cloudapp.net/owa (Figure 27).
Figure 23: Launching Exchange Server 2013 Setup
Figure 24: Exchange Server 2013 Setup: Readiness Checks
Figure 25: Exchange Server 2013 Setup Completed
Figure 26: Microsoft Exchange services
Figure 27: Outlook Web App
Will a DAG Work?
The short answer is NO! Although I tried to set up a second Exchange server and configure a DAG, there are some technical requirements that are not supported by Windows Azure at this time. The main issue has to do with the additional IP address necessary for the Windows Failover Clustering components. Windows Azure virtual machines only support 1 virtual network card and the IP address must be assigned by DHCP… I knew that, but I had to try.
Figure 28: Failed attempt to configure a DAG
Conclusion
The agility, manageability and performance I experience when using Windows Azure Virtual Machines are the main benefits that convinced me to move my Exchange Server test environment to the cloud. Provisioning an Exchange Server 2013 infrastructure from the ground up in minutes with PowerShell is way too cool! And now my virtual servers are always available and accessible.
Testing a migration from Exchange Server 2010 to Exchange Server 2013 is one scenario you might be interested to try with Windows Azure, but please keep in mind that there are some differences and limitations from the on-premises world.
Let’s wait for the General availability of Windows Azure Virtual Machines and hope there will be some new features and, who knows, some supportability changes regarding Exchange Server.
Related Links
- Windows Azure Portal
- Microsoft server software support for Windows Azure Virtual Machines
- Data Series: Exploring Windows Azure Drives, Disks, and Images
- Windows Azure Training Kit – December 2012
- Guidelines for Deploying Windows Server Active Directory on Windows Azure Virtual Machines
- Windows Azure’s Flat Network Storage and 2012 Scalability Targets
- Data Series: Introducing Locally Redundant Storage for Windows Azure Storage