To continue the build out of our Completely FREE Playground for SQL Server, we will begin by setting up an Active Directory Domain Controller and a separate iSCSI Virtual SAN, which are both requirements for setting up a SQL Server Failover Cluster. To make things easier to follow, this post will break these two tasks up into separate sections, with each section focused on the specifics of the setup involved with each of the servers.
Active Directory Domain Controller
To begin the setup of the Active Directory Domain Controller, the first step is to create a Clone of the “base” VM that was created in the previous blog post. To do this, right click on the VM and select the Clone option from the context menu.
To create the Clone, provide a common name to the VM and specify the option to “Reinitialize the MAC address of all network cards” on the first screen of the “Clone a virtual machine” wizard in VirtualBox.
When creating a clone of an existing VM, there are two options available; “Full Clone” which copies the existing virtual hard disk file entirely, and “Linked Clone” which creates a snapshot of the existing virtual machine and creates a differential virtual hard disk for the clone. If you are cloning a VM on a laptop, or on a system with limited space, a “Linked Clone” can save space by reusing the base VMs virtual hard disk for the Windows OS, rather than having duplicated copies of the base OS installation. However, when a “Linked Clone” is created, the base VM is required for the clone to be able to start up. If the base VM is moved or lost, all of the “Linked Clones” will become unusable instantaneously. This is the trade off between the two options; reduced storage vs. viability.
Once I create a “Linked Clone” for the Domain Controller, I open the Settings for the VM and remove Adapter 3 and 4 from the Network settings of the VM. The Active Directory Domain Controller will not have iSCSI targets configured on it, and does not need the iSCSI network adapters configured for it, so it is best to remove those adapters from the VM. It would also be possible to remove the previously configured Features from Windows Server 2008 R2 from the Active Directory VM if you chose to do so, those features being .NET Framework 3.5.1, Failover Clustering, and Multipath I/O, but it does not matter for this particular setup. The next step in setting up the Active Directory Domain Controller is to accept the License Terms and login/set a password for the local Administrator account. Since this is going to be a Domain Controller, we will need to setup a static IP Address for the Domain network adapter. To do this, click on the Configure networking link on the Initial Configuration Tasks window that pops up immediately after you login to Windows the first time. Then open the properties dialog for the connection that is not using NAT and setup on the Domain Internal Network. To determine which network connection is the Domain network in the VM, you can open the VM settings (Machine>Settings) and simulate unplugging the network cable from the vNIC by toggling the Cable connected checkbox.
For this playground setup, I am going to use 192.168.81.x for the Domain network, and 192.168.31.x for the iSCSI network. In IPv4 TCP/IP Properties, set the IP Address to 192.168.81.1, the Subnet mask to 255.255.255.0, and the Preferred DNS server to 127.0.0.1.
Now the VM needs to be renamed so that it has the appropriate naming convention to match your locally setup environment. For the purposes of this blog series, the AD DC will be named SQLskills-DC in the environment. Once the servers name is changed the VM will require a reboot.
Once the reboot for the rename operation completes, the VM is ready to be configured as an Active Directory Domain Controller. For the purposes of having a playground environment, a very basic configuration of Active Directory can be done, to minimize the steps required and keep things simple. The following steps will provide you with a fully function Active Directory Domain Controller in your playground, but there is no consideration for high availability of the Domain Controller, backups, best practices for configuration, or anything else that would qualify you to be an Active Directory Domain Administrator beyond the confines of the playground environment that is being built. To begin the configuration, the Active Directory Domain Services role will need to be added to the server.
After the ADDS role has been installed, run dcpromo to begin the configuration of the AD Domain on this server.
Click Next and then Next again to get to the Deployment Configuration screen. Choose the option to create a new domain in a new forest and click Next.
Provide a Fully Qualified Domain Name (FQDN) for the new domain and then click Next. You don’t have to provide an actual domain for the FQDN. In this series I am using SQLskills.Demos as the FQDN for the domain.
The Domain Functional Level and Forest Functional Level defaults of Windows Server 2003 can be used within the sandbox environment. Click Next on both of these screens. After the DNS Configuration check completes, the wizard will recommend additional options for the Domain Controller, including the option to configure it as a DNS server.
Leave the boxes checked on the screen and click Next. If you’ve followed this guide up to this point, there should be a Static IP Assignment warning that pops up due to the dynamically assigned IP address for the NAT connection. Click Yes on this box to continue, and then click Yes on the pop up that tells you the delegation could not be created for the parent zone in DNS.
For the playground environment, there is no need to change the database and log file locations for AD. Click Next on this Wizard window, provide a password for the Directory Services Restore Mode Administrator account and click Next again.
At this point everything is set to complete the configuration of Active Directory and the information is displayed in a final summary screen. Clicking Next will begin the configuration of the Active Directory Domain on the server.
Once the server reboots, it will be a fully functional Domain Controller for your playground environment.
iSCSI Virtual SAN
To facilitate building failover cluster configurations in our playground we are going to need a virtual SAN to provide the shared storage between the failover cluster nodes. One of the requirements for the virtual SAN is that it must support SCSI-3 Persistent Reservations, which are required for failover clustering using Windows Server 2008/2008R2. There are a number of free virtual SAN products available online, but for the purposes of this setup I chose to use the Microsoft Windows Server 2008 R2 iSCSI Target 3.3 which is available as a free download. This iSCSI target meets all of the requirements for failover clustering support, and can be configured in a few minutes.
The steps to clone the template VM for the iSCSI Virtual SAN are exactly the same as they were for creating the Domain Controller, with the exception that all of the vNICs will be left configured for the VM. Once Windows starts up, the first step is to configure the networking for the Domain network so that the VM can be joined into the playground domain. To do this, first identify the Domain network connection in Windows by disconnecting the cable in the vNIC settings as previously shown. Then change the IPv4 TCP/IP properties for the connection and set the IP address to 192.168.81.2, the subnet mask to 255.255.255.0 and then the Preferred DNS server to 192.168.81.1 (the IP address of the Domain Controller).
Once this has been done, the server name can be changed and the server can be joined to the domain at the same time. Once the domain information has been set, the server will attempt to connect to the domain and will request credentials for an account with permissions to join the server to the domain.
After the server joins the domain, it will require a reboot to complete. When the server restarts, you have to use the Switch User option to change the user that you login with from being the local Administrator account to login with a domain based account.
Note: At this point I would recommend creating a separate user account in the Domain that you use to work on the servers in the playground. It is never a good practice to use the domain administrator account to work with SQL Server.
Once you’ve logged into the server using a domain account, download the Microsoft iSCSI Software Target 3.3 for Windows Server 2008 R2 and extract the contents to a location on the server.
Installing the iSCSI Target onto the server is a very straightforward process that is basically a series of check boxes for options like accepting the licensing agreement, whether to join the Customer Experience Improvement Program, and whether to use Microsoft Update or not.
Once the installation completes, an entry for the iSCSI Target will be added to the Start Menu and the target MMC can be opened up to begin configuring the iSCSI Targets for the environment.
The next post in this series will go through the configuration options for the iSCSI Target and how to create a new LUN to support configuration of a SQL Server Failover Cluster inside of the playground environment.