Skip to content

Commit a47e0a1

Browse files
Merge pull request #108350 from cynthn/march-sig
SIG - updates for March
2 parents ec3cc7e + 7e365ee commit a47e0a1

File tree

54 files changed

+2661
-916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2661
-916
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@
250250
"redirect_url": "/azure//virtual-machines/windows/sql/virtual-machines-windows-portal-sql-create-failover-cluster-premium-file-share",
251251
"redirect_document_id": false
252252
},
253+
{
254+
"source_path": "articles/virtual-machines/windows/shared-images.md",
255+
"redirect_url": "/azure/virtual-machines/shared-images-powershell",
256+
"redirect_document_id": false
257+
},
258+
{
259+
"source_path": "articles/virtual-machines/linux/shared-images.md",
260+
"redirect_url": "/azure/virtual-machines/shared-images-cli",
261+
"redirect_document_id": false
262+
},
253263
{
254264
"source_path": "articles/virtual-machines/windows/encrypt-disks.md",
255265
"redirect_url": "/azure//virtual-machines/windows/disk-encryption-overview",

articles/virtual-machine-scale-sets/TOC.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
href: ../virtual-network/virtual-network-optimize-network-bandwidth.md?toc=%2fazure%2fvirtual-machine-scale-sets%2fwindows%2ftoc.json
8282
- name: Manage fault domains in scale sets
8383
href: virtual-machine-scale-sets-manage-fault-domains.md
84+
- name: Images
85+
href: shared-image-galleries.md
8486
- name: VM types and sizes
8587
href: ../virtual-machines/windows/sizes.md
8688
maintainContext: true
@@ -184,6 +186,52 @@
184186
href: virtual-machine-scale-sets-design-overview.md
185187
- name: Understand instance IDs
186188
href: virtual-machine-scale-sets-instance-ids.md
189+
190+
- name: Use Images
191+
displayName: SIG, AMI, image
192+
items:
193+
- name: Shared Image Galleries
194+
items:
195+
- name: PowerShell
196+
items:
197+
- name: Create a gallery
198+
href: ../virtual-machines/shared-images-powershell.md
199+
- name: Create an image
200+
items:
201+
- name: From a VM
202+
href: ../virtual-machines/image-version-vm-powershell.md
203+
- name: Migrate from a managed image
204+
href: ../virtual-machines/image-version-managed-image-powershell.md
205+
- name: Copy from another gallery
206+
href: ../virtual-machines/image-version-another-gallery-powershell.md
207+
- name: Create a scale-set
208+
items:
209+
- name: Specialized
210+
href: instance-specialized-image-version-powershell.md
211+
- name: Generalized
212+
href: instance-generalized-image-version-powershell.md
213+
- name: Update image resources
214+
href: ../virtual-machines/update-image-resources-powershell.md
215+
- name: CLI
216+
items:
217+
- name: Create a gallery
218+
href: ../virtual-machines/shared-images-cli.md
219+
- name: Create an image
220+
items:
221+
- name: From a VM
222+
href: ../virtual-machines/image-version-vm-cli.md
223+
- name: Migrate from a managed image
224+
href: ../virtual-machines/image-version-managed-image-cli.md
225+
- name: Copy from another gallery
226+
href: ../virtual-machines/image-version-another-gallery-cli.md
227+
- name: Create a scale-set
228+
items:
229+
- name: Specialized
230+
href: instance-specialized-image-version-cli.md
231+
- name: Generalized
232+
href: instance-generalized-image-version-cli.md
233+
- name: Update image resources
234+
href: ../virtual-machines/update-image-resources-cli.md
187235
- name: Create a template
188236
items:
189237
- name: Learn about scale set templates
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Create a scale set from a generalized image
3+
description: Create a scale set using a generalized image in a Shared Image Gallery.
4+
author: cynthn
5+
ms.service: virtual-machine-scale-sets
6+
ms.subservice: imaging
7+
ms.workload: infrastructure-services
8+
ms.topic: how-to
9+
ms.date: 05/01/2020
10+
ms.author: cynthn
11+
ms.reviewer: akjosh
12+
---
13+
14+
# Create a scale set from a generalized image
15+
16+
Create a scale set from a generalized image version stored in a [Shared Image Gallery](shared-image-galleries.md) using the Azure CLI. If want to create a scale set using a specialized image version, see [Create scale set instances from a specialized image](instance-specialized-image-version-cli.md).
17+
18+
If you choose to install and use the CLI locally, this tutorial requires that you are running the Azure CLI version 2.4.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI]( /cli/azure/install-azure-cli).
19+
20+
Replace resource names as needed in this example.
21+
22+
List the image definitions in a gallery using [az sig image-definition list](/cli/azure/sig/image-definition#az-sig-image-definition-list) to see the name and ID of the definitions.
23+
24+
```azurecli-interactive
25+
resourceGroup=myGalleryRG
26+
gallery=myGallery
27+
az sig image-definition list \
28+
--resource-group $resourceGroup \
29+
--gallery-name $gallery \
30+
--query "[].[name, id]" \
31+
--output tsv
32+
```
33+
34+
Create the scale set using [`az vmss create`](/cli/azure/vmss#az-vmss-create).
35+
36+
Use the image definition ID for `--image` to create the scale set instances from the latest version of the image that is available. You can also create the scale set instances from a specific version by supplying the image version ID for `--image`. Be aware that using a specific image version means automation could fail if that specific image version isn't available because it was deleted or removed from the region. We recommend using the image definition ID for creating your new VM, unless a specific image version is required.
37+
38+
In this example, we are creating instances from the latest version of the *myImageDefinition* image.
39+
40+
```azurecli
41+
az group create --name myResourceGroup --location eastus
42+
az vmss create \
43+
--resource-group myResourceGroup \
44+
--name myScaleSet \
45+
--image "/subscriptions/<Subscription ID>/resourceGroups/myGalleryRG/providers/Microsoft.Compute/galleries/myGallery/images/myImageDefinition"
46+
--admin-username azureuser \
47+
--generate-ssh-keys
48+
```
49+
50+
It takes a few minutes to create and configure all the scale set resources and VMs.
51+
52+
## Next steps
53+
[Azure Image Builder (preview)](../virtual-machines/linux/image-builder-overview.md) can help automate image version creation, you can even use it to update and [create a new image version from an existing image version](../virtual-machines/linux/image-builder-gallery-update-image-version.md).
54+
55+
You can also create Shared Image Gallery resource using templates. There are several Azure Quickstart Templates available:
56+
57+
- [Create a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-create/)
58+
- [Create an Image Definition in a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-image-definition-create/)
59+
- [Create an Image Version in a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-image-version-create/)
60+
61+
For more information about Shared Image Galleries, see the [Overview](shared-image-galleries.md). If you run into issues, see [Troubleshooting shared image galleries](troubleshooting-shared-images.md).
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
---
2+
title: Create a scale set from a generalized image
3+
description: Create a scale set using a generalized image in a Shared Image Gallery.
4+
author: cynthn
5+
ms.service: virtual-machine-scale-sets
6+
ms.subservice: imaging
7+
ms.workload: infrastructure-services
8+
ms.topic: how-to
9+
ms.date: 05/04/2020
10+
ms.author: cynthn
11+
ms.reviewer: akjosh
12+
---
13+
14+
# Create a scale set from a generalized image
15+
16+
Create a VM from a generalized image version stored in a [Shared Image Gallery](shared-image-galleries.md). If want to create a scale set using a specialized image, see [Create scale set instances from a specialized image](instance-specialized-image-version-powershell.md).
17+
18+
Once you have a generalized image, you can create a virtual machine scale set using the [New-AzVmss](/powershell/module/az.compute/new-azvmss) cmdlet.
19+
20+
In this example, we are using the image definition ID to ensure your new VM will use the most recent version of an image. You can also use a specific version by using the image version ID for `-ImageReferenceId`. For example, to use image version *1.0.0* type: `-ImageReferenceId "/subscriptions/<subscription ID where the gallery is located>/resourceGroups/myGalleryRG/providers/Microsoft.Compute/galleries/myGallery/images/myImageDefinition/versions/1.0.0"`.
21+
22+
Be aware that using a specific image version means automation could fail if that specific image version isn't available because it was deleted or removed from the region. We recommend using the image definition ID for creating your new VM, unless a specific image version is required.
23+
24+
25+
The following examples create a scale set named *myScaleSet*, in the *myVMSSRG* resource group, in the *SouthCentralUS* location. The scale set will be created from the *myImageDefinition* image, in the *myGallery* image gallery in the *myGalleryRG* resource group. When prompted, set your own administrative credentials for the VM instances in the scale set.
26+
27+
28+
## Simplified parameter set
29+
30+
To quickly create a scale set, while providing minimal information, use the simplified parameter set to create a scale set from a Share Image Gallery image.
31+
32+
```azurepowershell-interactive
33+
$imageDefinition = Get-AzGalleryImageDefinition `
34+
-GalleryName myGallery `
35+
-ResourceGroupName myGalleryRG `
36+
-Name myImageDefinition
37+
38+
# Create user object
39+
40+
$cred = Get-Credential `
41+
-Message "Enter a username and password for the virtual machine."
42+
43+
# Create the resource group and scale set
44+
New-AzResourceGroup -ResourceGroupName myVMSSRG -Location SouthCentralUS
45+
New-AzVmss `
46+
-Credential $cred `
47+
-VMScaleSetName myScaleSet `
48+
-ImageName $imageDefinition.Id `
49+
-UpgradePolicyMode Automatic `
50+
-ResourceGroupName myVMSSRG
51+
```
52+
53+
It takes a few minutes to create and configure all the scale set resources and VMs.
54+
55+
## Extended parameter set
56+
57+
For full control over all of the resources, including naming, use the full parameter set to create a scale set using a Shared Image Gallery image.
58+
59+
```azurepowershell-interactive
60+
# Get the image definition
61+
62+
$imageDefinition = Get-AzGalleryImageDefinition `
63+
-GalleryName myGallery `
64+
-ResourceGroupName myGalleryRG `
65+
-Name myImageDefinition
66+
67+
# Create user object
68+
69+
$cred = Get-Credential `
70+
-Message "Enter a username and password for the virtual machine."
71+
72+
# Define variables for the scale set
73+
$resourceGroupName = "myVMSSRG"
74+
$scaleSetName = "myScaleSet"
75+
$location = "South Central US"
76+
77+
# Create a resource group
78+
New-AzResourceGroup -ResourceGroupName $resourceGroupName -Location $location
79+
80+
# Create a networking pieces
81+
$subnet = New-AzVirtualNetworkSubnetConfig `
82+
-Name "mySubnet" `
83+
-AddressPrefix 10.0.0.0/24
84+
$vnet = New-AzVirtualNetwork `
85+
-ResourceGroupName $resourceGroupName `
86+
-Name "myVnet" `
87+
-Location $location `
88+
-AddressPrefix 10.0.0.0/16 `
89+
-Subnet $subnet
90+
$publicIP = New-AzPublicIpAddress `
91+
-ResourceGroupName $resourceGroupName `
92+
-Location $location `
93+
-AllocationMethod Static `
94+
-Name "myPublicIP"
95+
$frontendIP = New-AzLoadBalancerFrontendIpConfig `
96+
-Name "myFrontEndPool" `
97+
-PublicIpAddress $publicIP
98+
$backendPool = New-AzLoadBalancerBackendAddressPoolConfig -Name "myBackEndPool"
99+
$inboundNATPool = New-AzLoadBalancerInboundNatPoolConfig `
100+
-Name "myRDPRule" `
101+
-FrontendIpConfigurationId $frontendIP.Id `
102+
-Protocol TCP `
103+
-FrontendPortRangeStart 50001 `
104+
-FrontendPortRangeEnd 50010 `
105+
-BackendPort 3389
106+
# Create the load balancer and health probe
107+
$lb = New-AzLoadBalancer `
108+
-ResourceGroupName $resourceGroupName `
109+
-Name "myLoadBalancer" `
110+
-Location $location `
111+
-FrontendIpConfiguration $frontendIP `
112+
-BackendAddressPool $backendPool `
113+
-InboundNatPool $inboundNATPool
114+
Add-AzLoadBalancerProbeConfig -Name "myHealthProbe" `
115+
-LoadBalancer $lb `
116+
-Protocol TCP `
117+
-Port 80 `
118+
-IntervalInSeconds 15 `
119+
-ProbeCount 2
120+
Add-AzLoadBalancerRuleConfig `
121+
-Name "myLoadBalancerRule" `
122+
-LoadBalancer $lb `
123+
-FrontendIpConfiguration $lb.FrontendIpConfigurations[0] `
124+
-BackendAddressPool $lb.BackendAddressPools[0] `
125+
-Protocol TCP `
126+
-FrontendPort 80 `
127+
-BackendPort 80 `
128+
-Probe (Get-AzLoadBalancerProbeConfig -Name "myHealthProbe" -LoadBalancer $lb)
129+
Set-AzLoadBalancer -LoadBalancer $lb
130+
131+
# Create IP address configurations
132+
$ipConfig = New-AzVmssIpConfig `
133+
-Name "myIPConfig" `
134+
-LoadBalancerBackendAddressPoolsId $lb.BackendAddressPools[0].Id `
135+
-LoadBalancerInboundNatPoolsId $inboundNATPool.Id `
136+
-SubnetId $vnet.Subnets[0].Id
137+
138+
# Create a configuration
139+
$vmssConfig = New-AzVmssConfig `
140+
-Location $location `
141+
-SkuCapacity 2 `
142+
-SkuName "Standard_DS2" `
143+
-UpgradePolicyMode "Automatic"
144+
145+
# Reference the image version
146+
Set-AzVmssStorageProfile $vmssConfig `
147+
-OsDiskCreateOption "FromImage" `
148+
-ImageReferenceId $imageDefinition.Id
149+
150+
# Complete the configuration
151+
Set-AzVmssOsProfile $vmssConfig `
152+
-AdminUsername $cred.UserName `
153+
-AdminPassword $cred.Password `
154+
-ComputerNamePrefix "myVM"
155+
Add-AzVmssNetworkInterfaceConfiguration `
156+
-VirtualMachineScaleSet $vmssConfig `
157+
-Name "network-config" `
158+
-Primary $true `
159+
-IPConfiguration $ipConfig
160+
161+
# Create the scale set
162+
New-AzVmss `
163+
-ResourceGroupName $resourceGroupName `
164+
-Name $scaleSetName `
165+
-VirtualMachineScaleSet $vmssConfig
166+
```
167+
168+
It takes a few minutes to create and configure all the scale set resources and VMs.
169+
170+
## Next steps
171+
[Azure Image Builder (preview)](../virtual-machines/linux/image-builder-overview.md) can help automate image version creation, you can even use it to update and [create a new image version from an existing image version](../virtual-machines/linux/image-builder-gallery-update-image-version.md).
172+
173+
You can also create Shared Image Gallery resource using templates. There are several Azure Quickstart Templates available:
174+
175+
- [Create a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-create/)
176+
- [Create an Image Definition in a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-image-definition-create/)
177+
- [Create an Image Version in a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-image-version-create/)
178+
179+
For more information about Shared Image Galleries, see the [Overview](shared-image-galleries.md). If you run into issues, see [Troubleshooting shared image galleries](troubleshooting-shared-images.md).
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Create a scale set from a specialized image version using the Azure CLI
3+
description: Create a scale set using a specialized image version in a Shared Image Gallery using the Azure CLI.
4+
author: cynthn
5+
ms.service: virtual-machine-scale-sets
6+
ms.subservice: imaging
7+
ms.workload: infrastructure-services
8+
ms.topic: how-to
9+
ms.date: 05/01/2020
10+
ms.author: cynthn
11+
ms.reviewer: akjosh
12+
---
13+
14+
# Create a scale set using a specialized image version with the Azure CLI
15+
16+
Create a scale set from a [specialized image version](https://docs.microsoft.com/azure/virtual-machines/linux/shared-image-galleries#generalized-and-specialized-images) stored in a Shared Image Gallery. If you want to create a scale set using a generalized image version, see [Create a VM from a generalized image version](instance-generalized-image-version-cli.md).
17+
18+
If you choose to install and use the CLI locally, this tutorial requires that you are running the Azure CLI version 2.4.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI]( /cli/azure/install-azure-cli).
19+
20+
Replace resource names as needed in this example.
21+
22+
List the image definitions in a gallery using [az sig image-definition list](/cli/azure/sig/image-definition#az-sig-image-definition-list) to see the name and ID of the definitions.
23+
24+
```azurecli-interactive
25+
resourceGroup=myGalleryRG
26+
gallery=myGallery
27+
az sig image-definition list \
28+
--resource-group $resourceGroup \
29+
--gallery-name $gallery \
30+
--query "[].[name, id]" \
31+
--output tsv
32+
```
33+
34+
Create a scale set using [`az vmss create`](/cli/azure/vmss#az-vmss-create) using the `--specialized` parameter to indicate the image is a specialized image.
35+
36+
Use the image definition ID for `--image` to create the scale set instances from the latest version of the image that is available. You can also create the scale set instances from a specific version by supplying the image version ID for `--image`. Be aware that using a specific image version means automation could fail if that specific image version isn't available because it was deleted or removed from the region. We recommend using the image definition ID for creating your new VM, unless a specific image version is required.
37+
38+
In this example, we are creating instances from the latest version of the *myImageDefinition* image.
39+
40+
```azurecli
41+
az group create --name myResourceGroup --location eastus
42+
az vmss create \
43+
--resource-group myResourceGroup \
44+
--name myScaleSet \
45+
--image "/subscriptions/<Subscription ID>/resourceGroups/myGalleryRG/providers/Microsoft.Compute/galleries/myGallery/images/myImageDefinition" \
46+
--Specialized
47+
```
48+
49+
50+
## Next steps
51+
[Azure Image Builder (preview)](../virtual-machines/linux/image-builder-overview.md) can help automate image version creation, you can even use it to update and [create a new image version from an existing image version](../virtual-machines/linux/image-builder-gallery-update-image-version.md).
52+
53+
You can also create Shared Image Gallery resource using templates. There are several Azure Quickstart Templates available:
54+
55+
- [Create a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-create/)
56+
- [Create an Image Definition in a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-image-definition-create/)
57+
- [Create an Image Version in a Shared Image Gallery](https://azure.microsoft.com/resources/templates/101-sig-image-version-create/)
58+
59+
60+

0 commit comments

Comments
 (0)