Skip to content

Commit b525166

Browse files
committed
Created a parameter for VM priority, so that we can set it to regular for our release builds (and avoid evictions).
1 parent 1d4c588 commit b525166

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CI/Azure-DevOps/AZ_MainPipeline.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ parameters: # TODO, these don't work for scheduled pipelines, not even the defau
2323
SQLVersionEdition: 2017
2424
- name: SQL2019
2525
SQLVersionEdition: 2019
26-
26+
- name: VMPriority
27+
displayName: VM Priority (Low, Regular, Spot)
28+
type: string
29+
default: Spot
2730

2831
variables:
2932
- name: ArtifactBranchName
@@ -141,6 +144,7 @@ stages:
141144
SQLPort="$SqlPort";
142145
SQLUserName="$SQLUserName";
143146
SQLPwd="$SQLPwd";
147+
VMPriority="$(VMPriority)";
144148
};
145149
$VMDetails = .'CI/Azure-DevOps/CreateSQLVM_azcli.ps1' @Parameters
146150

CI/Azure-DevOps/CreateSQLVM_azcli.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Param(
99
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $SQLVersionEdition,
1010
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $SQLPort,
1111
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $SQLUserName,
12-
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $SQLPwd
12+
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $SQLPwd,
13+
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $VMPriority
1314
);
1415

1516
$scriptpath = $MyInvocation.MyCommand.Path;
@@ -28,6 +29,7 @@ Log-Output "ResourceGroupName:", $ResourceGroupName;
2829
Log-Output "BuildId:", $BuildId;
2930
Log-Output "SQLVersionEdition:", $SQLVersionEdition;
3031
Log-Output "SQLPort:", $SQLPort;
32+
Log-Output "VMPriority:", $VMPriority;
3133
Log-Output "Parameters: ---------------------------";
3234
Log-Output "<-><-><-><-><-><-><-><-><-><-><-><-><-><->";
3335

@@ -128,7 +130,7 @@ Log-Output "DONE: Creating NIC $InterfaceName";
128130
Log-Output "Creating VM $VMName";
129131

130132
$output = az vm create --name "$VMName" --resource-group "$ResourceGroupName" --location "$Location" --admin-password "$VMAdminPwd" `
131-
--admin-username "$VMAdminName" --computer-name "$VMName" --image "$ImageUrn" --nics "$InterfaceName" --priority Spot `
133+
--admin-username "$VMAdminName" --computer-name "$VMName" --image "$ImageUrn" --nics "$InterfaceName" --priority "$VMPriority" `
132134
--size $Size --data-disk-sizes-gb 8 | ConvertFrom-Json;
133135
if (!$output) {
134136
Log-Output "VMName: ", $VMName;

0 commit comments

Comments
 (0)