Wednesday, 14 June 2017

Azure Stack TP3 POC - My experience

I always wanted to play with Azure Stack but never had the compute power to do so. Recently I bought a new desktop/server and thought I would be fine to run a POC but I was mistaken. So I had to dig the web for some workarounds and eventually (after a few rebuilds) I was able to make it work. I was excited to have it working and playing in my own Azure portal on premises but unfortunately I was not able to create any VMs as I did not have any more resources available.. Anyway.. It was good for the experience and the challenge of getting it working.

From this point I will describe what I have done to make it work.

My POC computer setup was:
  • 1x CPU socket with 6 cores
  • 64Gb of RAM
  • 1x 1TB SSD for the OS
  • 3x 1TB Data disks
Steps:

      1. First thing download and extract the Cloudbuilder.vhdx from here.
      2. Make sure you have .NET Framework 4.6 or later installed
      3. Copy the Cloudbuilder.vhdx to the root of the C:
      4. Mount the VHDX file
      5. Browse to DRIVELETTER:\CloudDeployment\NuGetStore
      6. Copy Microsoft.AzureStack.Solution.Deploy.CloudDeployment.1.0.422.0.nupkg to a temp       location and rename it as Microsoft.AzureStack.Solution.Deploy.CloudDeployment.1.0.422.0.nupkg.zip
      7. Extract the files in the same location.
      8. Browse to \content\Configuration\Roles\Fabric\VirtualMachines and open the file OneNoteRole.xml using notepad
What worked for me was the following configuration changes. Locate each VM name and adjust the values.

MAS-DC01, StartUpMemoryBytes="2147483648", ProcessorCount="2", DynamicMemory="False"
MAS-NC01, StartUpMemoryBytes="2147483648", ProcessorCount="2", DynamicMemory="False"
MAS-SLB01, StartUpMemoryBytes="2147483648", ProcessorCount="2", DynamicMemory="False"
MAS-GWY01, StartUpMemoryBytes="4294967296", ProcessorCount="2", DynamicMemory="False"
MAS-CON01, StartUpMemoryBytes="2147483648", ProcessorCount="2", DynamicMemory="False"
MAS-SQL01, StartUpMemoryBytes="4294967296", ProcessorCount="2", DynamicMemory="False"
MAS-WAS01, StartUpMemoryBytes="5368709120", ProcessorCount="4", DynamicMemory="False"
MAS-WASP01, StartUpMemoryBytes="5368709120", ProcessorCount="4", DynamicMemory="False"
MAS-ACS01, StartUpMemoryBytes="5368709120", ProcessorCount="4", DynamicMemory="False"
MAS-XRP01, StartUpMemoryBytes="5368709120", ProcessorCount="4", DynamicMemory="False"
MAS-ERCS01, StartUpMemoryBytes="5368709120", ProcessorCount="4", DynamicMemory="False"
MAS-ADFS01, StartUpMemoryBytes="2147483648", ProcessorCount="2", DynamicMemory="False"
MAS-CA01, StartUpMemoryBytes="4294967296", ProcessorCount="2", DynamicMemory="False"
MAS-BGPNAT01, StartUpMemoryBytes="4294967296", ProcessorCount="2", DynamicMemory="False"


      9. Now browse to \content\Configuration\Roles\Infrastructure\BareMetal and open the file OneNoteRole.xml using notepad


Change the following values to match your requirements.

    <ValidationRequirements>
      <MinimumOperatingSystemVersion>10.0.14300</MinimumOperatingSystemVersion>
      <MinimumNumberOfCoresPerMachine>4</MinimumNumberOfCoresPerMachine>
      <MinimumPhysicalMemoryPerMachineGB>32</MinimumPhysicalMemoryPerMachineGB>
      <MinimumNumberOfAdaptersPerMachine>0</MinimumNumberOfAdaptersPerMachine>
      <MinimumAdapterSpeedBitsPerSecond>0</MinimumAdapterSpeedBitsPerSecond>
      <MinimumSizeOfDataDisksGB>50</MinimumSizeOfDataDisksGB>
      <MinimumSizeOfSystemDiskGB>50</MinimumSizeOfSystemDiskGB>
      <MinimumNumberOfDataDisksPerMachine>2</MinimumNumberOfDataDisksPerMachine>
      <MaximumNumberOfMissingDisksPerMachine>0</MaximumNumberOfMissingDisksPerMachine>
      <SizeComparisonTolerancePercentage>1</SizeComparisonTolerancePercentage>
    </ValidationRequirements>

      10. Copy both OneNoteRole.xml files to the ZIP file replacing the originals
      11. Rename the file back to Microsoft.AzureStack.Solution.Deploy.CloudDeployment.1.0.422.0.nupkg and copy it back to the original location replacing the original file
      12. Unmount the VHD
      13. On the POC host, run the following PowerShell script to download the Azure Stack support files.

