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
- Adding a few notes about the deprovision process
- Updated the block code from ```console to `` bash
- Updated the block code from ```text`` to output
8. Edit the "/etc/default/grub" file to ensure console logs are sent to the serial port by adding the following line:
@@ -96,7 +93,7 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
96
93
97
94
Next, apply this change by running the following command:
98
95
99
-
```console
96
+
```bash
100
97
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
101
98
```
102
99
@@ -106,11 +103,10 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
106
103
107
104
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:
11. It's recommended to edit the "/etc/sysconfig/network/dhcp" file and change the `DHCLIENT_SET_HOSTNAME` parameter to the following:
@@ -121,7 +117,7 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
121
117
122
118
12. In the "/etc/sudoers" file, comment out or remove the following lines if they exist:
123
119
124
-
```text
120
+
```output
125
121
Defaults targetpw # ask for the password of the target user i.e. root
126
122
ALL ALL=(ALL) ALL # WARNING! Only use this setting together with 'Defaults targetpw'!
127
123
```
@@ -134,11 +130,10 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
134
130
135
131
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:
136
132
137
-
```console
133
+
```bash
138
134
sudo -i
139
-
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
140
-
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
141
-
exit
135
+
sudo sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
136
+
sudo sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
142
137
```
143
138
144
139
For more information on the waagent.conf configuration options, see the [Linux agent configuration](../extensions/agent-linux.md#configuration) documentation.
@@ -147,9 +142,9 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
147
142
* Pass this configuration in as a cloud-init config every time you create a VM.
148
143
* 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. Blocklisting or removing it will cause a provisioning failure. **(_Cloud-init >= 21.2 removes the udf requirement. Please read top of document for more detail)**
174
168
175
169
176
170
15. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
177
171
178
-
```console
172
+
> [!NOTE]
173
+
> If you're migrating a specific virtual machine and don't wish to create a generalized image, skip the deprovision step
174
+
175
+
```bash
179
176
sudo rm -f /var/log/waagent.log
180
177
sudo cloud-init clean
181
-
182
-
waagent -force -deprovision+user
183
-
rm -f ~/.bash_history
184
-
185
-
export HISTSIZE=0
186
-
187
-
logout
188
-
```
178
+
sudo waagent -force -deprovision+user
179
+
sudo rm -f ~/.bash_history
180
+
sudo export HISTSIZE=0
181
+
```
189
182
190
183
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).
191
184
@@ -205,33 +198,33 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
205
198
206
199
If the command returns "No repositories defined..."then use the following commands to add these repos:
207
200
208
-
```console
201
+
```bash
209
202
sudo zypper ar -f http://download.opensuse.org/repositories/Cloud:Tools/openSUSE_15.2 Cloud:Tools_15.2
210
203
sudo zypper ar -f https://download.opensuse.org/distribution/15.2/repo/oss openSUSE_15.2_OSS
211
204
sudo zypper ar -f http://download.opensuse.org/update/15.2 openSUSE_15.2_Updates
212
205
```
213
206
214
207
You can then verify the repositories have been added by running the command'`zypper lr`' again. If one of the relevant update repositories isn't enabled, enable it with following command:
215
208
216
-
```console
209
+
```bash
217
210
sudo zypper mr -e [NUMBER OF REPOSITORY]
218
211
```
219
212
220
213
4. Update the kernel to the latest available version:
221
214
222
-
```console
215
+
```bash
223
216
sudo zypper up kernel-default
224
217
```
225
218
226
219
Or to update the operating system with all the latest patches:
227
220
228
-
```console
221
+
```bash
229
222
sudo zypper update
230
223
```
231
224
232
225
5. Install the Azure Linux Agent.
233
226
234
-
```console
227
+
```bash
235
228
sudo zypper install WALinuxAgent
236
229
```
237
230
@@ -255,7 +248,7 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
255
248
256
249
8. **Important:** In the "/etc/sudoers" file, comment out or remove the following lines if they exist:
257
250
258
-
```text
251
+
```output
259
252
Defaults targetpw # ask for the password of the target user i.e. root
260
253
ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
261
254
```
@@ -275,29 +268,27 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
275
268
276
269
11. Ensure the Azure Linux Agent runs at startup:
277
270
278
-
```console
271
+
```bash
279
272
sudo systemctl enable waagent.service
280
273
```
281
274
282
275
12. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
283
276
284
-
```console
285
-
rm -f ~/.bash_history # Remove current user history
286
-
277
+
> [!NOTE]
278
+
> If you're migrating a specific virtual machine and don't wish to create a generalized image, skip the deprovision step
279
+
280
+
```bash
281
+
sudo rm -f ~/.bash_history # Remove current user history
287
282
sudo -i
288
-
rm -rf /var/lib/waagent/
289
-
rm -f /var/log/waagent.log
290
-
291
-
waagent -force -deprovision+user
292
-
rm -f ~/.bash_history # Remove root user history
293
-
294
-
export HISTSIZE=0
295
-
296
-
logout
297
-
```
283
+
sudo rm -rf /var/lib/waagent/
284
+
sudo rm -f /var/log/waagent.log
285
+
sudo waagent -force -deprovision+user
286
+
sudo rm -f ~/.bash_history # Remove root user history
287
+
sudo export HISTSIZE=0
288
+
```
298
289
299
290
13. 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).
300
291
301
292
## Next steps
302
293
303
-
You're now ready to use your SUSE 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).
294
+
You're now ready to use your SUSE 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).
0 commit comments