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/create-upload-centos.md
+47-45Lines changed: 47 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,8 +225,8 @@ This article assumes that you already installed a CentOS (or similar derivative)
225
225
sudo export HISTSIZE=0
226
226
```
227
227
228
-
> [!NOTE]
229
-
> If you're migrating a specific VM and don't want to create a generalized image, skip the deprovision step.
228
+
> [!NOTE]
229
+
> If you're migrating a specific VM and don't want to create a generalized image, skip the deprovision step.
230
230
231
231
1. Select **Action**>**Shut Down**in Hyper-V Manager. Your Linux VHD is now ready to be [uploaded to Azure](./upload-vhd.md#option-1-upload-a-vhd).
232
232
@@ -241,7 +241,7 @@ Preparing a CentOS 7 VM for Azure is similar to CentOS 6. Several significant di
241
241
* The `NetworkManager` package no longer conflicts with the Azure Linux agent. This package is installed by default and we recommend that you don't remove it.
242
242
* GRUB2 is now used as the default bootloader, so the procedure for editing kernel parameters has changed. (See the "Configuration steps" section.)
243
243
* XFS is now the default file system. The ext4 file system can still be used if you want.
244
-
*Since CentOS 8 Stream and newer no longer include `network.service` by default, you need to install it manually:
244
+
*Because CentOS 8 Stream and newer no longer include `network.service` by default, you need to install it manually:
245
245
246
246
```bash
247
247
sudo yum install network-scripts
@@ -362,21 +362,21 @@ Preparing a CentOS 7 VM for Azure is similar to CentOS 6. Several significant di
362
362
> [!NOTE]
363
363
> If you're uploading a UEFI-enabled VM, the command to update grub is `grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg`. Also, the vfat kernel module must be enabled in the kernel. Otherwise, provisioning fails.
364
364
>
365
-
> Make sure the udf module is enabled. Removing or disabling it will cause a provisioning or boot failure. *(_Cloud-init >= 21.2 removes the udf requirement. For more information, read the top of document.)*
365
+
> Make sure the udf module is enabled. Removing or disabling it will cause a provisioning or boot failure. *(_Cloud-init >= 21.2 removes the udf requirement. For more information, read the top of the document.)*
366
366
367
-
1. If you're building the image from VMware, VirtualBox, or KVM: Ensure that the Hyper-V drivers are included in the initramfs:
367
+
1. If you're building the image from VMware, VirtualBox, or KVM, ensure that the Hyper-V drivers are included in the initramfs:
368
368
369
-
Edit `/etc/dracut.conf`, add content:
369
+
1. Edit `/etc/dracut.conf` and add content:
370
370
371
-
```config
372
-
add_drivers+=" hv_vmbus hv_netvsc hv_storvsc "
373
-
```
371
+
```config
372
+
add_drivers+=" hv_vmbus hv_netvsc hv_storvsc "
373
+
```
374
374
375
-
Rebuild the initramfs:
375
+
1. Rebuild the initramfs:
376
376
377
-
```bash
378
-
sudo dracut -f -v
379
-
```
377
+
```bash
378
+
sudo dracut -f -v
379
+
```
380
380
381
381
1. Install the Azure Linux agent and dependencies for Azure VM extensions:
382
382
@@ -390,21 +390,23 @@ Preparing a CentOS 7 VM for Azure is similar to CentOS 6. Several significant di
@@ -430,43 +432,43 @@ Preparing a CentOS 7 VM for Azure is similar to CentOS 6. Several significant di
430
432
EOF
431
433
```
432
434
433
-
1. Swap configuration.
434
-
435
-
Don't create swap space on the OS disk.
436
-
437
-
Previously, the Azure Linux agent was used to automatically configure swap space by using the local resource disk that's attached to the VM after the VM is provisioned on Azure. However, cloud-init now handles this step. You *must not* use the Linux agent to format the resource disk to create the swap file. Modify the following parameters in`/etc/waagent.conf` appropriately:
438
-
439
-
```bash
440
-
sudo sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
441
-
sudo sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
442
-
```
435
+
1. Swap configuration:
443
436
444
-
If you want to mount, format, and create the swap file, you can either:
437
+
1. Don't create swap space on the OS disk.
445
438
446
-
* Pass this commandin as a cloud-init config every time you create a VM.
447
-
* Use a cloud-init directive baked into the image to do this step every time the VM is created:
439
+
Previously, the Azure Linux agent was used to automatically configure swap space by using the local resource disk that's attached to the VM after the VM is provisioned on Azure. However, cloud-init now handles this step. You *must not* use the Linux agent to format the resource disk to create the swap file. Modify the following parameters in`/etc/waagent.conf` appropriately:
0 commit comments