Create a temporary virtual machine to host the disk

This topic describes how to create a Microsoft Azure virtual machine (VM) and use it to create a disk. You can use the Microsoft Azure Portal or the command line to create the VM.

Use the Microsoft Azure Portal

  1. Sign in to the Microsoft Azure Portal.
  2. Select All Services from the menu.
  3. Select Virtual Machines. Alternatively, select Virtual Machines from the favorites list.
  4. Click Add. The Create a virtual machine page appears.
  5. From the Resource group dropdown menu, select a resource group.
  6. Enter a name for the new VM in the Virtual machine name field.
  7. Select the region that contains the resource group.
  8. From the Image dropdown menu, select any available version of Ubuntu Server LTS.
  9. Enter Standard D2s V3 in the Size field.
  10. In the Administrator Account section, select Password for the Authentication Type, and then enter a username and password to apply to the VM.
  11. In the Inbound Port rules section, enter ssh(22) in the Select inbound ports field.
  12. Click Next: Disks.
  13. Click Create and attach a new disk.
  14. Click Change disk size and select 512gb.
  15. Click Ok.
  16. Click Next: Networking.
  17. Enter ssh(22) in the Select inbound ports field.
  18. Click Create and review and wait for the validation process to finish.
  19. Click Create.
  20. When the Deployment is Complete prompt appears, click Goto Resource. Examine the new VM and note its external IP address.

Use the command line

  1. Create a VM using the az vm create command with these options:

    az vm create --name <name> --resource-group <resource-group> --location <region> \ --image "ubuntults" --size "Standard_D2s_v3" --data-disk-sizes-gb 500 \ --authentication-type "password" --admin-username "okta" --admin-password "AlwaysOn@123"

    • <name>: The name of the image.
    • <region>: The region to hold the VM.
    • <name-of-vm>: The name of the VM.
    • <virtual-disk>: The name of the virtual disk to associate with the VM.
    • <resource-group>: The name of the previously created resource group that contains the VM.

    Here's an example of the az vm create command with the parameters populated with sample values:

    az vm create --name "Upload-OAG-VHD" \ --resource-group "AccessGateway" --location "eastus" --image "ubuntults" \ --size "Standard_D2s_v3" --data-disk-sizes-gb 500 \ --authentication-type "password" --admin-username "okta" --admin-password "AlwaysOn@123

    This command produces the following results:

    --running . . . {- Finished .. "fqdns": "", "id": "/subscriptions/. . . /resourceGroups/AccessGateway/providers/Microsoft.Compute/virtualMachines/Upload-OAG-VHD", "location": "eastus2", "macAddress": "00-0D-3A-E4-AB-31", "powerState": "VM running", "privateIpAddress": "10.0.0.4", "publicIpAddress": "40.79.32.220", "resourceGroup": "AccessGateway", "zones": "" }

  2. Examine the result and note the external IP address.

Next steps

Prepare a temporary virtual machine disk