$Uri = 'https://raw.githubusercontent.com/Azure/AzureStack-Tools/master/Deployment/'
$LocalPath = 'c:\AzureStack_SupportFiles'
New-Item $LocalPath -type directory
( 'BootMenuNoKVM.ps1', 'PrepareBootFromVHD.ps1', 'Unattend.xml', 'unattend_NoKVM.xml') | `
foreach { Invoke-WebRequest ($uri + $_) -OutFile ($LocalPath + '\' + $_) } 

The support files will be downloaded to C:\AzureStack_SupportFiles

      14. Now open an elevated PowerShell, browse to C:\AzureStack_SupportFiles and run the following:

.\PrepareBootFromVHD.ps1 -CloudBuilderDiskPath C:\CloudBuilder.vhdx -ApplyUnattend

      15. Provide the Administrator password for the new AzureStack OS (inside the CloudBuilder.vhdx) so you can log in once the computer is rebooted
      16. When prompted say Yes which will restart the computer. Now the POC computer will boot into the OS of the CloudBuilder.vhdx
      17. Log in as Administrator using the password provided earlier
      18. Open the network connections and disable ipv6. Also make sure you only have 1 NIC enabled if you have multiple
      19. Rename the computer to a more descriptive name
      20. A lot of drivers will probably be missing if you look at device manager but they should be all available in the old OS which should be accessible through one of the volumes. To install all the drivers in one go, create the following batch file

forfiles /p %1 /s /m *.inf /c "cmd /c pnputil -a @Path"

      21. Now run it from an elevated command prompt. For example if you created the file InstallDrivers.cmd run the following (Make sure you point the drive letter to the correct volume which should be the old OS volume):

InstallDrivers.cmd E:\Windows\System32\DriverStore\FileRepository

      22. Make sure you drives are not partitioned otherwise they won't be considered as available



      23. Now it is time to start the installation. I have chosen to use Azure AD for authentication but  ADFS can also be used. To start the installation run the following from an elevated command prompt

cd C:\CloudDeployment\Setup 
$adminpass = ConvertTo-SecureString "〈LOCAL_ADMIN_PASSWORD〉" -AsPlainText -Force
$aadpass = ConvertTo-SecureString "<AAD GLOBAL ADMIN ACCOUNT PASSWORD>" -AsPlainText -Force
$aadcred = New-Object System.Management.Automation.PSCredential ("<AAD GLOBAL ADMIN ACCOUNT>", $aadpass)
.\InstallAzureStackPOC.ps1 -AdminPassword adminpass


Now this will take hours. In the first hour it will reboot and that is the only time it will reboot. Once it reboots you can log in as AzureStackAdmin.

If there are any issues first thing to try it to re-run it as displayed below:

.\InstallAzureStackPOC.ps1 -Rerun

I had a few issues with ADFS where I had to restart the server. I also had issues with a watchdog monitoring service. I had to start the service on both the host and the server where the issue was happening,

If for any reason I have rebooted the POC server, restart the VMs in the following order:


  • MAS-DC01, MAS-BGPNAT-1, MAS-SLB01, MAS-SQL01
  • Wait 5 minutes
  • MAS-ACS01, MAS-XRP01
  • Wait 5 minutes
  • MAS-WAS01, MAS-WASP01
  • Wait 5 minutes
  • MAS-CON01, MAS-CA01, MAS-ADFS01, MAS-GWY01
  • Wait 5 minutes
  • MAS-NC01, MAS-ERCS01 


Once the build is complete you should see the following:


You can also see all the VMs running from the Hyper-V or Failover clustet console.




Now it is time to active the portals.

From the POC host navigate to https://adminportal.local.azurestack.external/guest/signup and accept. Now navigate to https://portal.local.azurestack.external/guest/signup and accept again.





Now change the password expiration to 180 days running the following cmdlet.

Set-ADDefaultDomainPasswordPolicy -MaxPasswordAge 180.00:00:00 -Identity azurestack.local


And last if you want to import an image so you can create a VM run the following:

Import-Module .\Connect\AzureStack.Connect.psm1
Import-Module .\ComputeAdmin\AzureStack.ComputeAdmin.psm1

Add-AzureStackAzureRmEnvironment `
  -Name "AzureStackAdmin" `
  -ArmEndpoint "https://adminmanagement.local.azurestack.external"

$TenantID = Get-DirectoryTenantID `
  -AADTenantName "<myDirectoryTenantName>.onmicrosoft.com" ` #CHANGE WITH YOUR TENANT NAME
  -EnvironmentName AzureStackAdmin

$ISOPath = "<Fully_Qualified_Path_to_ISO>" #PATH TO ISO

$UserName='<Username of the service administrator account>' #AZURE ADMIN
$Password='<Admin password provided when deploying Azure Stack>'| ` #PASSWORD
  ConvertTo-SecureString -Force -AsPlainText
$Credential=New-Object PSCredential($UserName,$Password)

# Add a Windows Server 2016 Evaluation VM Image.
New-Server2016VMImage `
  -ISOPath $ISOPath `
  -TenantId $TenantID `
  -EnvironmentName "AzureStackAdmin" `
  -Net35 $True `
  -AzureStackCredentials $Credential


That's all.. what a lengthy post!! 

No comments:

Post a Comment