From 49f19dcdd05588e1e2a3f417c74aaa6e8c5b96df Mon Sep 17 00:00:00 2001 From: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com> Date: Thu, 16 Dec 2021 11:08:09 -0800 Subject: [PATCH] save (#17091) Co-authored-by: Theodore Chang --- .../stable/2021-11-01/compute.json | 7 + .../CreateAVmFromACommunityGalleryImage.json | 145 ++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json index b313512a8c4c..087f6dd567a6 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/compute.json @@ -3456,6 +3456,9 @@ "Create a VM from a shared gallery image": { "$ref": "./examples/compute/CreateAVmFromASharedGalleryImage.json" }, + "Create a VM from a community gallery image": { + "$ref": "./examples/compute/CreateAVmFromACommunityGalleryImage.json" + }, "Create a VM with securityType ConfidentialVM with Platform Managed Keys": { "$ref": "./examples/compute/CreateAVmWithSecurityTypeConfidentialVM.json" }, @@ -11424,6 +11427,10 @@ "sharedGalleryImageId": { "type": "string", "description": "Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call." + }, + "communityGalleryImageId": { + "type": "string", + "description": "Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call." } }, "allOf": [ diff --git a/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json new file mode 100644 index 000000000000..89269a2ac716 --- /dev/null +++ b/specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json @@ -0,0 +1,145 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "myResourceGroup", + "vmName": "myVM", + "api-version": "2021-11-01", + "parameters": { + "location": "westus", + "properties": { + "hardwareProfile": { + "vmSize": "Standard_D1_v2" + }, + "storageProfile": { + "imageReference": { + "communityGalleryImageId": "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName" + }, + "osDisk": { + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Standard_LRS" + }, + "name": "myVMosdisk", + "createOption": "FromImage" + } + }, + "osProfile": { + "adminUsername": "{your-username}", + "computerName": "myVM", + "adminPassword": "{your-password}" + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + "properties": { + "primary": true + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + "type": "Microsoft.Compute/virtualMachines", + "properties": { + "osProfile": { + "adminUsername": "{your-username}", + "secrets": [], + "computerName": "myVM", + "linuxConfiguration": { + "disablePasswordAuthentication": false + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", + "properties": { + "primary": true + } + } + ] + }, + "storageProfile": { + "imageReference": { + "communityGalleryImageId": "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName" + }, + "osDisk": { + "name": "myVMosdisk", + "diskSizeGB": 30, + "managedDisk": { + "storageAccountType": "Standard_LRS" + }, + "caching": "ReadWrite", + "createOption": "FromImage", + "osType": "Linux" + }, + "dataDisks": [] + }, + "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865", + "hardwareProfile": { + "vmSize": "Standard_D1_v2" + }, + "provisioningState": "Creating" + }, + "name": "myVM", + "location": "westus" + } + }, + "201": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + "type": "Microsoft.Compute/virtualMachines", + "properties": { + "osProfile": { + "adminUsername": "{your-username}", + "secrets": [], + "computerName": "myVM", + "linuxConfiguration": { + "disablePasswordAuthentication": false + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", + "properties": { + "primary": true + } + } + ] + }, + "storageProfile": { + "imageReference": { + "communityGalleryImageId": "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName" + }, + "osDisk": { + "name": "myVMosdisk", + "diskSizeGB": 30, + "managedDisk": { + "storageAccountType": "Standard_LRS" + }, + "caching": "ReadWrite", + "createOption": "FromImage", + "osType": "Linux" + }, + "dataDisks": [] + }, + "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865", + "hardwareProfile": { + "vmSize": "Standard_D1_v2" + }, + "provisioningState": "Creating" + }, + "name": "myVM", + "location": "westus" + } + } + } + } + \ No newline at end of file