Skip to content

Instantly share code, notes, and snippets.

@Pyromaniaxxx
Created March 21, 2017 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pyromaniaxxx/1e287397d24d246ef694fac87e8c8748 to your computer and use it in GitHub Desktop.
Save Pyromaniaxxx/1e287397d24d246ef694fac87e8c8748 to your computer and use it in GitHub Desktop.
Azure Stack TP3 CPU/DISK Limit Cancel script
$i = 0
do
{
$MountVHDMessage = "Mounting Nested Azure Stack HOST VHDX"
if (Test-Path "c:\CloudDeployment\Configuration\Roles\Infrastructure\BareMetal\OneNodeRole.xml")
{
Write-Progress $MountVHDMessage -Status " updating C:\CloudDeployment\Configuration\Roles\Infrastructure\BareMetal\OneNodeRole.xml" -PercentComplete 40
$BareMetalRole = Get-Content "c:\CloudDeployment\Configuration\Roles\Infrastructure\BareMetal\OneNodeRole.xml"
$BareMetalRole = $BareMetalRole.Replace("<MinimumSizeOfSystemDiskGB>180</MinimumSizeOfSystemDiskGB>","<MinimumSizeOfSystemDiskGB>80</MinimumSizeOfSystemDiskGB>")
$BareMetalRole = $BareMetalRole.Replace("<MinimumNumberOfCoresPerMachine>12</MinimumNumberOfCoresPerMachine>","<MinimumNumberOfCoresPerMachine>0</MinimumNumberOfCoresPerMachine>")
([xml]$BareMetalRole).Save("c:\CloudDeployment\Configuration\Roles\Infrastructure\BareMetal\OneNodeRole.xml")
Write-Verbose -Message (" C:\CloudDeployment\Configuration\Roles\Infrastructure\BareMetal\OneNodeRole.xml updated")
$i = 1
}
if (Test-Path "c:\CloudDeployment\Roles\PhysicalMachines\Tests\BareMetal.Tests.ps1")
{
Write-Progress $MountVHDMessage -Status " updating C:\CloudDeployment\Roles\PhysicalMachines\Tests\BareMetal.Tests.ps1" -PercentComplete 60
$BareMetalTests = Get-Content "c:\CloudDeployment\Roles\PhysicalMachines\Tests\BareMetal.Tests.ps1"
$BareMetalTests = $BareMetalTests.Replace('$physicalMachine.IsVirtualMachine | Should Be $false','$false | Should Be $false')
$BareMetalTests = $BareMetalTests.Replace('($physicalMachine.Processors.NumberOfEnabledCores | Measure-Object -Sum).Sum | Should Not BeLessThan $minimumNumberOfCoresPerMachine','$minimumNumberOfCoresPerMachine | Should Not BeLessThan $minimumNumberOfCoresPerMachine')
$BareMetalTests | Out-File "c:\CloudDeployment\Roles\PhysicalMachines\Tests\BareMetal.Tests.ps1"
Write-Verbose -Message (" C:\CloudDeployment\Roles\PhysicalMachines\Tests\BareMetal.Tests.ps1 updated")
$i = 2
}
sleep -Seconds 1
"loop $i"
}
while (2 -ne $i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment