Skip to content

Commit 39fcca5

Browse files
authored
Merge pull request #57880 from szarkos/szark-20181113
Update repo information and add info for the Debian Cloud kernel
2 parents 5320a0a + 6084eb6 commit 39fcca5

File tree

1 file changed

+41
-27
lines changed

1 file changed

+41
-27
lines changed

articles/virtual-machines/linux/debian-create-upload-vhd.md

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Prepare an Debian Linux VHD in Azure | Microsoft Docs
3-
description: Learn how to create Debian 7 & 8 VHD files for deployment in Azure.
3+
description: Learn how to create Debian VHD images for deployment in Azure.
44
services: virtual-machines-linux
55
documentationcenter: ''
66
author: szarkos
@@ -14,7 +14,7 @@ ms.workload: infrastructure-services
1414
ms.tgt_pltfrm: vm-linux
1515
ms.devlang: na
1616
ms.topic: article
17-
ms.date: 03/12/2018
17+
ms.date: 11/13/2018
1818
ms.author: szark
1919

2020
---
@@ -23,14 +23,14 @@ ms.author: szark
2323
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](https://technet.microsoft.com/library/hh846766.aspx).
2424

2525
## Installation notes
26-
* Please see also [General Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes) for more tips on preparing Linux for Azure.
26+
* See also [General Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes) for more tips on preparing Linux for Azure.
2727
* 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.
28-
* 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](configure-lvm.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) or [RAID](configure-raid.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) may be used on data disks if preferred.
29-
* 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 about this can be found in the steps below.
30-
* 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. See [Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes) for more information.
28+
* 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](configure-lvm.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) or [RAID](configure-raid.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) may be used on data disks if preferred.
29+
* 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.
30+
* 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).
3131

3232
## Use Azure-Manage to create Debian VHDs
33-
There are tools available for generating Debian VHDs for Azure, such as the [azure-manage](https://github.com/credativ/azure-manage) scripts from [credativ](http://www.credativ.com/). This is the recommended approach versus creating an image from scratch. For example, to create a Debian 8 VHD run the following commands to download azure-manage (and dependencies) and run the azure_build_image script:
33+
There are tools available for generating Debian VHDs for Azure, such as the [azure-manage](https://github.com/credativ/azure-manage) scripts from [Credativ](http://www.credativ.com/). This is the recommended approach versus creating an image from scratch. For example, to create a Debian 8 VHD run the following commands to download the `azure-manage` utility (and dependencies) and run the `azure_build_image` script:
3434

3535
# sudo apt-get update
3636
# sudo apt-get install git qemu-utils mbr kpartx debootstrap
@@ -47,47 +47,61 @@ There are tools available for generating Debian VHDs for Azure, such as the [azu
4747
## Manually prepare a Debian VHD
4848
1. In Hyper-V Manager, select the virtual machine.
4949
2. Click **Connect** to open a console window for the virtual machine.
50-
3. Comment out the line for **deb cdrom** in `/etc/apt/source.list` if you set up the VM against an ISO file.
50+
3. If you installed the OS using an ISO, then comment out any line relating to "`deb cdrom`" in `/etc/apt/source.list`.
51+
5152
4. Edit the `/etc/default/grub` file and modify the **GRUB_CMDLINE_LINUX** parameter as follows to include additional kernel parameters for Azure.
5253

53-
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 rootdelay=30"
54+
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200"
55+
5456
5. Rebuild the grub and run:
55-
57+
5658
# sudo update-grub
57-
6. Add Debian's Azure repositories to /etc/apt/sources.list for either Debian 7 or 8:
58-
59-
**Debian 7.x "Wheezy"**
60-
61-
deb http://debian-archive.trafficmanager.net/debian wheezy-backports main
62-
deb-src http://debian-archive.trafficmanager.net/debian wheezy-backports main
63-
deb http://debian-archive.trafficmanager.net/debian-azure wheezy main
64-
deb-src http://debian-archive.trafficmanager.net/debian-azure wheezy main
59+
60+
6. Add Debian's Azure repositories to /etc/apt/sources.list for either Debian 8 or 9:
6561

6662
**Debian 8.x "Jessie"**
6763

64+
deb http://debian-archive.trafficmanager.net/debian jessie main
65+
deb-src http://debian-archive.trafficmanager.net/debian jessie main
66+
deb http://debian-archive.trafficmanager.net/debian-security jessie/updates main
67+
deb-src http://debian-archive.trafficmanager.net/debian-security jessie/updates
68+
deb http://debian-archive.trafficmanager.net/debian jessie-updates main
69+
deb-src http://debian-archive.trafficmanager.net/debian jessie-updates main
6870
deb http://debian-archive.trafficmanager.net/debian jessie-backports main
6971
deb-src http://debian-archive.trafficmanager.net/debian jessie-backports main
70-
deb http://debian-archive.trafficmanager.net/debian-azure jessie main
71-
deb-src http://debian-archive.trafficmanager.net/debian-azure jessie main
72+
73+
**Debian 9.x "Stretch"**
74+
75+
deb http://debian-archive.trafficmanager.net/debian stretch main
76+
deb-src http://debian-archive.trafficmanager.net/debian stretch main
77+
deb http://debian-archive.trafficmanager.net/debian-security stretch/updates main
78+
deb-src http://debian-archive.trafficmanager.net/debian-security stretch/updates main
79+
deb http://debian-archive.trafficmanager.net/debian stretch-updates main
80+
deb-src http://debian-archive.trafficmanager.net/debian stretch-updates main
81+
deb http://debian-archive.trafficmanager.net/debian stretch-backports main
82+
deb-src http://debian-archive.trafficmanager.net/debian stretch-backports main
7283

7384

74-
1. Install the Azure Linux Agent:
85+
7. Install the Azure Linux Agent:
7586

7687
# sudo apt-get update
7788
# sudo apt-get install waagent
78-
2. For Debian 7, it is required to run the 3.16-based kernel from the wheezy-backports repository. First create a file called /etc/apt/preferences.d/linux.pref with the following contents:
89+
90+
8. For Debian 9+, it is recommended to use the new Debian Cloud kernel for use with VMs in Azure. To install this new kernel, first create a file called /etc/apt/preferences.d/linux.pref with the following contents:
7991

80-
Package: linux-image-amd64 initramfs-tools
81-
Pin: release n=wheezy-backports
92+
Package: linux-* initramfs-tools
93+
Pin: release n=stretch-backports
8294
Pin-Priority: 500
8395

84-
Then run "sudo apt-get install linux-image-amd64" to install the new kernel.
85-
3. Deprovision the virtual machine and prepare it for provisioning on Azure and run:
96+
Then run "sudo apt-get install linux-image-cloud-amd64" to install the new Debian Cloud kernel.
97+
98+
9. Deprovision the virtual machine and prepare it for provisioning on Azure and run:
8699

87100
# sudo waagent –force -deprovision
88101
# export HISTSIZE=0
89102
# logout
90-
4. Click **Action** -> Shut Down in Hyper-V Manager. Your Linux VHD is now ready to be uploaded to Azure.
103+
104+
10. Click **Action** -> Shut Down in Hyper-V Manager. Your Linux VHD is now ready to be uploaded to Azure.
91105

92106
## Next steps
93107
You're now ready to use your Debian 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).

0 commit comments

Comments
 (0)