Skip to content

Commit cb625f0

Browse files
more sudo fixes and reordering steps
1 parent fa3186a commit cb625f0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
142142
* Use a cloud-init directive baked into the image that will do this every time the VM is created:
143143

144144
```console
145+
sudo -i
145146
echo 'DefaultEnvironment="CLOUD_CFG=/etc/cloud/cloud.cfg.d/00-azure-swap.cfg"' >> /etc/systemd/system.conf
146147
cat > /etc/cloud/cloud.cfg.d/00-azure-swap.cfg << EOF
147148
#cloud-config
@@ -160,6 +161,7 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
160161
- ["ephemeral0.1", "/mnt"]
161162
- ["ephemeral0.2", "none", "swap", "sw,nofail,x-systemd.requires=cloud-init.service,x-systemd.device-timeout=2", "0", "0"]
162163
EOF
164+
exit
163165
```
164166

165167
15. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
@@ -263,18 +265,18 @@ As an alternative to building your own VHD, SUSE also publishes BYOS (Bring Your
263265
ResourceDisk.SwapSizeMB=2048 ## NOTE: set this to whatever you need it to be.
264266
```
265267

266-
11. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
268+
11. Ensure the Azure Linux Agent runs at startup:
267269

268270
```console
269-
sudo waagent -force -deprovision
270-
export HISTSIZE=0
271-
logout
271+
sudo systemctl enable waagent.service
272272
```
273273

274-
12. Ensure the Azure Linux Agent runs at startup:
274+
12. Run the following commands to deprovision the virtual machine and prepare it for provisioning on Azure:
275275

276276
```console
277-
sudo systemctl enable waagent.service
277+
sudo waagent -force -deprovision
278+
export HISTSIZE=0
279+
logout
278280
```
279281

280282
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).

0 commit comments

Comments
 (0)