-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vagrant: Improve VPC Performance For Windows Server 2022 (#3644)
* Vagrant: Add ability to use Adoptium box and only install relevant compilers per jdk * Vagrant: Include Vagrantfile For Adoptium Box * WinPB: Fix issue with MSVS2022_Adoptium installation * Vagrant: Update Disk Size For Adoptium Windows Box * WinPB: Fix Issue With Adoptium VS2022 Installation * Vagrant: Fix whtespace issues * Vagrant: Fix whitespace in script
- Loading branch information
1 parent
137a3f3
commit 4b3b5ae
Showing
3 changed files
with
114 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# Runs Powershell as an administator and does the following: | ||
# - Gets/executes an Ansible provided script that configures WinRM to allow Ansible to communicate over it. | ||
# - Resizes the disk to ~100GB, in line with the 'disksize.size = 100GB' option in the config below | ||
|
||
$script = <<SCRIPT | ||
Start-Process powershell -Verb runAs | ||
wget https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1 | ||
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999 | ||
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP | ||
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert | ||
.\\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck | ||
# Retrieving disk's current size | ||
$currentDiskSize =(Get-Partition -DriveLetter c | select Size) | ||
$currentDiskSize =($currentDiskSize -replace "[^0-9]" , "") | ||
# The size the disk should be, in bytes (130GB) | ||
$diskSizeBoundary = 139586437120 | ||
# Changing the disksize to max supported size (~130GB) | ||
if ([long]$currentDiskSize -lt $diskSizeBoundary) { | ||
echo "Resizing disk to max size" | ||
$size = (Get-PartitionSupportedSize -DriveLetter c); Resize-Partition -DriveLetter c -Size $size.SizeMax | ||
}else { | ||
echo "Disk is already at max size" | ||
} | ||
Start-Process cmd -Verb runAs | ||
winrm set winrm/config/service '@{AllowUnencrypted="true"}' | ||
SCRIPT | ||
|
||
# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x | ||
Vagrant.configure("2") do |config| | ||
|
||
config.vm.define :adoptopenjdkW2022 do |adoptopenjdkW2022| | ||
adoptopenjdkW2022.vm.box = "adoptium/windows2022" | ||
adoptopenjdkW2022.vm.hostname = "adoptopenjdkW2022" | ||
adoptopenjdkW2022.vm.communicator = "winrm" | ||
adoptopenjdkW2022.vm.synced_folder ".", "/vagrant" | ||
adoptopenjdkW2022.vm.network :private_network, type: "dhcp" | ||
adoptopenjdkW2022.vm.provision "shell", inline: $script, privileged: false | ||
adoptopenjdkW2022.disksize.size = '131GB' | ||
end | ||
config.vm.provider "virtualbox" do |v| | ||
v.gui = false | ||
v.memory = 8192 | ||
v.cpus = 2 | ||
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] | ||
end | ||
config.vm.boot_timeout = 600 | ||
end |