Building a Windows Server 2012 Cloud Infrastructure with PowerShell by Josh Adams
Today we have a real treat for you! In this blog post, Joshua Adams, who is a PM in the Microsoft EEC, shows you how to create a Windows Server 2012 based private cloud infrastructure using PowerShell scripts. We had the singular opportunity to work with Josh when we put together the collection of cloud infrastructure design patterns that you can find on TechNet. In this article, Josh shows you how to build out the infrastructure described in those articles. We had a great time working with Josh on that project and you’ll enjoy his PowerShell discussion here.
Make sure to comment and share this article
Complementing the existing efforts to provide guidance around building a Cloud Infrastructure with Windows Server 2012, two additional pieces of collateral have been uploaded to the TechNet Gallery that help automate and streamline the overall scenario, showcasing not only great new features, but also the flexibility and utility of PowerShell.
Finding myself constantly building Windows Server 2012 IaaS clouds for both end-to-end scenario validation and customer presentations, I developed a macro-enabled Word document to help make the process repeatable, streamlined and easy to disseminate. The guide outlines all the needed steps to build various IaaS configurations along with the complete set of corresponding PowerShell commands. And the embedded macros make copying and pasting the cmdlets a snap, useful for both demos and deployments. In all, over 70 different PowerShell cmdlets are employed and described, many leveraging new features only found in Windows Server 2012, covering areas such as:
- Networking (NIC Teaming, QoS, DCB, etc.)
- Failover Clustering
- Storage Spaces
- Disk Management (including MPIO)
- Server Management
- Active Directory
Below is an example section from a configuration leveraging shared SAS disks and Storage Spaces:
Cleaning Disks (some commands may be unnecessary depending on previous disk usage):
Download the guide now for a quick and concise reference for building IaaS clouds with Windows Server 2012!
When leveraging SMB shares for Hyper-V storage (enabling separate scaling of compute and storage resources), specific permissions are needed on both the file system and share levels. In addition, remote management of the solution along with and Kerberos-based Live Migration (affording higher security) both require the configuration of Kerberos Constrained delegation. And although these settings can all be setup manually, either through the UI or PowerShell, combining all the steps into a single set of PowerShell scripts ensures reliability, repeatability and efficiency.
The SetupSMBSharesWithHyperV.ps1 script provides the main entry point and progresses through the following workflow, calling helper scripts as needed:
1. Setup necessary Active Directory groups, allowing permissions to be granted to groups rather than individual user objects
2. Setup Kerberos Constrained Delegation for remote scenario management and increased Live Migration security (based on Taylor Brown’s blog post)
3. Setup the SMB file share, exposed through the given Scale-Out File Server (based on Jose Barreto’s blog post)
4. Restart all Hyper-V nodes
5. Modify Hyper-V settings to reflect above modifications
And the only required script parameters are the:
- Hyper-V Cluster Name (-HyperVClusterName)
- Scale-Out File Server Name (-ScaleOutFSName)
- SMB share Name (-ShareName)
- AD Hyper-V Group Name (-HyperVObjectADGroupSamName)
Please keep the following notes in mind when using the scripts:
- Although functionally unnecessary, breaking the configuration workflow into multiple scripts affords modularity, portability and readability
- The scripts should be executed as an Administrator on one of the storage nodes; however, they could easily be ported to run from a dedicated management server
- For additional information surrounding the targeted scenario (i.e. a Hyper-V Failover Cluster targeting a Scale-Out File Server hosted on a separate Storage Failover Cluster), please reference the following configuration guides:
Download the scripts now to help streamline your Windows Server 2012 cloud deployments!
SENIOR PROGRAM MANAGER, WSSC PACE PM USA
I hope you enjoyed Josh’s article and if you have ideas for other automation tips and tricks for Josh to share, let us know!