Skip to content

Commit 5f8c6f3

Browse files
author
naman-msft
committed
updated files and added new docs
1 parent 78d5d24 commit 5f8c6f3

File tree

10 files changed

+418
-465
lines changed

10 files changed

+418
-465
lines changed

scenarios/azure-compute-docs/articles/virtual-machine-scale-sets/tutorial-autoscale-cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export MY_RESOURCE_GROUP_NAME="myResourceGroup$RANDOM_SUFFIX"
3737
az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
3838
```
3939

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*.
4141

4242
```azurecli-interactive
4343
export MY_SCALE_SET_NAME="myScaleSet$RANDOM_SUFFIX"
@@ -92,7 +92,7 @@ az monitor autoscale rule create \
9292
```
9393

9494
## 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.
9696

9797
```bash
9898
for i in {1..3}; do
@@ -105,7 +105,7 @@ pkill yes
105105
This command simulates CPU load without introducing package installation errors.
106106

107107
## 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.
109109

110110
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:
111111

scenarios/azure-compute-docs/articles/virtual-machine-scale-sets/tutorial-modify-scale-sets-cli.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ ms.custom: mimckitt, devx-track-azurecli, linux-related-content, innovation-engi
1313
# Tutorial: Modify a Virtual Machine Scale Set using Azure CLI
1414
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.
1515

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*.
1717

1818
```bash
19-
export RANDOM_SUFFIX=$(openssl rand -hex 3)
19+
export RANDOM_SUFFIX=adcc95
2020
export MY_RESOURCE_GROUP_NAME="myResourceGroup$RANDOM_SUFFIX"
2121
export SCALE_SET_NAME="myScaleSet$RANDOM_SUFFIX"
2222
export NEW_INSTANCE_NAME="myNewInstance$RANDOM_SUFFIX"
@@ -46,7 +46,7 @@ az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
4646
```
4747

4848
## 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.
5050

5151
```azurecli-interactive
5252
az vmss create \
@@ -164,7 +164,7 @@ The exact presentation of the output depends on the options you provide to the c
164164
}
165165
```
166166

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*.
168168

169169
```azurecli-interactive
170170
az vmss update --name $SCALE_SET_NAME --resource-group $MY_RESOURCE_GROUP_NAME --license-type RHEL_BYOS
@@ -185,7 +185,7 @@ az vmss update \
185185
--protect-from-scale-in
186186
```
187187

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.
189189

190190
> [!IMPORTANT]
191191
>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 \
199199
--admin-username azureuser \
200200
--generate-ssh-keys \
201201
--instance-count 5 \
202-
--os-disk-size-gb 64 \
203-
--admin-username azureuser
202+
--os-disk-size-gb 64
204203
```
205204

206205
## 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,
288287
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:
289288

290289
```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
293291
```
294292

295293
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
305303
"diskSizeGb": 1023,
306304
"lun": 0,
307305
"managedDisk": {
308-
"id": "/subscriptions/xxxxx/resourceGroups/myResourceGroupxxx/providers/Microsoft.Compute/disks/disk_namexxxx",
306+
"id": "/subscriptions/xxxxx/resourceGroups/myResourceGroupxxx/providers/Microsoft.Compute/disks/disk_name1",
309307
"resourceGroup": "myResourceGroupxxx",
310308
"storageAccountType": "Premium_LRS"
311309
},
312-
"name": "disk_namexxxx",
310+
"name": "disk_name1",
313311
"toBeDetached": false
314312
}
315313
]
@@ -321,7 +319,7 @@ Running [az vm show](/cli/azure/vm#az-vm-show) again, we now will see that the V
321319
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.
322320

323321
```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
325323
```
326324

327325
```output

scenarios/azure-compute-docs/articles/virtual-machines/disks-enable-performance.md

Lines changed: 35 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: azure-disk-storage
66
ms.topic: how-to
77
ms.date: 12/09/2024
88
ms.author: rogarana
9-
ms.custom: devx-track-azurepowershell, innovation-engine
9+
ms.custom: devx-track-azurepowershell
1010
---
1111

