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
- Sign in to the Microsoft Azure Portal.
- Select All Services from the menu.
- Select Virtual Machines. Alternatively, select Virtual Machines from the favorites list.
- Click Add. The Create a virtual machine page appears.
- From the Resource group dropdown menu, select a resource group.
- Enter a name for the new VM in the Virtual machine name field.
- Select the region that contains the resource group.
- From the Image dropdown menu, select any available version of Ubuntu Server LTS.
- Enter Standard D2s V3 in the Size field.
- In the Administrator Account section, select Password for the Authentication Type, and then enter a username and password to apply to the VM.
- In the Inbound Port rules section, enter ssh(22) in the Select inbound ports field.
- Click Next: Disks.
- Click Create and attach a new disk.
- Click Change disk size and select 512gb.
- Click Ok.
- Click Next: Networking.
- Enter ssh(22) in the Select inbound ports field.
- Click Create and review and wait for the validation process to finish.
- Click Create.
- When the Deployment is Complete prompt appears, click Goto Resource. Examine the new VM and note its external IP address.
Use the command line
- 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": "" }
- Examine the result and note the external IP address.