Azure Crash Course Part 1
Azure HA
Fault Domains :
VM will be distributed across different physical hardware .ex 2 domain, so two physically separate machines.
Update Domain :
1-20, schedule rollout of windows/azure fixes etc, in different segments upto 20 , these machines might be rebooted , if machines are in update domains, it will affect only subset not all .
Availability Zone:
in limited regions
Microsoft has given ability to deploy VM in specific dc in region, which has multiple different locations 1-3,
Availability Set
: An Availability Set is a logical grouping capability for isolating VM resources from each other when they’re deployed. Azure makes sure that the VMs you place within an Availability Set run across multiple physical servers, compute racks, storage units, and network switches
No Load balancing in availability set/zone, need to deploy LB manually
B1s is free for 750 hours
New Account:
- B1s is free for 750 hours
Monitor a VM:
Enable Guest-level Monitoring in Diagnostic setting
Setting up Virtual Machine Scale Sets VMSS:
Allow us to create VMs which can scale from 1-100 when needed.
Setup
- Credit valid for 1 month, Most of services are free for 1 year
- https://portal.azure.com/
Setting a Budget
- After 30 days free trial will end and pay-as-you-go will start
- If it is pay-as-you-go, you can set budget to prevent over billing
- Go to Cost-Mgt-Pay-As-You-Go-> Create Budget, Budget details-> Dates all & then budget amount.
- Set alert to receive email when threshold reached as per alert config.
VM
Create VM with windows 2016 datacenter, Admin Account: anuj/nailbyter@123
Enable RDP 3389 port in inbound ports
Create container in bash shell:
az group create --name resGrp2-0105 --location eastus
az container create --resource-group resGrp2-0105 --name democontainer --os-type Windows --image mcr.microsoft.com/windows/servercore/iis:nanoserver --dns-name-label azdemo --ports 80
az container delete --resource-group resGrp2-0105 --name democontainer
54 regions & present in 140 countries.
Public Cloud: ~28 regions , 6 regions that have restrictions.
Data respects Nations boundaries (“geos”) like canada data in canada, india in india etc.
- US Govt. Cloud: Govt only, 8 Regions as of now.
- Private Cloud: Internal or Corporate cloud, Azure Stack (Download & install on prem)
- Hybrid Cloud: Mix of on Prem, public cloud.
Cloud Concepts:
- Availability
- HA
- Scalability
- Elasticity – capacity can grow/degrow as per traffic.
- Auto-Scaling
- Faults
- Disaster Recovery
Delete resource group:
az group delete --name <resGRPName>
az resource list - list all resource
Subscriptions & resources
- Level at which billing happens
- Get Subscription either from Microsoft directly or get from some other provider.
- Management Groups can be nested.
Azure Blueprints:
Simplify large scale Azure deployments by packaging key environment artifacts, such as Azure Resource Manager templates, role-based access controls and policies, in a single blueprint definition. Easily apply the blueprint to new subscriptions and environments and fine-tune control and management through versioning.
Azure VMS
- General Purpose: Balanced CPU-to-Memory Ratio
- B,D,DS,A,DC series
- Compute Optimized – High CPU-to-memory ratio
- F,FS
- Memory Optimized
- E,ES,M,G,GS,D*,DS*
- Storage Optimized
- LS (S means usually SSDs)
- GPU VMs
- NV,NC,ND
- High performance Compute – Fastest & most powerful
- H
High Availability – Options
- Availability Set:
- The availability set can only be configured when creating a virtual machine. You must recreate the virtual machine to move it in or out of an availability set.
- Fault Domains – so that power outage doesn’t take down your app., without this your both VMs might have gone down if the same power source was powering them.
- Update Domains – scheduled maintenance – total 20 segments, 1 at a time, so if you select 10 domains, your machine will be available under many domains ensuring HA
- The availability set can only be configured when creating a virtual machine. You must recreate the virtual machine to move it in or out of an availability set.
- Availability Zone- Might not be available under all regions.
- Under that region, VM will be deployed.
- No Load balancing, in either zone/set. Need separate LB
Availability SLA wikipedia downtime
Azure VM Monitoring
Azure Monitoring collects host-level metrics – like CPU utilization, disk and network usage – for all virtual machines without any additional software. For
more insight into this virtual machine, you can collect guest-level metrics, logs, and other diagnostic data using the Azure Diagnostics agent
- Enable Guest Level Monitoring under VM->Diagnostic Settings
Azure VMSS – Virtual Machine Scale Sets
- Search in All services for VMSS
- Scale out / Scale in as per the load CPU utilization in particular time.
- Traffic is load balanced b/w VMs in the Scale set
Dedicated Hosts & Host Groups
Dedicated Hosts:
Azure dedicated hosts provides physical servers that host one or more Azure virtual machines. Your server is dedicated to your organization and workloads capacity is not shared with other customers; this host level isolation helps address compliance requirements. As you provision The Host you gain visibility into the server infrastructure and you determine the host’s maintenance policies.
Host Groups:
- Host group is a resource that represents a collection of dedicated hosts. you create a host group in a region and an availability zone, and add host to it
- Host is a resource map to a physical server in Azure data center
- Each host can host multiple VM’S, they should be of the same size series.
- Host group is created in one availability zone
Powershell
- Install Latest powershell from website
- On PowerShell CLI
- Check Version
- $PSVersionTable.PSVersion
- Get-InstalledModule -Name Az -AllVersions | select Name,Version
- Connect to account
- Connect-AzAccount – it will prompt to enter code in URL to have you logged in CLI.
- Change Subscription
- Get-AzSubscription
- Change to another one
$context = Get-AzSubscription -SubscriptionID 913a274d-722b-422e-8c74-2e657a575b19
Set-AzContext $context
Creating a VM In powershell
Get-AzResourceGroup - list of existing ResourceGroups
New-AzResourceGroup -Name resGRP0405 -Location EastUS
New-AzVM -ResourceGroupName "resGRP0405" -Name "vm0405" -Location "EastUS" -VirtualNetworkName "vnet0405" -SubnetName "default" -SecurityGroupName "secGRP0405" -PublicIpAddressName "myipaddr" -OpenPorts 80,443,3389
It will ask for a password for the VM which you want to set, provide the same.
Stop-AzVM -ResourceGroupName "resGRP0405" -Name "vm0405"
Start-AzVM -ResourceGroupName "resGRP0405" -Name "vm0405"