1212
# 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
2929

3030
## Enable performance plus
3131

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 and attach it to a VM:
3333

3434
# [Azure CLI](#tab/azure-cli)
3535

@@ -190,142 +190,52 @@ Results:
190190

191191
# [Azure PowerShell](#tab/azure-powershell)
192192

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:
196194

197195
```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
201+
$sku=desiredSKU
202+
#Size must be 513 or larger
203+
$size=513
204+
$lun=desiredLun
205+
206+
Set-AzContext -SubscriptionName <yourSubscriptionName>
216207
217-
This step creates a new disk with performance plus enabled using a valid SKU value.
218-
219-
```azurepowershell
220-
$myDisk = "PerfPlusDisk$RANDOM_SUFFIX"
221-
$sku = "Premium_LRS"
222-
$size = 513
223208
$diskConfig = New-AzDiskConfig -Location $region -CreateOption Empty -DiskSizeGB $size -SkuName $sku -PerformancePlus $true
224-
$dataDisk = New-AzDisk -ResourceGroupName $myRG -DiskName $myDisk -Disk $diskConfig
225-
```
226209
227-
Results:
228-
229-
<!-- expected_similarity=0.3 -->
230-
```JSON
231-
{
232-
"ResourceGroup": "PerfPlusRGxxx",
233-
"Name": "PerfPlusDiskxxx",
234-
"Location": "WestUS2",
235-
"Sku": "Premium_LRS",
236-
"DiskSizeGB": 513,
237-
"PerformancePlus": true,
238-
"ProvisioningState": "Succeeded"
239-
}
240-
```
241-
242-
### Attempt to attach the disk to a VM
243-
244-
This optional step checks whether the specified VM exists before attempting the disk attachment.
245-
246-
```azurepowershell
247-
$myVM = "NonExistentVM"
248-
if (Get-AzVM -ResourceGroupName $myRG -Name $myVM -ErrorAction SilentlyContinue) {
249-
Add-AzVMDataDisk -VMName $myVM -ResourceGroupName $myRG -DiskName $myDisk -Lun 0 -CreateOption Empty -ManagedDiskId $dataDisk.Id
250-
} else {
251-
Write-Output "VM $myVM not found. Skipping disk attachment."
252-
}
253-
```
254-
255-
Results:
210+
$dataDisk = New-AzDisk -ResourceGroupName $myRG -DiskName $myDisk -Disk $diskConfig
256211
257-
<!-- expected_similarity=0.3 -->
258-
```text
259-
VM NonExistentVM not found. Skipping disk attachment.
212+
Add-AzVMDataDisk -VMName $myVM -ResourceGroupName $myRG -DiskName $myDisk -Lun $lun -CreateOption Empty -ManagedDiskId $dataDisk.Id
260213
```
261214

262-
### 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:
267216

268217
```azurepowershell
269-
$RANDOM_SUFFIX = (New-Guid).Guid.Substring(0,6)
270-
$myMigrRG = "PerfPlusMigrRG$RANDOM_SUFFIX"
271-
$region = "WestUS2"
272-
New-AzResourceGroup -Name $myMigrRG -Location $region
273-
```
274-
275-
Results:
218+
$myDisk=yourDiskOrSnapshotName
219+
$myVM=yourVMName
220+
$region=desiredRegion
221+
# Valid values are Premium_LRS, Premium_ZRS, StandardSSD_LRS, StandardSSD_ZRS, or Standard_LRS
222+
$sku=desiredSKU
223+
#Size must be 513 or larger
224+
$size=513
225+
$sourceURI=diskOrSnapshotURI
226+
$lun=desiredLun
227+
228+
Set-AzContext -SubscriptionName <<yourSubscriptionName>>
276229
277-
<!-- expected_similarity=0.3 -->
278-
```JSON
279-
{
280-
"ResourceGroupName": "PerfPlusMigrRGxxx",
281-
"Location": "WestUS2",
282-
"ProvisioningState": "Succeeded"
283-
}
284-
```
285-
286-
#### Create the disk from an existing snapshot or disk
287-
288-
```azurepowershell
289-
$myDisk = "PerfPlusMigrDisk$RANDOM_SUFFIX"
290-
$sku = "Premium_LRS"
291-
$size = 513
292-
$sourceURI = "https://examplestorageaccount.blob.core.windows.net/snapshots/sample-westus2.vhd" # Replace with a valid source blob URI in WestUS2
293230
$diskConfig = New-AzDiskConfig -Location $region -CreateOption Copy -DiskSizeGB $size -SkuName $sku -PerformancePlus $true -SourceResourceID $sourceURI
294-
$dataDisk = New-AzDisk -ResourceGroupName $myMigrRG -DiskName $myDisk -Disk $diskConfig
295-
```
296-
297-
Results:
298-
299-
<!-- expected_similarity=0.3 -->
300-
```JSON
301-
{
302-
"ResourceGroup": "PerfPlusMigrRGxxx",
303-
"Name": "PerfPlusMigrDiskxxx",
304-
"Location": "WestUS2",
305-
"Sku": "Premium_LRS",
306-
"DiskSizeGB": 513,
307-
"PerformancePlus": true,
308-
"SourceResourceID": "https://examplestorageaccount.blob.core.windows.net/snapshots/sample-westus2.vhd",
309-
"ProvisioningState": "Succeeded"
310-
}
311-
```
312231
313-
#### Attempt to attach the migrated disk to a VM
314-
315-
This optional step verifies the existence of the specified VM before attempting disk attachment.
316-
317-
```azurepowershell
318-
$myVM = "NonExistentVM"
319-
if (Get-AzVM -ResourceGroupName $myMigrRG -Name $myVM -ErrorAction SilentlyContinue) {
320-
Add-AzVMDataDisk -VMName $myVM -ResourceGroupName $myMigrRG -DiskName $myDisk -Lun 0 -CreateOption Empty -ManagedDiskId $dataDisk.Id
321-
} else {
322-
Write-Output "VM $myVM not found. Skipping disk attachment."
323-
}
232+
$dataDisk = New-AzDisk -ResourceGroupName $myRG -DiskName $myDisk -Disk $diskconfig
233+
Add-AzVMDataDisk -VMName $myVM -ResourceGroupName $myRG -DiskName $myDisk -Lun $lun -CreateOption Empty -ManagedDiskId $dataDisk.Id
324234
```
235+
---
325236

326-
Results:
237+
## Next steps
327238

328-
<!-- expected_similarity=0.3 -->
329-
```text
330-
VM NonExistentVM not found. Skipping disk attachment.
331-
```
239+
- [Create an incremental snapshot for managed disks](disks-incremental-snapshots.md)
240+
- [Expand virtual hard disks on a Linux VM](linux/expand-disks.md)
241+
- [How to expand virtual hard disks attached to a Windows virtual machine](windows/expand-os-disk.md)

scenarios/azure-compute-docs/articles/virtual-machines/linux/tutorial-manage-vm.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ It may take a few minutes to create the VM. Once the VM has been created, the Az
9090

9191
## Connect to VM
9292

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.
9494

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)```
9697

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:
99+
```ssh -o StrictHostKeyChecking=no azureuser@$IP_ADDRESS```
98100

99101
## Understand VM images
100102

tools/alert-bad-process.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: 1
2+
kind: instance-spec
3+
image: trace_exec:v0.38.0
4+
name: alert-bad-process
5+
paramValues:
6+
# monitor all namespaces
7+
operator.KubeManager.all-namespaces: true
8+
# monitor shell executions (only bash on this example)
9+
operator.filter.filter: proc.comm==bash
10+
# name of the metric to export
11+
operator.otel-metrics.otel-metrics-name: 'exec:shell_executions'
12+
# annotate gadget to enable metrics collection
13+
operator.oci.annotate: exec:metrics.collect=true,exec:metrics.implicit-counter.name=shell_executions,exec.k8s.namespace:metrics.type=key,exec.k8s.podname:metrics.type=key,exec.k8s.containername:metrics.type=key

0 commit comments

Comments
 (0)