Skip to content

Commit 45d1041

Browse files
authored
Merge pull request #277947 from paulth1/linux-article-batch2
[AQ] edit pass: linux-article-batch2
2 parents 940b112 + 78acb87 commit 45d1041

File tree

2 files changed

+80
-64
lines changed

2 files changed

+80
-64
lines changed
Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Create and upload an OpenBSD image
3-
description: Learn how to create and upload a virtual hard disk (VHD) that contains the OpenBSD operating system to create an Azure virtual machine through Azure CLI
3+
description: Learn how to create and upload a virtual hard disk (VHD) that contains the OpenBSD operating system to create an Azure virtual machine through the Azure CLI.
44
author: gbowerman
55
ms.service: virtual-machines
66
ms.custom: devx-track-azurecli, linux-related-content
@@ -10,46 +10,47 @@ ms.date: 05/24/2017
1010
ms.author: guybo
1111
ms.reviewer: mattmcinnes
1212
---
13-
# Create and Upload an OpenBSD disk image to Azure
1413

15-
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
14+
# Create and upload an OpenBSD disk image to Azure
1615

17-
This article shows you how to create and upload a virtual hard disk (VHD) that contains the OpenBSD operating system. After you upload it, you can use it as your own image to create a virtual machine (VM) in Azure through Azure CLI.
16+
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Flexible scale sets
1817

18+
This article shows you how to create and upload a virtual hard disk (VHD) that contains the OpenBSD operating system. After you upload it, you can use it as your own image to create a virtual machine (VM) in Azure through the Azure CLI.
1919

2020
## Prerequisites
21+
2122
This article assumes that you have the following items:
2223

