---
title: "Deploying NIOS-X Servers in Azure Using a VHD Image"
canonical: "https://docs.infoblox.com/space/BloxOneInfrastructure/204670105/Deploying%20NIOS-X%20Servers%20in%20Azure%20Using%20a%20VHD%20Image"
format: markdown
---
> 📝 Deploy from a VHD image only when your Azure environment is locked down and cannot use the Marketplace. Otherwise, use the recommended Marketplace method. See [Deploying NIOS-X Servers from the Azure Marketplace](https://infoblox-docs.atlassian.net/wiki/spaces/BloxOneInfrastructure/pages/204800816).

<span style="color: #000000">Before deploying the NIOS-X server, ensure that you have fulfilled the prerequisites, as described in </span><span style="color: #000000">*[Microsoft Azure Deployment](https://docs.infoblox.com/space/BloxOneInfrastructure/204800676/Microsoft+Azure+Deployment#Prerequisite)*</span><span style="color: #000000">.</span>

<span style="color: #000000">To deploy a NIOS-X server in Microsoft Azure, complete the following:</span>

1. <span style="color: #000000">Set up a Microsoft Azure account and create a resource manager in Azure. For information, refer to the Microsoft Azure documentation.</span>
2. <span style="color: #000000">Download the </span><span style="color: #000000">*.vhd*</span><span style="color: #000000"> package from the Infoblox Portal. </span>
3. <span style="color: #000000">Upload the </span><span style="color: #000000">*.vhd*</span><span style="color: #000000"> package to your Azure storage account. </span>
4. Create an image from the uploaded *.vhd* package.
5. Optionally, if you want to enable accelerated networking, create a NIC with accelerated networking enabled.
6. <span style="color: #000000">Deploy the NIOS-X server from the image you created. </span>

> 📝 If you prefer deploying the NIOS-X server using the Azure CLI, ensure that you install the Azure CLI on Linux.

# <span style="color: #000000">Supported Azure VM Flavors </span>

|  |  |  |  |
| --- | --- | --- | --- |
| <span style="color: #000000">**Overall Disk **</span> | <span style="color: #000000">**# of vCPU**</span> | <span style="color: #000000">**Memory Allocation**</span> | <span style="color: #000000">**Azure Flavor **</span> |
| <span style="color: #000000">60 GB</span> | <span style="color: #000000"> 8</span> | <span style="color: #000000">16 GB</span> | <span style="color: #000000">Standard_F4s</span> |

# <span style="color: #000000">Downloading VHD Packages</span>

<span style="color: #000000">To download the </span><span style="color: #000000">*.vh*</span><span style="color: #000000">d package, complete the following:</span>

1. <span style="color: #000000">Log in to the Infoblox Portal.</span>
2. <span style="color: #000000">Go to </span>**System > Downloads**<span style="color: #000000">.</span>
3. Go to the **NIOS-X** section, click **NIOS-X Servers **drop-down and select **Download VHD**.

# <span style="color: #000000">Uploading VHD to Azure Storage Account</span>

<span style="color: #000000">After you have downloaded the Azure</span><span style="color: #000000">* .vhd*</span><span style="color: #000000"> package from the Infoblox Portal, you can upload the package to your Azure storage account using the Docker commands (if you have a Docker environment) or Azure commands.</span>

Before using the Docker or Azure commands, ensure that you have created a storage account. Refer to the *[Microsoft Azure Documentation](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal)* for detailed instructions. Record the `storage_account_name` and `storage_account_access_key` for use in the commands. You can find the access key under **Security + Networking** > **Access Keys** for the storage account.

## <span style="color: #000000">Using Docker Commands to Upload VHD</span>

<span style="color: #000000">In your Docker environment, enter the following commands:</span>

`docker run --rm -v <abs-path-to-the-dir-of-vhd>:/vhd -v $HOME/.azure:$HOME/.azure infoblox/azurevhdutils upload`  
`--localvhdpath /vhd/<your-local-fixed-size-vhd-name>.vhd --stgaccountname <storage_account_name> --stgaccountkey <storage_account_access_key>`  
`--containername <my_container_name> --blobname <my_image_name>.vhd`

## <span style="color: #000000">Using Azure Commands to Upload VHD</span>

<span style="color: #000000">To use the Azure commands, you need to first build the </span><span style="color: #000000">*Azure-vhd-utils*</span><span style="color: #000000"> binary from Git. The </span><span style="color: #000000">*Azure-vhd-utils*</span><span style="color: #000000"> binary can be built from the public Git repo at </span><span style="color: #000000">*[https://github.com/microsoft/azure-vhd-utils](https://github.com/microsoft/azure-vhd-utils)*</span><span style="color: #000000">*.*</span>

> ⚠️ ### Note
> ⚠️ 
> ⚠️ <span style="color: #000000">Azure only supports disks with a fixed size format; if you use </span><span style="color: #000000">*azure-vhd-utils*</span><span style="color: #000000"> to perform the upload, it will convert the image to a fixed size format.</span>

<span style="color: #000000">To build the </span><span style="color: #000000">*Azure-vhd-utils*</span><span style="color: #000000"> binary, complete the following: </span>

1. <span style="color: #000000">Run the </span>`mkdir ~/tmp`<span style="color: #000000"> command to make a temporary directory.</span>
2. <span style="color: #000000">Run the </span>`cp -r ~/upload/src/`<span style="color: #000000">[github.com/Microsoft/azure-vhd-utils](http://github.com/Microsoft/azure-vhd-utils)</span>` ~/tmp`<span style="color: #000000"> command to copy </span><span style="color: #000000">*azure-vhd-utils*</span><span style="color: #000000"> to the temporary directory.</span>
3. <span style="color: #000000">Run the </span>`cd ~/tmp/azure-vhd-utils`<span style="color: #000000"> command.</span>
4. <span style="color: #000000">Run the </span>`make`<span style="color: #000000"> command to install </span><span style="color: #000000">*azure-vhd-utils*</span><span style="color: #000000">.</span>  
<span style="color: #000000">If the command displays the </span><span style="color: #000000">**if exec: "gcc": executable file not found in $PATH **</span><span style="color: #000000">error message, run the </span>`export CGO_ENABLED="0"`<span style="color: #000000"> command and then run the </span>`make`<span style="color: #000000"> command again.</span>
5. <span style="color: #000000">Run the </span>`sudo cp azure-vhd-utils /usr/bin/`<span style="color: #000000"> command.</span>

<span style="color: #000000">After you have built the </span><span style="color: #000000">*Azure-vhd-utils*</span><span style="color: #000000"> binary, run the following command to upload the </span><span style="color: #000000">*.vhd*</span><span style="color: #000000"> file to Azure using the following format:</span>

`azure-vhd-utils upload --localvhdpath <local_path> --stgaccountname storage_account_name> --stgaccountkey <storage_account_access_key>`  
`--containername <my_container_name> --blobname <my_image_name>.vhd`

# <span style="color: #000000">Creating an Image from the Uploaded VHD</span>

<span style="color: #000000">After you have successfully uploaded the </span><span style="color: #000000">*.vhd*</span><span style="color: #000000"> file to the Azure storage account, you can create an image in Azure using one of the following methods:</span>

- <span style="color: #000000">Microsoft Azure CLI </span>
- <span style="color: #000000">Microsoft Azure Portal</span>

## <span style="color: #000000">Using Azure CLI to Create an Image</span>  


<span style="color: #000000">To create an image using the Azure CLI, complete the following:</span>

1. <span style="color: #000000">Sign in to the Azure CLI using your account credentials.</span>
2. Create an image using the uploaded VHD from the storage account.  
For Gen 1:  
`az image create -g "<resource_group_name>" -n <my_image_name>.vhd --os-type Linux --source <vhd_path>`  
For Gen 2:  
`az image create -g "<resource_group_name>" -n <my_image_name> --os-type Linux --hyper-v-generation V2 --source <vhd_path>`

Optionally, if you want to enable accelerate networking, create a NIC using the following command:

`az network nic create --resource-group "<resource_group_name>" --name <my_accelerated_net_nic_name> --location <region> --accelerated-networking true --vnet-name <vnet_name> --subnet <snet_name> --network-security-group <nsg_name>`

> 📝 You must use the Azure CLI to create a NIC for accelerated networking. You cannot do so through the Azure Portal.

Optionally, if you want to enable dualstack networking, see [https://infoblox-docs.atlassian.net/wiki/spaces/BloxOneInfrastructure/pages/2123792420](https://infoblox-docs.atlassian.net/wiki/spaces/BloxOneInfrastructure/pages/2123792420).

## <span style="color: #000000">Using Azure Portal to Create an Image</span>

<span style="color: #000000">To create an image using the Azure Portal, complete the following:</span>

1. <span style="color: #000000">Log in to your Azure Portal.</span>
2. <span style="color: #000000">Go to </span><span style="color: #000000">**Images**</span><span style="color: #000000">, and click </span><span style="color: #000000">**Create**</span><span style="color: #000000"> to create an image from the </span><span style="color: #000000">*.vh*</span><span style="color: #000000">d package in the storage account.</span>
3. <span style="color: #000000">Enter all the relevant fields. Select either Gen 1 or Gen 2 VM generation. In the </span><span style="color: #000000">**Storage blob**</span><span style="color: #000000"> field, ensure that you navigate to and locate the </span><span style="color: #000000">*.vhd*</span><span style="color: #000000"> file you uploaded to the storage account.</span>
4. <span style="color: #000000">Click </span><span style="color: #000000">**Review + Create**</span><span style="color: #000000"> to review the image before you create it.</span>  
  
> Macro (inline-media-image)

# Deploying NIOS-X Server (VM) from the Image

After you have created an image, you can deploy the NIOS-X server using one of the following methods:

- Microsoft Azure CLI
- Microsoft Azure Portal

> 📝 If you have enabled accelerate networking, you must use the Azure CLI to deploy the NIOS-X server.

## Using the Azure CLI to Deploy the NIOS-X Server

1. Sign in to the Azure CLI using your account credentials.
2. Run the following command to deploy the NIOS-X server:

`az vm create --resource-group "<resource_group_name>" --name <<my_nios_x_vm_name> --nics <my_accelerated_net_nic_name> --location <region> --image <my_image_name> --admin-username azureuser --public-ip-address "" --custom-data userdata --size Standard_F4s`

## Using the Azure Portal to Deploy the NIOS-X Server

1. Log in to your Azure Portal.
2. Create a virtual machine using the image you created. In the **Size** field, ensure that you select the supported flavor, which is **Standard_F4S**.
3. In the **Custom data** field, ensure that you add the parameters that are specific to your NIOS-X server. You can download a YML file and customize your user data file. You can then copy the information and paste it here. For information on how to use the *userdata* file, see *[YML and JSON Templates](https://infoblox-docs.atlassian.net/wiki/spaces/BloxOneThreatDefense/pages/35408412)*.  
Note that when you enter the following schema in the **Custom data** field, ensure that you add a space before the keys you want to include for host_setup. In this case, you must include a space before **jointoken**, and then enter the join token value you obtained from the Infoblox Portal. For information about how to obtain a join token, see *[Creating Join Tokens](https://infoblox-docs.atlassian.net/wiki/spaces/BloxOneInfrastructure/pages/87229997)*.`  `
4. Optionally, you can resize the disk size above 64 GB. In the **Disk** tab of the Azure Portal, select the desired disk size from the **OS disk size** drop-down list.

> ⚠️ When resizing the disk, use the disk resize `user-data` file from <u>*[Appendix B: YAML and JSON Templates](https://docs.infoblox.com/space/BloxOneThreatDefense/35408412)*</u>. Skipping any of the specified values may prevent the disk from expanding, so the server cannot use the additional space.

![A screenshot of Microsoft Azure Home, blxone-2.6b, Create a virtual machine, Disks tab. OS disk size is highlighted and shows a dropdown list of available sizes.](media://d3d2d687-ef38-446c-9af5-0c66d1ad5ff9)

5. Click **Review + Create** to launch the NIOS-X server.
6. To check the current status of the NIOS-X server, you can go to **Network > Services & Servers > Servers** in the Infoblox Portal. For more information about the server status, see *[Viewing Server Status](https://infoblox-docs.atlassian.net/wiki/pages/createpage.action?spaceKey=BloxOneInfrastructure&title=Viewing%20Host%20Information)*.

> ⚠️ **Note**
> ⚠️ 
> ⚠️ You cannot use the IP Interface Settings In Infoblox Portal to modify IP configurations for the NIOS-X server in Azure. Instead, use the options provided in the Azure Cloud Portal to change IP configurations for the NIOS-X server. Once an Azure host is deployed, additional interfaces cannot be added. All required interfaces must be configured during the initial deployment. If interfaces are initially added through the Azure Portal, they will persist in the Infoblox Portal. Even if they are later deleted from the Azure Portal, they will still be visible in the Infoblox Portal. However, this does not affect the functionality of other interfaces.