diff --git a/templates/2025_04/README.md b/templates/2025_04/README.md index 46ff3ab..53fee0e 100644 --- a/templates/2025_04/README.md +++ b/templates/2025_04/README.md @@ -21,3 +21,8 @@ az ssh arc --local-user azureuser --resource-group --name -- ``` ssh-keygen -t rsa -b 4096 -f vm_key ``` + +## CREATE A NEW GALLERY IMAGE ONLY +``` +az deployment group create -c -g -c --template-file gallery_only.jsonc --parameters gallery.parameters.jsonc +``` \ No newline at end of file diff --git a/templates/2025_04/gallery.parameters.jsonc b/templates/2025_04/gallery.parameters.jsonc new file mode 100644 index 0000000..56ebee4 --- /dev/null +++ b/templates/2025_04/gallery.parameters.jsonc @@ -0,0 +1,28 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "deployPrefix": { + "value": "TestVM" + }, + "hciApiVersion": { + "value": "2024-08-01-preview" + }, + "customLocationId": { + "value": "/subscriptions/abcd-1234-5678-efgh/resourceGroups/blabla-HostedResources-blabla/providers/Microsoft.ExtendedLocation/customLocations/dev10-blabla-cstm-loc" + }, + "location": { + "value": "eastus" + }, + "acrImagePath": { + "value": "acrreg.azurecr.io/ubuntu:22.04.00" + }, + "acrUsername": { + "value": "acrreg" + }, + "acrPassword": { + "value": "" + } + + } +} \ No newline at end of file diff --git a/templates/2025_04/gallery_only.jsonc b/templates/2025_04/gallery_only.jsonc new file mode 100644 index 0000000..7ae047b --- /dev/null +++ b/templates/2025_04/gallery_only.jsonc @@ -0,0 +1,54 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "deployPrefix": { + "type": "string" + }, + "hciApiVersion": { + "type": "string" + }, + "customLocationId": { + "type": "string" + }, + "location": { + "type": "string" + }, + "acrImagePath": { + "type": "string" + }, + "acrUsername": { + "type": "string" + }, + "acrPassword": { + "type": "securestring" + } + }, + "variables": { + "galleryImageName": "[concat(parameters('deployPrefix'), '-galleryimage')]" + }, + "resources": [ + { + "type": "Microsoft.AzureStackHCI/galleryImages", + "apiVersion": "[parameters('hciApiVersion')]", + "extendedLocation": { + "name": "[parameters('customLocationId')]", + "type": "CustomLocation" + }, + "location": "[parameters('location')]", + "tags": {}, + "name": "[variables('galleryImageName')]", + "properties": { + "osType": "Linux", + "hyperVGeneration": "", + "imagePath": "[parameters('acrImagePath')]", + "vmImageRepositoryCredentials": { + "username": "[parameters('acrUsername')]", + "password": "[parameters('acrPassword')]" + } + } + } + + ] +} +