23-
* **An Azure subscription** - If you don't have an account, you can create one in just a couple of minutes. If you have an MSDN subscription, see [Monthly Azure credit for Visual Studio subscribers](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/). Otherwise, learn how to [create a free trial account](https://azure.microsoft.com/pricing/free-trial/).
24-
* **Azure CLI** - Make sure you have the latest [Azure CLI](/cli/azure/install-azure-cli) installed and logged in to your Azure account with [az login](/cli/azure/reference-index).
25-
* **OpenBSD operating system installed in a .vhd file** - A supported OpenBSD operating system ([6.6 version AMD64](https://ftp.openbsd.org/pub/OpenBSD/7.2/amd64/)) must be installed to a virtual hard disk. Multiple tools exist to create .vhd files. For example, you can use a virtualization solution such as Hyper-V to create the .vhd file and install the operating system. For instructions about how to install and use Hyper-V, see [Install Hyper-V and create a virtual machine](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh846766(v=ws.11)).
24+
* **An Azure subscription**: If you don't have an account, you can create one in a couple of minutes. If you have an MSDN subscription, see [Monthly Azure credit for Visual Studio subscribers](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/). Otherwise, learn how to [create a free trial account](https://azure.microsoft.com/pricing/free-trial/).
25+
* **Azure CLI**: Make sure you have the latest [Azure CLI](/cli/azure/install-azure-cli) installed and logged in to your Azure account with [az login](/cli/azure/reference-index).
26+
* **OpenBSD operating system installed in a .vhd file**: A supported OpenBSD operating system ([6.6 version AMD64](https://ftp.openbsd.org/pub/OpenBSD/7.2/amd64/)) must be installed to a VHD. Multiple tools exist to create .vhd files. For example, you can use a virtualization solution such as Hyper-V to create the .vhd file and install the operating system. For instructions about how to install and use Hyper-V, see [Install Hyper-V and create a VM](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh846766(v=ws.11)).
2627

28+
## Prepare an OpenBSD image for Azure
2729

28-
## Prepare OpenBSD image for Azure
2930
On the VM where you installed the OpenBSD operating system 6.1, which added Hyper-V support, complete the following procedures:
3031

31-
1. If DHCP is not enabled during installation, enable the service as follows:
32+
1. If DHCP isn't enabled during installation, enable the service:
3233

3334
```sh
3435
doas echo dhcp > /etc/hostname.hvn0
3536
```
3637

37-
2. Set up a serial console as follows:
38+
1. Set up a serial console:
3839

3940
```sh
4041
doas echo "stty com0 115200" >> /etc/boot.conf
4142
doas echo "set tty com0" >> /etc/boot.conf
4243
```
4344

44-
3. Configure Package installation as follows:
45+
1. Configure package installation:
4546

4647
```sh
4748
doas echo "https://ftp.openbsd.org/pub/OpenBSD" > /etc/installurl
4849
```
4950

50-
4. By default, the `root` user is disabled on virtual machines in Azure. Users can run commands with elevated privileges by using the `doas` command on OpenBSD VM. Doas is enabled by default.
51+
1. By default, the `root` user is disabled on VMs in Azure. Users can run commands with elevated privileges by using the `doas` command on OpenBSD VM. Doas is enabled by default.
5152

52-
5. Install and configure prerequisites for the Azure Agent as follows:
53+
1. Install and configure prerequisites for the Azure agent:
5354

5455
```sh
5556
doas pkg_add py-setuptools openssl git
@@ -59,7 +60,7 @@ On the VM where you installed the OpenBSD operating system 6.1, which added Hype
5960
doas ln -sf /usr/local/bin/pydoc2.7 /usr/local/bin/pydoc
6061
```
6162

62-
6. The latest release of the Azure agent can always be found on [GitHub](https://github.com/Azure/WALinuxAgent/releases). Install the agent as follows:
63+
1. You can find the latest release of the Azure agent on [GitHub](https://github.com/Azure/WALinuxAgent/releases). Install the agent:
6364

6465
```sh
6566
doas git clone https://github.com/Azure/WALinuxAgent
@@ -69,40 +70,42 @@ On the VM where you installed the OpenBSD operating system 6.1, which added Hype
6970
```
7071

7172
> [!IMPORTANT]
72-
> After you install Azure Agent, it's a good idea to verify that it's running as follows:
73+
> After you install the Azure agent, it's a good idea to verify that it's running:
7374
>
7475
> ```sh
7576
> doas ps auxw | grep waagent
7677
> root 79309 0.0 1.5 9184 15356 p1 S 4:11PM 0:00.46 python /usr/local/sbin/waagent -daemon (python2.7)
7778
> doas cat /var/log/waagent.log
7879
> ```
7980

80-
7. Deprovision the system to clean it and make it suitable for deprovisioning. The following command also deletes the last provisioned user account and the associated data:
81+
1. Deprovision the system to clean it and make it suitable for deprovisioning. The following command also deletes the last provisioned user account and the associated data:
8182

8283
```sh
8384
doas waagent -deprovision+user -force
8485
```
86+
8587
> [!NOTE]
86-
> If you are migrating a specific virtual machine and do not wish to create a generalized image, skip the deprovision step.
88+
> If you're migrating a specific VM and don't want to create a generalized image, skip the deprovision step.
8789

8890
Now you can shut down your VM.
8991

90-
9192
## Prepare the VHD
92-
The VHDX format is not supported in Azure, only **fixed VHD**. You can convert the disk to fixed VHD format using Hyper-V Manager or the PowerShell [convert-vhd](/powershell/module/hyper-v/convert-vhd) cmdlet. An example is as following.
93+
94+
The VHDX format isn't supported in Azure, only *fixed VHD*. You can convert the disk to fixed VHD format by using Hyper-V Manager or the PowerShell [convert-vhd](/powershell/module/hyper-v/convert-vhd) cmdlet. Here's an example:
9395

9496
```powershell
9597
Convert-VHD OpenBSD61.vhdx OpenBSD61.vhd -VHDType Fixed
9698
```
9799

98100
## Create storage resources and upload
99-
First, create a resource group with [az group create](/cli/azure/group). The following example creates a resource group named *myResourceGroup* in the *eastus* location:
101+
102+
First, create a resource group with [az group create](/cli/azure/group). The following example creates a resource group named `myResourceGroup` in the `eastus` location:
100103

101104
```azurecli
102105
az group create --name myResourceGroup --location eastus
103106
```
104107

105-
To upload your VHD, create a storage account with [az storage account create](/cli/azure/storage/account). Storage account names must be unique, so provide your own name. The following example creates a storage account named *mystorageaccount*:
108+
To upload your VHD, create a storage account with [az storage account create](/cli/azure/storage/account). Storage account names must be unique, so provide your own name. The following example creates a storage account named `mystorageaccount`:
106109

107110
```azurecli
108111
az storage account create --resource-group myResourceGroup \
@@ -111,7 +114,7 @@ az storage account create --resource-group myResourceGroup \
111114
--sku Premium_LRS
112115
```
113116

114-
To control access to the storage account, obtain the storage key with [az storage account keys list](/cli/azure/storage/account/keys) as follows:
117+
To control access to the storage account, obtain the storage key with the [az storage account keys list](/cli/azure/storage/account/keys):
115118

116119
```azurecli
117120
STORAGE_KEY=$(az storage account keys list \
@@ -129,7 +132,7 @@ az storage container create \
129132
--account-key ${STORAGE_KEY}
130133
```
131134

132-
Finally, upload your VHD with [az storage blob upload](/cli/azure/storage/blob) as follows:
135+
Finally, upload your VHD with [az storage blob upload](/cli/azure/storage/blob):
133136

134137
```azurecli
135138
az storage blob upload \
@@ -140,9 +143,9 @@ az storage blob upload \
140143
--account-key ${STORAGE_KEY}
141144
```
142145

146+
## Create a VM from your VHD
143147

144-
## Create VM from your VHD
145-
You can create a VM with a [sample script](/previous-versions/azure/virtual-machines/scripts/virtual-machines-linux-cli-sample-create-vm-vhd) or directly with [az vm create](/cli/azure/vm). To specify the OpenBSD VHD you uploaded, use the `--image` parameter as follows:
148+
You can create a VM with a [sample script](/previous-versions/azure/virtual-machines/scripts/virtual-machines-linux-cli-sample-create-vm-vhd) or directly with [az vm create](/cli/azure/vm). To specify the OpenBSD VHD you uploaded, use the `--image` parameter:
146149

147150
```azurecli
148151
az vm create \
@@ -154,7 +157,7 @@ az vm create \
154157
--ssh-key-value ~/.ssh/id_rsa.pub
155158
```
156159

157-
Obtain the IP address for your OpenBSD VM with [az vm list-ip-addresses](/cli/azure/vm) as follows:
160+
Obtain the IP address for your OpenBSD VM with [az vm list-ip-addresses](/cli/azure/vm):
158161

159162
```azurecli
160163
az vm list-ip-addresses --resource-group myResourceGroup --name myOpenBSD61
@@ -166,8 +169,7 @@ Now you can SSH to your OpenBSD VM as normal:
166169
ssh azureuser@<ip address>
167170
```
168171

172+
## Related content
169173

170-
## Next steps
171-
If you want to know more about Hyper-V support on OpenBSD6.1, read [OpenBSD 6.1](https://www.openbsd.org/61.html).
172-
173-
If you want to create a VM from managed disk, read [az disk](/cli/azure/disk).
174+
- To learn more about Hyper-V support on OpenBSD 6.1, read [OpenBSD 6.1](https://www.openbsd.org/61.html).
175+
- To create a VM from a managed disk, read [az disk](/cli/azure/disk).

0 commit comments

Comments
 (0)