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
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/cloudinit-update-vm.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: cynthn
5
5
ms.service: virtual-machines
6
6
ms.collection: linux
7
7
ms.topic: how-to
8
-
ms.date: 06/01/2021
8
+
ms.date: 02/18/2022
9
9
ms.author: cynthn
10
10
ms.subservice: cloud-init
11
11
---
@@ -38,24 +38,25 @@ packages:
38
38
Before deploying, you need to create a resource group with the [az group create](/cli/azure/group) command. An Azure resource group is a logical container into which Azure resources are deployed and managed. The following example creates a resource group named *myResourceGroup* in the *eastus* location.
39
39
40
40
```azurecli-interactive
41
-
az group create --name myResourceGroup --location eastus
41
+
az group create --name myCentOSGroup --location eastus
42
42
```
43
43
44
44
Now, create a VM with [az vm create](/cli/azure/vm) and specify the cloud-init file with the `--custom-data` parameter as follows:
45
45
46
46
```azurecli-interactive
47
47
az vm create \
48
-
--resource-group myResourceGroup \
49
-
--name centos74 \
50
-
--image OpenLogic:CentOS:7.5:latest \
48
+
--resource-group myCentOSGroup \
49
+
--name centos83 \
50
+
--image OpenLogic:CentOS:8_3:latest \
51
51
--custom-data cloud_init_upgrade.txt \
52
+
--admin-username azureuser \
52
53
--generate-ssh-keys
53
54
```
54
55
55
56
SSH to the public IP address of your VM shown in the output from the preceding command. Enter your own **publicIpAddress** as follows:
56
57
57
58
```bash
58
-
ssh <publicIpAddress>
59
+
ssh azureuser@<publicIpAddress>
59
60
```
60
61
61
62
Run the package management tool and check for updates.
@@ -67,12 +68,11 @@ sudo yum update
67
68
As cloud-init checked for and installed updates on boot, there should be no additional updates to apply. You see the update process, number of altered packages as well as the installation of `httpd` by running `yum history` and review the output similar to the one below.
68
69
69
70
```bash
70
-
Loaded plugins: fastestmirror, langpacks
71
-
ID | Command line | Date and time| Action(s) | Altered
0 commit comments