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
@@ -28,13 +28,12 @@ This article assumes that you have already installed a SUSE or openSUSE Leap Lin
28
28
* The VHDX format isn't supported in Azure, only **fixed VHD**. You can convert the disk to VHD format using Hyper-V Manager or the convert-vhd cmdlet.
* The `vfat` kernel module must be enabled in the kernel
31
-
* When installing the Linux operating system, use standard partitions rather than logical volume manager (LVM) managed partitions, which is often the default for many installations. Using standard partitions 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.
32
31
* Don't configure a swap partition on the OS disk. The Linux agent can be configured to create a swap file on the temporary resource disk. More information about configuring swap space can be found in the steps below.
33
32
* All VHDs on Azure must have a virtual size aligned to 1 MB. When converting from a raw disk to VHD, you must ensure that the raw disk size is a multiple of 1 MB before conversion. See [Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes) for more information.
34
33
35
34
36
35
> [!NOTE]
37
-
> **_Cloud-init >= 21.2 removes the udf requirement_**. However, without the udf module enabled, the cdrom won't mount during provisioning, preventing custom data from being applied. A workaround for this is to apply custom data using user data. However, unlike custom data, user data isn't encrypted. https://cloudinit.readthedocs.io/en/latest/topics/format.html
36
+
> **(_Cloud-init >= 21.2 removes the udf requirement._)** however without the udf module enabled the cdrom won't mount during provisioning, preventing custom data from being applied. A workaround for this is to apply custom data. However, unlike custom data user data, isn't encrypted. https://cloudinit.readthedocs.io/en/latest/topics/format.html
38
37
39
38
40
39
## Use SUSE Studio
@@ -45,9 +44,47 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
45
44
46
45
## Prepare SUSE Linux Enterprise Server for Azure
47
46
48
-
1. In the center pane of Hyper-V Manager, select the virtual machine.
49
-
2. Click **Connect** to open the window for the virtual machine.
47
+
1. Configure the Azure/Hyper-v modules if required.
48
+
49
+
If your software hypervisor is not Hyper-V, other modules need to be added into the initramfs to successfully boot in Azure
50
+
51
+
Edit the "/etc/dracut.conf" file and add the following line to the file:
52
+
53
+
```config
54
+
add_drivers+=" hv_vmbus hv_netvsc hv_storvsc "
55
+
```
56
+
57
+
Once the configuration file has been saved, run the following command to update the intramfs of the host:
58
+
59
+
```bash
60
+
sudo dracut --verbose --force
61
+
```
62
+
63
+
2. Setup the Serial Console.
64
+
65
+
In order to successfully work with the serial console, it's required to set up several variables in the "/etc/defaults/grub" file.
66
+
67
+
```config
68
+
# Add console=ttyS0 and earlyprintk=ttS0 to the variable
9. Previously, the Azure Linux Agent was used to 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 step is now handled by cloud-init, you **must not** use the Linux Agent to format the resource disk or create the swap file. Use these commands to modify `/etc/waagent.conf` appropriately:
92
173
93
-
Next, apply this change by running the following command:
94
174
95
175
```bash
96
-
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
176
+
sudo sed -i 's/Provisioning.UseCloudInit=n/Provisioning.UseCloudInit=auto/g' /etc/waagent.conf
177
+
sudo sed -i 's/Provisioning.Enabled=y/Provisioning.Enabled=n/g' /etc/waagent.conf
178
+
sudo sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
179
+
sudo sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
97
180
```
98
181
99
-
This configuration will ensure all console messages are sent to the first serial port, which can assist Azure support with debugging issues.
182
+
> [!NOTE]
183
+
> Make sure the **'udf'** module is enabled. Removing/disabling them will cause a provisioning/boot failure. **(_Cloud-init >= 21.2 removes the udf requirement. Please read top of document for more detail)**
100
184
101
-
9. Ensure the "/etc/fstab" file references the disk using its UUID (by-uuid)
185
+
10. Ensure the "/etc/fstab" file references the disk using its UUID (by-uuid)
102
186
103
-
10. 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:
187
+
11. Remove udev rules and network adapter configuration files to avoid generating static rules for the Ethernet interface(s). These rules can cause problems when cloning a virtual machine in Microsoft Azure or Hyper-V:
11. It's recommended to edit the "/etc/sysconfig/network/dhcp" file and change the `DHCLIENT_SET_HOSTNAME` parameter to the following:
195
+
12. It's recommended to edit the "/etc/sysconfig/network/dhcp" file and change the `DHCLIENT_SET_HOSTNAME` parameter to the following:
111
196
112
197
```config
113
198
DHCLIENT_SET_HOSTNAME="no"
114
199
```
115
200
116
-
12. In the "/etc/sudoers" file, comment out or remove the following lines if they exist:
201
+
13. In the "/etc/sudoers" file, comment out or remove the following lines if they exist:
117
202
118
203
```output
119
204
Defaults targetpw # ask for the password of the target user i.e. root
120
205
ALL ALL=(ALL) ALL # WARNING! Only use this setting together with 'Defaults targetpw'!
121
206
```
122
207
123
-
13. Ensure that the SSH server is installed and configured to start at boot time.
124
-
125
-
14. Swap configuration
126
208
127
-
Don't create swap space on the operating system disk.
209
+
14. Ensure that the SSH server is installed and configured to start at boot time.
128
210
211
+
```bash
212
+
sudo systemctl enable sshd
213
+
```
129
214
130
-
Previously, the Azure Linux Agent was used to 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 step is now handled by cloud-init, you **must not** use the Linux Agent to format the resource disk or create the swap file. Use these commands to modify `/etc/waagent.conf` appropriately:
215
+
15. Make sure to clean cloud-init stage;
131
216
132
217
```bash
133
-
sudo sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
134
-
sudo sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
218
+
sudo cloud-init clean --seed --logs
135
219
```
136
220
137
-
For more information on the waagent.conf configuration options, see the [Linux agent configuration](../extensions/agent-linux.md#configuration) documentation.
138
-
139
-
If you want to mount, format, and create a swap partition you can either:
140
-
* Pass this configuration in as a cloud-init config every time you create a VM.
141
-
* Use a cloud-init directive baked into the image that configures swap space every time the VM is created:
> Make sure the **'udf'** module is enabled. Removing/disabling them will cause a provisioning/boot failure. **(_Cloud-init >= 21.2 removes the udf requirement. Please read top of document for more detail)**
221
+
16. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
165
222
223
+
>[!NOTE]
224
+
> If you're migrating a specific virtual machine and don't wish to create a generalized image, skip the deprovision step
166
225
167
-
15. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
168
-
169
-
> [!NOTE]
170
-
> If you're migrating a specific virtual machine and don't wish to create a generalized image, skip the deprovision step.
171
-
172
-
```bash
226
+
```bash
173
227
sudo rm -f /var/log/waagent.log
174
-
sudo cloud-init clean
175
228
sudo waagent -force -deprovision+user
176
-
sudo rm -f ~/.bash_history
177
229
sudo export HISTSIZE=0
178
-
```
230
+
sudo rm -f ~/.bash_history
231
+
```
179
232
180
-
16. 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).
181
-
182
233
---
183
234
184
235
## Prepare openSUSE 15.2+
@@ -225,13 +276,13 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
225
276
sudo zypper install WALinuxAgent
226
277
```
227
278
228
-
6. Modify the kernel boot line in your grub configuration to include additional kernel parameters for Azure. To do this, open "/boot/grub/menu.lst" in a text editor and ensure that the default kernel includes the following parameters:
279
+
6. Modify the kernel boot line in your grub configuration to include other kernel parameters for Azure. To do this, open "/boot/grub/menu.lst" in a text editor and ensure that the default kernel includes the following parameters:
229
280
230
281
```config-grub
231
282
console=ttyS0 earlyprintk=ttyS0
232
283
```
233
284
234
-
This option will ensure all console messages are sent to the first serial port, which can assist Azure support with debugging issues. In addition, remove the following parameters from the kernel boot line if they exist:
285
+
This option ensures all console messages are sent to the first serial port, which can assist Azure support with debugging issues. In addition, remove the following parameters from the kernel boot line if they exist:
235
286
236
287
```config-grub
237
288
libata.atapi_enabled=0 reserve=0x1f0,0x8
@@ -253,13 +304,13 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
253
304
9. Ensure that the SSH server is installed and configured to start at boot time.
254
305
10. Don't create swap space on the OS disk.
255
306
256
-
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 the "/etc/waagent.conf" as follows:
307
+
The Azure Linux Agent can automatically configure swap space using the local resource disk that is attached to the VM after provisioning on Azure. The local resource disk is a *temporary* disk and will be emptied when the VM is deprovisioned. After installing the Azure Linux Agent (see previous step), modify the following parameters in the "/etc/waagent.conf" as follows:
257
308
258
309
```config-conf
259
-
ResourceDisk.Format=y
310
+
ResourceDisk.Format=n
260
311
ResourceDisk.Filesystem=ext4
261
312
ResourceDisk.MountPoint=/mnt/resource
262
-
ResourceDisk.EnableSwap=y
313
+
ResourceDisk.EnableSwap=n
263
314
ResourceDisk.SwapSizeMB=2048 ## NOTE: set the size to whatever you need it to be.
264
315
```
265
316
@@ -276,6 +327,7 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
276
327
277
328
```bash
278
329
sudo rm -f ~/.bash_history # Remove current user history
0 commit comments