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
> The rest of this article assumes that you're using at least the `[openlogic]` repo, which is used to install the Azure Linux agent.
145
145
146
146
1. Add the following line to `/etc/yum.conf`:
@@ -163,7 +163,7 @@ This article assumes that you already installed a CentOS (or similar derivative)
163
163
164
164
A reboot might be required after running this command.
165
165
166
-
1. (Optional) Install the drivers for the Linux Integration Services (LIS).
166
+
1. Optional: Install the drivers for the Linux Integration Services (LIS).
167
167
168
168
> [!IMPORTANT]
169
169
> The step is *required*for CentOS 6.3 and earlier and is optional for later releases.
@@ -201,7 +201,7 @@ This article assumes that you already installed a CentOS (or similar derivative)
201
201
202
202
Graphical and `quiet boot` isn't useful in a cloud environment where you want all the logs to be sent to the serial port. The `crashkernel` option can be left configured if you want. But this parameter reduces the amount of available memory in the VM by 128 MB or more, which might be a problem for smaller VM sizes.
203
203
204
-
> [!Important]
204
+
> [!IMPORTANT]
205
205
> CentOS 6.5 and earlier must also set the kernel parameter `numa=off`. For more information, see Red Hat [KB 436883](https://access.redhat.com/solutions/436883).
206
206
207
207
1. Ensure that the Secure Shell server is installed and configured to start at boot time. This setting is usually the default.
@@ -232,7 +232,7 @@ This article assumes that you already installed a CentOS (or similar derivative)
232
232
233
233
## CentOS 7.0+
234
234
235
-
Follow the steps in the following sections if you're using CentOS 7.0+.
235
+
Follow the steps in the next sections if you're using CentOS 7.0+.
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/debian-create-upload-vhd.md
+37-37Lines changed: 37 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Prepare an Debian Linux VHD
3
-
description: Learn how to create Debian VHD images for VM deployments in Azure.
2
+
title: Prepare a Debian Linux VHD
3
+
description: Learn how to create Debian VHD images for virtual machine deployments in Azure.
4
4
author: srijang
5
5
ms.service: virtual-machines
6
6
ms.custom: linux-related-content
@@ -10,25 +10,28 @@ ms.date: 05/01/2024
10
10
ms.author: maries
11
11
ms.reviewer: mattmcinnes
12
12
---
13
+
13
14
# Prepare a Debian VHD for Azure
14
15
15
-
**Applies to:**:heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
16
+
**Applies to:**:heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
16
17
17
18
## Prerequisites
18
-
This section assumes that you have already installed a Debian Linux operating system from an .iso file downloaded from the [Debian website](https://www.debian.org/distrib/) to a virtual hard disk. Multiple tools exist to create .vhd files; Hyper-V is only one example. For instructions using Hyper-V, see [Install the Hyper-V Role and Configure a Virtual Machine](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh846766(v=ws.11)).
19
+
20
+
This section assumes that you already installed a Debian Linux operating system from an .iso file downloaded from the [Debian website](https://www.debian.org/distrib/) to a virtual hard disk (VHD). Multiple tools exist to create .vhd files. Hyper-V is only one example. For instructions on using Hyper-V, see [Install the Hyper-V role and configure a virtual machine (VM)](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh846766(v=ws.11)).
19
21
20
22
## Installation notes
21
-
* See also [General Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes) for more tips on preparing Linux for Azure.
22
-
* The newer VHDX format is not supported in Azure. You can convert the disk to VHD format using Hyper-V Manager or the **convert-vhd** cmdlet.
23
-
* When installing the Linux system, it is recommended that you use standard partitions rather than LVM (often the default for many installations). This will avoid LVM name conflicts with cloned VMs, particularly if an OS disk ever needs to be attached to another VM for troubleshooting. [LVM](/previous-versions/azure/virtual-machines/linux/configure-lvm) or [RAID](/previous-versions/azure/virtual-machines/linux/configure-raid) may be used on data disks if preferred.
24
-
* Do not configure a swap partition on the OS disk. The Azure Linux agent can be configured to create a swap file on the temporary resource disk. More information can be found in the steps below.
25
-
* All VHDs on Azure must have a virtual size aligned to 1MB. When converting from a raw disk to VHD, you must ensure that the raw disk size is a multiple of 1MB before conversion. For more information, see [Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes).
23
+
24
+
* For more tips on preparing Linux for Azure, see [General Linux installation notes](create-upload-generic.md#general-linux-installation-notes).
25
+
* The newer VHDX format isn't supported in Azure. You can convert the disk to VHD format by using Hyper-V Manager or the `convert-vhd` cmdlet.
26
+
* When you install the Linux system, we recommend that you use standard partitions rather than Logical Volume Manager (LVM), which is often the default for many installations. Using partitions avoids LVM name conflicts with cloned VMs, particularly if an OS disk ever needs to be attached to another VM for troubleshooting. [LVM](/previous-versions/azure/virtual-machines/linux/configure-lvm) or [RAID](/previous-versions/azure/virtual-machines/linux/configure-raid) may also be used on data disks.
27
+
* Don't configure a swap partition on the OS disk. The Azure Linux agent can be configured to create a swap file on the temporary resource disk. More information can be found in the following steps.
28
+
* All VHDs on Azure must have a virtual size aligned to 1 MB. When you convert from a raw disk to VHD, you must ensure that the raw disk size is a multiple of 1 MB before conversion. For more information, see [Linux installation notes](create-upload-generic.md#general-linux-installation-notes).
26
29
27
30
## Prepare a Debian image for Azure
28
31
29
-
You can create the base Azure Debian Cloud image with the [FAI cloud image builder](https://salsa.debian.org/cloud-team/debian-cloud-images).
32
+
You can create the base Azure Debian cloud image with the [fully automatic installation (FAI) cloud image builder](https://salsa.debian.org/cloud-team/debian-cloud-images).
30
33
31
-
(The following git clone and apt install commands were pulled from the Debian Cloud Images repo) Start by cloning the repo and installing dependencies:
34
+
The following git clone and apt installation commands were pulled from the Debian cloud images repo. Start by cloning the repo and installing dependencies:
qemu-img convert -f raw -o subformat=fixed,force_size -O vpc "$rawdisk" "$vhddisk"
86
85
```
87
86
87
+
This process creates a VHD `image_[release]_azure_amd64.vhd` with a rounded size so that it can be copied successfully to an Azure Disk.
88
88
89
-
This creates a VHD `image_[release]_azure_amd64.vhd` with a rounded size to be able to copy it successfully to an Azure Disk.
90
-
91
-
>[!Note]
89
+
>[!NOTE]
92
90
> Rather than cloning the salsa repository and building images locally, current stable images can be built and downloaded from [FAI](https://fai-project.org/FAIme/cloud/).
93
91
94
-
After creating a stable Debian vhd image, before uploading verify the following packages are installed:
92
+
After you create a stable Debian VHD image and before you upload, verify that the following packages are installed:
93
+
95
94
* apt-get install hyperv-daemons
96
-
* apt-get install waagent # *optional but recommended for password resets and the use of extensions*
95
+
* apt-get install waagent # *(Optional but recommended for password resets and the use of extensions)*
97
96
* apt-get install cloud-init
98
97
99
98
Then perform a full upgrade:
99
+
100
100
* apt-get full-upgrade
101
101
102
-
Now the Azure resources must be created for this image (this uses the `$rounded_size_adjusted` variable, so it should be from within the same shell process from above).
102
+
Now the Azure resources must be created for this image. This example uses the `$rounded_size_adjusted` variable, so it should be from within the same shell process from the preceding step.
103
+
103
104
```
104
105
az group create -l $LOCATION -n $RG
105
106
@@ -138,16 +139,15 @@ az vm create \
138
139
--query id -o tsv)
139
140
```
140
141
142
+
If the bandwidth from your local machine to the Azure Disk is causing a long time to process the upload with `azcopy`, you can use an Azure VM jumpbox to speed up the process. Here's how this process can be done:
141
143
142
-
>[!Note]
143
-
> If the bandwidth from your local machine to the Azure Disk is causing a long time to process the upload with azcopy, you can use an Azure VM jumpbox to speed up the process. Here's how this can be done:
144
-
>
145
-
>1. Create a tarball of the VHD on your local machine: `tar -czvf ./image_buster_azure_amd64.vhd.tar.gz ./image_[release]_azure_amd64.vhd`.
146
-
>2. Create an Azure Linux VM (distro of your choice). Make sure that you create it with a large enough disk to hold the extracted VHD!
147
-
>3. Download the azcopy utility to the Azure Linux VM. It can be retrieved from [here](../../storage/common/storage-use-azcopy-v10.md#download-azcopy).
148
-
>4. Copy the tarball to the VM: `scp ./image_buster_azure_amd64.vhd.tar.gz <vm>:~`.
149
-
>5. On the VM, extract the VHD: `tar -xf ./image_buster_azure_amd64.vhd.tar.gz` (this will take a bit of time given the size of the file).
150
-
>6. Finally on the VM, copy the VHD to the Azure Disk with `azcopy` (the command from above).
144
+
1. Create a tarball of the VHD on your local machine: `tar -czvf ./image_buster_azure_amd64.vhd.tar.gz ./image_[release]_azure_amd64.vhd`.
145
+
1. Create an Azure Linux VM (distro of your choice). Make sure that you create it with a large-enough disk to hold the extracted VHD.
146
+
1. Download the `azcopy` utility to the Azure Linux VM. You can retrieve it from [Get started with AzCopy](../../storage/common/storage-use-azcopy-v10.md#download-azcopy).
147
+
1. Copy the tarball to the VM: `scp ./image_buster_azure_amd64.vhd.tar.gz <vm>:~`.
148
+
1. On the VM, extract the VHD: `tar -xf ./image_buster_azure_amd64.vhd.tar.gz`. This step takes a bit of time based on the size of the file.
149
+
1. Finally, on the VM, copy the VHD to the Azure Disk with `azcopy` (the preceding command).
151
150
151
+
## Related content
152
152
153
-
**Next steps:**You're now ready to use your Debian Linux virtual hard disk to create new virtual machines in Azure. If this is the first time that you're uploading the .vhd file to Azure, see [Create a Linux VM from a custom disk](./upload-vhd.md#option-1-upload-a-vhd).
153
+
You're now ready to use your Debian Linux VHD to create new VMs in Azure. If this is the first time that you're uploading the .vhd file to Azure, see [Create a Linux VM from a custom disk](./upload-vhd.md#option-1-upload-a-vhd).
0 commit comments