Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move sections on Azure from Hut23 and REG wikis to the Handbook #110

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
33 changes: 33 additions & 0 deletions content/docs/technical_practices/azure/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# Page title as it appears in the navigation menu
title: "Azure"
# Adjust weight to reorder menu items (lower numbers appear first)
weight: 6
# Uncomment to hide nested pages in a collapsed menu
# bookCollapseSection = true
# Uncomment to hide this page from the navigation menu
# bookHidden = false
# Uncomment to exclude this page from the search
# bookSearchExclude = true
---

# Azure

Azure is Microsoft's cloud platform, through which Turing members have access to a wide range of computing and data storage resources.

## Setting up Azure

You can access Azure through the [Azure portal](https://portal.azure.com), using your Office 365 credentials.

To experiment with Azure you should request a trial account with £300 credit using this [TopDesk Link](https://turingcomplete.topdesk.net/tas/public/ssp/content/serviceflow?unid=ac51b39d8bfc46f9bf41132ef8601b5e&from=7edfe644-ac0d-4895-af98-acd425ee0b19&openedFromService=true). When using Azure for projects you can use the same form to request a project-specific subscription with its own budget.

## Quick links

- [Azure Quickstart: Make a new VM using the command line]({{< relref "docs/technical_practices/azure/azure_make_vm_with_cli.md" >}})
- [Azure Howtos](https://github.com/alan-turing-institute/howtos/tree/master/azure)

## Managing your Azure account

- [Using Microsoft Azure at the Turing](https://mathison.turing.ac.uk/page/2433)
- [Monitor available credit on an Azure subscription](https://rctab-turing-prod.azurewebsites.net/)
- Email the [Research Computing team](https://github.com/alan-turing-institute/research-engineering-group/wiki/The-REGistry#points-of-contact) for help
76 changes: 76 additions & 0 deletions content/docs/technical_practices/azure/azure_make_vm_with_cli.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to discuss whether this page should be in the Handbook or not. If not, it should stay in the wiki

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
# Page title as it appears in the navigation menu
title: "Quickstart: Make a new VM using the command line"
# Adjust weight to reorder menu items (lower numbers appear first)
weight: 1
# Uncomment to hide nested pages in a collapsed menu
# bookCollapseSection = true
# Uncomment to hide this page from the navigation menu
# bookHidden = false
# Uncomment to exclude this page from the search
# bookSearchExclude = true
---

# Azure via CLI basic quickstart
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a note with commit a55b520. Is this good enough or should we remove this page from the Handbook altogether?


These are notes from a REG member discussing their own experience setting up an Azure Virtual Machine running Ubuntu using command line tools. As such, these notes might not be completely accurate or up to date. We advise you also check [Microsoft's official documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-cli).

## Goal

Set up a basic Azure VM running Ubuntu using the command line tools.

## Assumptions

- You have the command line tools installed already.
- You can recognise your subscription ID.
- You know which region you want and which VM you want.

## Steps

1. `az login`, then find your subscription.
1. Maybe you need `az account list --output table` to find your subscriptions,
and `az account set -s <subscription-id>` to set the correct one as the
default.
1. `az group create --name <group-name> --location uksouth` to make a “resource
group” which holds all the various bits and pieces of this server. To get a
list of locations do `az account list-locations`.
1. Make a VM, attach some storage units. The "Standard_B2s" size is a 2 core, 4
GB ram machine, with 30GB of local storage, which is suitable for "bursty"
tasks. (Basically, when you let it run at less than 100% for a while, you
build up 'credits' that let you run it at more than 100% for a time. Or
something like that.)

I've added a 128 GB data-disk. The "Standard_LRS" disk is an HDD, not an SSD.

```bash
az vm create \
--name <name-of-machine-maybe> \
--resource-group <group-name> \
--image UbuntuLTS \
--size Standard_B2s \
--data-disk-sizes-gb 128 \
--storage-sku Standard_LRS \
--ssh-key-values ~/.ssh/id_rsa.pub
```

1. Now you will need to SSH to your new VM to format and mount the data-disk.

- `lsblk` This finds the disk (you can tell which one is the data disk by its
size). Mine was `sdc`

- Partition and format the disk (replace `sdc` with your disk).
- `sudo parted /dev/sdc --script mklabel gpt mkpart btrfspart btrfs 0% 100%`
- `sudo mkfs.btrfs /dev/sdc1`
- `sudo partprobe /dev/sdc1`

(Actually, the instructions suggested "xfs" everywhere instead of
"btrfs". But what the hey.)

- Mount the disk
- `sudo mkdir /data`
- `sudo mount /dev/sdc1 /data`

- Make the mount point persist across reboots.
- `sudo blkid` -- find the UUID of this disk
- Edit `/etc/fstab` (eg, via `sudo nano /etc/fstab`) to add the line:
`UUID=<uuid found above> /data btrfs defaults,nofail 1 2`
Loading