AzureVM
Prerequisites
You’ll need to have rights to create and modify virtual machines.
Login to Azure Portal
Click here to login to Azure and open a cloud shell :link:.
If you get the welcome message, choose PowerShell. Create storage in a subscription where you have access.
When your shell loads, check that you are running Powershell in the top left of your window. If not, use the drop down arrow to change it.
Switch into your cloud drive so anything you download and run will persist from session to session.
Download the helper script
This script lets you pick a subscription, creates a unique resource group for you (critical if others running this tutorial in the same subscription), and provides common commands.
Download the helper script:
Create the virtual machine
Run the helper script to create a resource group and a host.
What’s happening here?
The script:
- uses your email up to ’@’ as a unique identifier.
- allows you to select a subscription (and set it as default).
- creates a resource group in the format: scw-group-(name).
- creates a vm in that resource group with the format: scw-host-(name).
- saves the public IP of your host into the myip file.
About the host creation step:
- We’re using the long term support (LTS) version of Ubuntu linux for the image.
- The - - size Standard_B2ms is a good combination of price and a large enough host (2cpu & 8gb mem) to run kubernetes.
- public-ip-sku assigns a public IP address so we can access our machine remotely.
- We’re generating an ssh key (or using your existing one) instead of a password to login.
Once the script menu appears, press < enter > and quit. You can run the helper script again at any time.
Copy the myip file into your host.
choose
yes
if asked to store your host’s fingerprint.
Waiter, there seems to be a cat in my scp?
SCP is the secure copy command. We’re using it to copy the myip file to your host to use later. The cat command
outputs the file contents (just the ip address in this case) and the $() part means “run whatever command is in here”. In the end, scp gets the azure user name and the IP of the
host. The part after ’:’ is the folder and filename on your host where scp saves the file.
:checkered_flag: Checkpoint
Run the helper script:
Once it loads, you’ll see options to quickly login to your Azure VM or reset the password. It also shows you the exact command it runs to perform those steps if you want to copy them out to use later.
If you successfully login, congratulations! You’ve configured your host.
Next Steps
Check out the next numbered item on the left sidebar for more.