You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
38
38
```
39
39
40
-
Now create a Virtual Machine Scale Set with [az vmss create](/cli/azure/vmss). The following example creates a scale set with an instance count of 2, generates SSH keys if they don't exist, and uses a valid image "Ubuntu2204".
40
+
Now create a Virtual Machine Scale Set with [az vmss create](/cli/azure/vmss). The following example creates a scale set with an instance count of 2, generates SSH keys if they don't exist, and uses a valid image *Ubuntu2204*.
@@ -92,7 +92,7 @@ az monitor autoscale rule create \
92
92
```
93
93
94
94
## Simulate CPU load on scale set
95
-
To test the autoscale rules, you need to simulate sustained CPU load on the VM instances in the scale set. In this minimalist approach, we avoid installing additional packages by using the built-in "yes" command to generate CPU load. The following command starts 3 background processes that continuously output data to /dev/null for 60 seconds and then terminates them.
95
+
To test the autoscale rules, you need to simulate sustained CPU load on the VM instances in the scale set. In this minimalist approach, we avoid installing additional packages by using the built-in `yes` command to generate CPU load. The following command starts 3 background processes that continuously output data to `/dev/null` for 60 seconds and then terminates them.
96
96
97
97
```bash
98
98
foriin {1..3};do
@@ -105,7 +105,7 @@ pkill yes
105
105
This command simulates CPU load without introducing package installation errors.
106
106
107
107
## Monitor the active autoscale rules
108
-
To monitor the number of VM instances in your scale set, use the watch command. It may take up to 5 minutes for the autoscale rules to begin the scale-out process in response to the CPU load. However, once it happens, you can exit watch with Ctrl-c.
108
+
To monitor the number of VM instances in your scale set, use the `watch` command. It may take up to 5 minutes for the autoscale rules to begin the scale-out process in response to the CPU load. However, once it happens, you can exit watch with *CTRL + C* keys.
109
109
110
110
By then, the scale set will automatically increase the number of VM instances to meet the demand. The following command shows the list of VM instances in the scale set:
# Tutorial: Modify a Virtual Machine Scale Set using Azure CLI
14
14
Throughout the lifecycle of your applications, you may need to modify or update your Virtual Machine Scale Set. These updates may include how to update the configuration of the scale set, or change the application configuration. This article describes how to modify an existing scale set using the Azure CLI.
15
15
16
-
Below, we declare environment variables that will be used throughout this document. A random suffix is appended to resource names that need to be unique for each deployment. The REGION is set to WestUS2.
16
+
Below, we declare environment variables that will be used throughout this document. A random suffix is appended to resource names that need to be unique for each deployment. The `REGION` is set to *WestUS2*.
@@ -46,7 +46,7 @@ az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
46
46
```
47
47
48
48
## Create the Virtual Machine Scale Set
49
-
To ensure that subsequent update and query commands have a valid resource to work on, create a Virtual Machine Scale Set. In this step, we deploy a basic scale set using a valid image ("Ubuntu2204") and set the instance count to 5 so that instance-specific updates can target an existing instance ID.
49
+
To ensure that subsequent update and query commands have a valid resource to work on, create a Virtual Machine Scale Set. In this step, we deploy a basic scale set using a valid image (*Ubuntu2204*) and set the instance count to 5 so that instance-specific updates can target an existing instance ID.
50
50
51
51
```azurecli-interactive
52
52
az vmss create \
@@ -164,7 +164,7 @@ The exact presentation of the output depends on the options you provide to the c
164
164
}
165
165
```
166
166
167
-
You can use [az vmss update](/cli/azure/vmss#az-vmss-update) to update various properties of your scale set. For example, updating your license type or a VM's instance protection policy. Note that the allowed license type value is "RHEL_BYOS" rather than "Windows_Server."
167
+
You can use [az vmss update](/cli/azure/vmss#az-vmss-update) to update various properties of your scale set. For example, updating your license type or a VM's instance protection policy. Note that the allowed license type value is *RHEL_BYOS* rather than *Windows_Server*.
168
168
169
169
```azurecli-interactive
170
170
az vmss update --name $SCALE_SET_NAME --resource-group $MY_RESOURCE_GROUP_NAME --license-type RHEL_BYOS
@@ -185,7 +185,7 @@ az vmss update \
185
185
--protect-from-scale-in
186
186
```
187
187
188
-
Additionally, if you previously deployed the scale set with the az vmss create command, you can run the az vmss create command again to update the scale set. Make sure that all properties in the az vmss create command are the same as before, except for the properties that you wish to modify. For example, below we're increasing the instance count to five.
188
+
Additionally, if you previously deployed the scale set with the `az vmss create` command, you can run the `az vmss create` command again to update the scale set. Make sure that all properties in the `az vmss create` command are the same as before, except for the properties that you wish to modify. For example, below we're increasing the instance count to five.
189
189
190
190
> [!IMPORTANT]
191
191
>Starting November 2023, VM scale sets created using PowerShell and Azure CLI will default to Flexible Orchestration Mode if no orchestration mode is specified. For more information about this change and what actions you should take, go to [Breaking Change for VMSS PowerShell/CLI Customers - Microsoft Community Hub](https://techcommunity.microsoft.com/t5/azure-compute-blog/breaking-change-for-vmss-powershell-cli-customers/ba-p/3818295)
@@ -199,8 +199,7 @@ az vmss create \
199
199
--admin-username azureuser \
200
200
--generate-ssh-keys \
201
201
--instance-count 5 \
202
-
--os-disk-size-gb 64 \
203
-
--admin-username azureuser
202
+
--os-disk-size-gb 64
204
203
```
205
204
206
205
## Updating individual VM instances in a scale set
@@ -288,8 +287,7 @@ These properties describe the configuration of a VM instance within a scale set,
288
287
You can perform updates to individual VM instances in a scale set just like you would a standalone VM. For example, attaching a new data disk to instance 1:
289
288
290
289
```azurecli-interactive
291
-
export DISK_NAME="disk_name$RANDOM_SUFFIX"
292
-
az vm disk attach --resource-group $MY_RESOURCE_GROUP_NAME --vm-name $INSTANCE_NAME --name $DISK_NAME --new
290
+
az vm disk attach --resource-group $MY_RESOURCE_GROUP_NAME --vm-name $INSTANCE_NAME --name disk_name1 --new
293
291
```
294
292
295
293
Running [az vm show](/cli/azure/vm#az-vm-show) again, we now will see that the VM instance has the new disk attached.
@@ -305,11 +303,11 @@ Running [az vm show](/cli/azure/vm#az-vm-show) again, we now will see that the V
@@ -321,7 +319,7 @@ Running [az vm show](/cli/azure/vm#az-vm-show) again, we now will see that the V
321
319
There are times where you might want to add a new VM to your scale set but want different configuration options than those listed in the scale set model. VMs can be added to a scale set during creation by using the [az vm create](/cli/azure/vmss#az-vmss-create) command and specifying the scale set name you want the instance added to.
322
320
323
321
```azurecli-interactive
324
-
az vm create --name $NEW_INSTANCE_NAME --resource-group $MY_RESOURCE_GROUP_NAME --vmss $SCALE_SET_NAME --image RHELRaw8LVMGen2 --admin-username azureuser
322
+
az vm create --name $NEW_INSTANCE_NAME --resource-group $MY_RESOURCE_GROUP_NAME --vmss $SCALE_SET_NAME --image RHELRaw8LVMGen2
# Preview - Increase IOPS and throughput limits for Azure Premium SSDs and Standard SSD/HDDs
@@ -29,7 +29,7 @@ Either use the Azure Cloud Shell to run your commands or install a version of th
29
29
30
30
## Enable performance plus
31
31
32
-
You need to create a new disk to use performance plus. The following scripts show how to create a disk with performance plus enabled and, if desired, attach it to a VM. The commands have been organized into self-contained steps for reliability.
32
+
You need to create a new disk to use performance plus. The following script creates a disk that has performance plus enabled andattach it to a VM:
33
33
34
34
# [Azure CLI](#tab/azure-cli)
35
35
@@ -190,142 +190,52 @@ Results:
190
190
191
191
# [Azure PowerShell](#tab/azure-powershell)
192
192
193
-
### Create a resource group
194
-
195
-
This step creates a resource group with a unique name.
193
+
You need to create a new disk to use performance plus. The following script creates a disk that has performance plus enabled and attach it to a VM:
196
194
197
195
```azurepowershell
198
-
$RANDOM_SUFFIX = (New-Guid).Guid.Substring(0,6)
199
-
$myRG = "PerfPlusRG$RANDOM_SUFFIX"
200
-
$region = "WestUS2"
201
-
New-AzResourceGroup -Name $myRG -Location $region
202
-
```
203
-
204
-
Results:
205
-
206
-
<!-- expected_similarity=0.3 -->
207
-
```JSON
208
-
{
209
-
"ResourceGroupName": "PerfPlusRGxxx",
210
-
"Location": "WestUS2",
211
-
"ProvisioningState": "Succeeded"
212
-
}
213
-
```
214
-
215
-
### Create a new disk with performance plus enabled
196
+
$myRG=yourResourceGroupName
197
+
$myDisk=yourDiskName
198
+
$myVM=yourVMName
199
+
$region=desiredRegion
200
+
# Valid values are Premium_LRS, Premium_ZRS, StandardSSD_LRS, StandardSSD_ZRS, or Standard_LRS
### Create a new disk from an existing disk or snapshot with performance plus enabled
263
-
264
-
This series of steps creates a separate resource group and then creates a new disk from an existing disk or snapshot. Replace the $sourceURI with a valid source blob URI that belongs to the same region (WestUS2) as the disk.
265
-
266
-
#### Create a resource group for migration
215
+
To migrate data from an existing disk or snapshot to a new disk with performance plus enabled, use the following script:
Copy file name to clipboardExpand all lines: scenarios/azure-compute-docs/articles/virtual-machines/linux/tutorial-manage-vm.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,11 +90,13 @@ It may take a few minutes to create the VM. Once the VM has been created, the Az
90
90
91
91
## Connect to VM
92
92
93
-
The original tutorial includes commands to connect to the VM via SSH. For non-interactive automated execution, the SSH command is not executed. Instead, use the provided public IP address output from VM creation to manually connect if needed.
93
+
You can now connect to the VM with SSH in the Azure Cloud Shell or from your local computer. Replace the example IP address with the `publicIpAddress` noted in the previous step.
94
94
95
-
To connect to the VM, first retrieve the public IP address using the Azure CLI. Execute the following command to store the IP address in a variable: ```export IP_ADDRESS=$(az vm show --show-details --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_VM_NAME --query publicIps --output tsv)```
95
+
To connect to the VM, first retrieve the public IP address using the Azure CLI. Execute the following command to store the IP address in a variable:
96
+
```export IP_ADDRESS=$(az vm show --show-details --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_VM_NAME --query publicIps --output tsv)```
96
97
97
-
Once you have the IP address, use SSH to connect to the VM. The following command connects to the VM using the `azureuser` account and the retrieved IP address: ```ssh -o StrictHostKeyChecking=no azureuser@$IP_ADDRESS```
98
+
Once you have the IP address, use SSH to connect to the VM. The following command connects to the VM using the `azureuser` account and the retrieved IP address:
0 commit comments