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/oracle-create-upload-vhd.md
+96-85Lines changed: 96 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ ms.date: 11/09/2021
11
11
ms.author: srijangupta
12
12
ms.reviewer: mattmcinnes
13
13
---
14
+
14
15
# Prepare an Oracle Linux virtual machine for Azure
15
16
16
17
**Applies to:**:heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
@@ -29,15 +30,19 @@ This article assumes that you have already installed an Oracle Linux operating s
29
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.
30
31
* Make sure that the `Addons` repository is enabled. Edit the file `/etc/yum.repos.d/public-yum-ol6.repo`(Oracle Linux 6) or `/etc/yum.repos.d/public-yum-ol7.repo`(Oracle Linux 7), and change the line `enabled=0` to `enabled=1` under **[ol6_addons]** or **[ol7_addons]** in this file.
31
32
32
-
## Oracle Linux 6.4 and later
33
+
## Oracle Linux 6.X
34
+
35
+
> [!IMPORTANT]
36
+
> Please note that Oracle Linux has reached its end of life and is [no longer supported by Oracle](https://www.oracle.com/a/ocom/docs/elsp-lifetime-069338.pdf). This means that no new updates or patches will be provided, and technical support may not be available. It is recommended that users migrate to a newer and supported version of Linux to ensure security and stability. We cannot be held responsible for any issues that may arise from continuing to use Oracle Linux after its end of life.
37
+
33
38
You must complete specific configuration steps in the operating system for the virtual machine to run in Azure.
34
39
35
40
1. In the center pane of Hyper-V Manager, select the virtual machine.
36
41
2. Click **Connect** to open the window for the virtual machine.
37
42
3. Uninstall NetworkManager by running the following command:
38
43
39
-
```console
40
-
# sudo rpm -e --nodeps NetworkManager
44
+
```bash
45
+
sudo rpm -e --nodeps NetworkManager
41
46
```
42
47
43
48
**Note:** If the package is not already installed, this command will fail with an error message. This is expected.
@@ -62,21 +67,21 @@ You must complete specific configuration steps in the operating system for the v
62
67
63
68
6. Modify udev rules to avoid generating static rules forthe Ethernet interface(s). These rules can cause problems when cloning a virtual machinein Microsoft Azure or Hyper-V:
7. Ensure the network service will start at boot time by running the following command:
71
76
72
-
```console
73
-
# chkconfig network on
77
+
```bash
78
+
sudo chkconfig network on
74
79
```
75
80
76
81
8. Install python-pyasn1 by running the following command:
77
82
78
-
```console
79
-
# sudo yum install python-pyasn1
83
+
```bash
84
+
sudo yum install python-pyasn1
80
85
```
81
86
82
87
9. Modify the kernel boot line in your grub configuration to include additional kernel parameters forAzure. To do this open "/boot/grub/menu.lst"in a text editor and ensure that the kernel includes the following parameters:
@@ -96,14 +101,18 @@ You must complete specific configuration steps in the operating system for the v
96
101
Graphical and quiet boot are not useful in a cloud environment where we want all the logs to be sent to the serial port.
97
102
98
103
The `crashkernel` option may be left configured if desired, but note that this parameter will reduce the amount of available memory in the VM by 128MB or more, which may be problematic on the smaller VM sizes.
104
+
99
105
10. Ensure that the SSH server is installed and configured to start at boot time. This is usually the default.
100
-
11. Install the Azure Linux Agent by running the following command. The latest version is 2.0.15.
106
+
1. 11. Install the Azure Linux Agent by running the following command. The latest version is 2.0.15.
101
107
102
-
```console
103
-
# sudo yum install WALinuxAgent
108
+
109
+
110
+
111
+
```bash
112
+
sudo yum install WALinuxAgent
104
113
```
105
114
106
-
Note that installing the WALinuxAgent package will remove the NetworkManager and NetworkManager-gnome packages if they were not already removed as described in step 2.
115
+
Note that installing the WALinuxAgent package will remove the NetworkManager and NetworkManager-gnome packages if they were not already removed as described in step 2.
107
116
12. Do not create swap space on the OS disk.
108
117
109
118
The Azure Linux Agent can automatically configure swap space using the local resource disk that is attached to the VM after provisioning on Azure. Note that the local resource disk is a *temporary* disk, and might be emptied when the VM is deprovisioned. After installing the Azure Linux Agent (see previous step), modify the following parameters in /etc/waagent.conf appropriately:
@@ -118,10 +127,10 @@ You must complete specific configuration steps in the operating system for the v
118
127
119
128
13. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
120
129
121
-
```console
122
-
# sudo waagent -force -deprovision
123
-
# export HISTSIZE=0
124
-
# logout
130
+
```bash
131
+
sudo waagent -force -deprovision
132
+
sudoexport HISTSIZE=0
133
+
sudologout
125
134
```
126
135
127
136
14. Click **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).
@@ -162,27 +171,27 @@ Preparing an Oracle Linux 7 virtual machine for Azure is very similar to Oracle
162
171
163
172
5. Modify udev rules to avoid generating static rules forthe Ethernet interface(s). These rules can cause problems when cloning a virtual machinein Microsoft Azure or Hyper-V:
6. Ensure the network service will start at boot time by running the following command:
170
179
171
-
```console
172
-
# sudo chkconfig network on
180
+
```bash
181
+
sudo chkconfig network on
173
182
```
174
183
175
184
7. Install the python-pyasn1 package by running the following command:
176
185
177
-
```console
178
-
# sudo yum install python-pyasn1
186
+
```bash
187
+
sudo yum install python-pyasn1
179
188
```
180
189
181
190
8. Run the following command to clear the current yum metadata and install any updates:
182
191
183
-
```console
184
-
# sudo yum clean all
185
-
# sudo yum -y update
192
+
```bash
193
+
sudo yum clean all
194
+
sudo yum -y update
186
195
```
187
196
188
197
9. Modify the kernel boot line in your grub configuration to include additional kernel parameters forAzure. To do this open "/etc/default/grub"in a text editor and edit the `GRUB_CMDLINE_LINUX` parameter, for example:
@@ -200,10 +209,10 @@ Preparing an Oracle Linux 7 virtual machine for Azure is very similar to Oracle
200
209
Graphical and quiet boot are not useful in a cloud environment where we want all the logs to be sent to the serial port.
201
210
202
211
The `crashkernel` option may be left configured if desired, but note that this parameter will reduce the amount of available memory in the VM by 128MB or more, which may be problematic on the smaller VM sizes.
203
-
10. Once you are done editing "/etc/default/grub" per above, run the following command to rebuild the grub configuration:
204
212
205
-
```console
206
-
# sudo grub2-mkconfig -o /boot/grub2/grub.cfg
213
+
10. Once you are done editing "/etc/default/grub" per above, run the following command to rebuild the grub configuration:
214
+
1. ```bash
215
+
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
207
216
```
208
217
209
218
11. Ensure that the SSH server is installed and configured to start at boot time. This is usually the default.
@@ -216,28 +225,38 @@ Preparing an Oracle Linux 7 virtual machine for Azure is very similar to Oracle
echo Removing swapfile - RHEL uses a swapfile by default
243
262
swapoff /mnt/resource/swapfile
@@ -252,61 +271,53 @@ Preparing an Oracle Linux 7 virtual machine for Azure is very similar to Oracle
252
271
# there without needing to look on the console.
253
272
output: {all: '| tee -a /var/log/cloud-init-output.log'}
254
273
EOF
255
-
256
274
```
257
275
258
-
14. Swap configuration
259
-
Do not create swap space on the operating system disk.
276
+
15. Swap configuration. Do not create swap space on the operating system disk.
260
277
261
-
Previously, the Azure Linux Agent was used automatically configure swap space by using the local resource disk that is attached to the virtual machine after the virtual machine is provisioned on Azure. However this is now handled by cloud-init, you **must not** use the Linux Agent to format the resource disk create the swap file, modify the following parameters in `/etc/waagent.conf` appropriately:
278
+
Previously, the Azure Linux Agent was used automatically configure swap space by using the local resource disk that is attached to the virtual machine after the virtual machine is provisioned on Azure. However this is now handled by cloud-init, you **must not** use the Linux Agent to format the resource disk create the swap file, modify the following parameters in`/etc/waagent.conf` appropriately:
262
279
263
-
```console
264
-
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
265
-
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
280
+
```bash
281
+
sudo sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
282
+
sudo sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
266
283
```
267
284
268
-
If you want mount, format and create swap you can either:
269
-
* Pass this in as a cloud-init config every time you create a VM
270
-
* Use a cloud-init directive baked into the image that will do this every time the VM is created:
0 commit comments