File tree 5 files changed +37
-3
lines changed
5 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ variables:
28
28
# Uncomment and set values below, or leave commented and thru pipeline variables
29
29
# azhpc.variables.location: westeurope
30
30
# azhpc.variables.image_name: foo
31
+ azhpc.variables_matrix : examples/image/test_matrix.json
31
32
32
33
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
33
34
Original file line number Diff line number Diff line change
1
+ {
2
+ "Gen1" :
3
+ {
4
+ "azhpc.variables.hpc_image" : " OpenLogic:CentOS-HPC:7.7:latest"
5
+ },
6
+ "Gen2" :
7
+ {
8
+ "azhpc.variables.image" : " OpenLogic:CentOS-HPC:7_7-gen2:latest"
9
+ }
10
+ }
Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ variables:
29
29
30
30
# Add the variables needed in your configuration file
31
31
# Uncomment and set values below, or leave commented and thru pipeline variables
32
- # azhpc.variables.location: eastus
32
+ azhpc.variables.location : southcentralus
33
33
# azhpc.variables.vm_type: Standard_NC12s_v3
34
-
34
+ azhpc.variables_matrix : examples/nvidia/test_matrix.json
35
35
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
36
36
37
37
jobs :
Original file line number Diff line number Diff line change
1
+ {
2
+ "Gen1" :
3
+ {
4
+ "azhpc.variables.vm_type" : " Standard_NV12s_v3" ,
5
+ "azhpc.variables.image" : " OpenLogic:CentOS:7.7:latest"
6
+ },
7
+ "Gen2" :
8
+ {
9
+ "azhpc.variables.vm_type" : " Standard_ND40rs_v2" ,
10
+ "azhpc.variables.image" : " OpenLogic:CentOS:7_7-gen2:latest"
11
+ }
12
+ }
Original file line number Diff line number Diff line change 3
3
vm_name=$2
4
4
image_name=$3
5
5
image_rg=$4
6
- hyperv=${5-v1}
6
+ # hyperv=${5-v1}
7
7
8
8
# Create the Image
9
9
echo " Deallocate $vm_name "
10
10
az vm deallocate -g $rg -n $vm_name
11
11
echo " Generalize $vm_name "
12
12
az vm generalize -g $rg -n $vm_name
13
+
14
+ # Retrieve the hyperv generation of the image used to create the VM as it needs to be specified when capturing the VM
15
+ imgref=$( az vm show --name $vm_name -g $rg --query " storageProfile.imageReference" )
16
+ echo $imgref
17
+ offer=$( echo $imgref | jq -r ' .offer' )
18
+ publisher=$( echo $imgref | jq -r ' .publisher' )
19
+ sku=$( echo $imgref | jq -r ' .sku' )
20
+ version=$( echo $imgref | jq -r ' .version' )
21
+ hyperv=$( az vm image show --urn $publisher :$offer :$sku :$version --query " hyperVgeneration" -o tsv)
22
+ echo " hyper-v generation is $hyperv "
23
+
13
24
echo " Create Image $image_name from VM $vm_name "
14
25
if [ " $rg " == " $image_rg " ]; then
15
26
az image create -g $rg -n $image_name --source $vm_name --hyper-v-generation $hyperv --output table
You can’t perform that action at this time.
0 commit comments