This guideline is to aid setup of enviroment for CS443 class in Kaist Fall 2017. Please follow the document step by step and reach your TA or Microsoft when you need more assistance.
Throughout this practice, you will have twenty Virtual Machine in a single virtual network. Please remind that your credit is limited and make sure that shutting down all the VMs or completely delete the all resource to prevent unnecessary expenditure of credit. In case of credit out, please reach your TA.
- Exercise 1: Create a Microsoft account
- Exercise 2: Subscript Access
- Exercise 3: Azure Portal
- Exercise 4: Batch job to manage Virtual Machine
- Exercise 5: Resource Group Creation
- Exercise 6: Virtual Network Creation
- Exercise 7: Virtual Machine Creation
- Exercise 8: Connect to Virtual Machine
- Exercise 9: Turning off/on Virtual Machine
- Exercise 10: Delete the all resource
(You can skip this exercise if you already have it.)
First of all, you need an account to access Microsoft Azure. Microsoft ID can be created by visiting here. If you choose your Organization Account which ends with @kaist.ac.kr, you will see select panel at your every login.
Click 'Sign in with Microsoft' button.
Click 'Create One'.
Hint: You can use any of email account as Microsoft account. Gmail, naver accounts are welcome.
Once you finish Microsoft account creation, you need to submit your account to your TA.
Once you submiited your Microsoft ID, your TA will allow you to access specific Azure Subscription, to utilize proper Azure resources. You can verify your access at Azure Portal.
You will see 'Subscription' menu at left side of portal. Click the button.
Please check the name of Subscription (named by TA) and its credit balance. You can monitor your balance here while you're using several Azure resources.
If your account has Azure history, you may see different Subscriptions, in this case, you need to be careful to select Subscriptions while doing exercise. Provided Subscription is safe to use without any expenditure.
Congraturations. Now you have full access to Azure and your Subscription to perform your task. Azure Portal is a place to allow users to build, manage, and monitor everything from simple web apps to complex cloud applications in a single, unified consol. For detail, please visit Azure Portal Introduction page.
This chapter shows Azure CLI Script to deal massive number of VMs. By using Script below, you may skip later exercises except Exercise 10. But we strongly encourage you to read other execise to understand how Azure create and manage resources. If you're not familiar with Script, please go to the next exercise.
Azure CLI script for kaist distributed computing class - deploy 20 vm batch project
follow below instruction
- Install CLI
- Copy deploy20vm.sh file to local control machine
- Change global vals and for loop count
- Run in bash
- Copy stop20vm.sh file to control machine
- Change global vals and for loop count
- Run in bash
Hint: You can change below code to re-start VMs from stop20vm.sh file.
az vm start --resource-group $resource_group_name --name $vm_name_prefix$i
Check azure subscription maximum VM count limitation(default max 20) and global val limitation
- Dae Woo Kim([email protected])
Resource Group is a container that can held the resources you assign from your any of deployments - whether it is a Virtual Machine, Database, or Website. It enables you to group related entities. In this exercise, we will create a single resource group, names 'CS443' and manage the resources inside of it together.
- Click 'Resource groups'. Then blade will pop-up.
- Click 'Add' to create new resource group.
- Resource group name: you can name by your own.
- Subscriptions: Make sure you're selecting the right Subscription from TA. This is very important to avoid any financial damage for you.
- Resource group location: you can choose any region in Azure. However, the closer may be better.
- Click 'Create' button below.
- By hitting 'Refresh' button above,
- You may visually confirm new resource group, you just created.
Now, we need to set up a Virtual Network, to let Azure Resources to securely communicate with others - in this exercise, mainly 20 Virtual Machines. You can refer detail explanation of Azure Virtual Network here.
Click Microsoft Azure logo at top left. You will go to the default screen.
- Click 'Create a resource' at your top left.
- Type 'Virtual network' to search resource we need to create.
Choose Virtual network. Set 'Resource Manager' as a deployment model (do not change) and hit 'Create'.
- Name your Virtual network as 'CS443-Vnet'.
- Address Space sets the range of private IP addresses for the Virtual network. Keep the default.
- Again, make sure your Subscription choice.
- As we already created resource group, select Use existing button and one.
- Set your prefered location. It is better to put your resource group, virtual network and virtual machines together in the same region.
- Subnet. Do not modify.
- Subnet IP allocation. Do not modify.
- By clicking 'Pin to dashboard', new icon of virtual network will appear at your dashboard, and you can directly access by clicking the icon.
Click Microsoft Azure logo at top left. You will go to the default screen.
-
Click 'Create a resource' at your top left.
(Hint: In Azure, there are several different way to create new resource.)
-
Type 'Ubuntu' to find Ubuntu server resource.
-
Select 'Ubuntu Server 16.04 LTS VM'.
In Azure, there are four step to create new Virtual Machine.
- Basic setup
- Size setup
- Setting setup
- Summary and confirm
- Name your first VM, it is highly recommended to set up a policy to name it as we will manage twenty different VMs.
- Choose your disk type. HDD is more ecomonic.
- User name - this is your administrator account for this VM.
- Auth type - select one you prefer.
- Password - You can reset at Azure Portal when you forget it.
- Subscription - Verify again.
- Choose resource group 'CS443'.
- Location - Korea Central.
In Azure, many different spec of VM are offered. In this exercise, it is recommended to choose basic model - D1 series. According to your selection of region, option varies. Higher performance VM are more expensive.
Azure Virtual Machine charges your credits based on hour, you turn on. It means you can save your credit by turning off when you're not using those. And it is important to delete all of your resource when you finish your task.
-
High availbility - Do not need in this exercise.
Azure automatically fails over guest VMs to a working physical host in a different Fault Domain when an error condition is detected, again aimed at ensuring availability.
-
Storage: Yes
-
Virtual network: CS443-Vnet
-
Subnet: default
-
Public IP address: (new) VM01-ip
-
Network Security Group(firewall): (new) VM01-nsg. You can create every different Network Security Group for every VMs or just use one Network Security Group for all the VMs.
-
Diagnostic storage account: This storage account is used to collect your VM's log data.
After final validation, you can create your first VM.
Note: it may take few minutes to prepare your VM.
Open your VM detail menu, by clicking icon at the dashboard or name at your resource group page.
- Connect: you will get address to connect your VM. Putty, Powershell and Azure CLI are fine to connect.
- Start: Once you stop your VM (turned off), you can restart with this button.
- Restart: You can do restart your VM at Azure portal.
- Stop: You can stop your VM here. After your stop and start your VM, data in VM disk will be initialized.
- Azure Portal provides CLI enviroment.
It is possible to turn on/off by individual's virtual machine at VM's menu as described at Exercise 7: Connect to Virtual Machine. For the convience, it is recommended to utilize batch process in later chapter.
In Azure, you can delete specific resource by choosing one. We're highly encoraging you to delete those resource group at once when you do not need any resources for your convenience.
- Click 'Resource groups' button at left pane.
- Check resource group you want to delete.
- Click More option icon at right end.
- Follow the following instruction from Azure.