Create Temporary VM to Host Disk

To create a Microsoft Azure virtual machine to the purposes of creating a disk.

  1. Login or return to the Microsoft Azure Portal.
  2. In the upper left corner menu select All Services and search for Virtual Machines.
    Alternatively select Virtual Machines from the favorites list.
  3. Click + Add
  4. In the Create a virtual machine page:
    • Select a resource group from the Resource group dropdown.
    • In the Virtual machine name field enter a name for the new VM such as Upload-OAG-VHD.
    • In the Region field select the region containing the previously created managed disk.
    • In the Image drop down select Ubunto Server 18.04 LTS.
    • In Size select Standard D2s V3.
    • In the Administrator Account section select:
      • Authentication Type: Password
      • Username: okta
      • Password: AlwaysOn@123
      • Confirm Password: AlwaysOn@123

      Note that username and password are suggestions.

  5. Scroll to the Inbound Port rules section and ensure that inbound ports is set to ssh(22).
  6. Click Next: Disks > .
  7. Click Create and attach a new disk.
  8. Click Change disk size and select 512gb.
  9. Leave all other fields unchanged and click Ok.
  10. Click Next: Networking > .
  11. Ensure that Select inbound ports is set to ssh(22).
  12. Click Create and review and wait for validation to complete.
  13. Click Create.
  14. Once Deployment is Complete is displayed click Goto Resource.
  15. Examine the new VM and note its external IP address.

 

  1. Create a VM using the az vm create command:
    az vm create --name "Upload-OAG-VHD" --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"

    Where:
    • <mame> is an appropriate name
    • <region> is the region to hold the VM
    • <name-of-vm> is an name for the VM
    • <virtual-disk> is the name of the virtual disk to associate with the VM
    • <resource-group> is the name of the previously created resource group to house the VM

    For example:

    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

    Which will produce results similar to:

     --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": "" }

    Examine the result and note its external IP address.

See Also