- OS, storage, network for applications
- Vm’s are part of Iaas, scale up/down and pay for use
(also view the 101)
- Checklist:
- Start with network, name, location, size, pricing, storage and OS.
- Location, select region for resources, so the vm is close to users for performance, tax, compliance and more. Location and region has limited options and pricing.
What about pricing?
2 ways for charge, compute and storage
- Compute
- Storage
Compute, priced per hour, but billed per min. Not billed if the VM is stopped, this releases hardware. Price depends on VM size and OS, for VM cost OS is included (license), Linux is cheaper due to no license.
Storage, cost is separate for storage, VM has no relation to storage cost. If VM is stopped it is not billed for, but storage is billed for.
2 options, consumption and reserved
Consumption (pay as you go), pay for compute by second, can increase/decrease compute, start/stop on demand at any time. Short term apps or not know workloads that cannot be interrupted. I.e quick test, develop app in VM
Reserved, is for 1-3 years in a region, commit before and will get savings (up to 72%) compared to p-a-y-g. If VM has to run all the time, budget or you know that you will use for a minimum of 1 year.
Sizing
Hm, instead of selecting process power, storage, memory isolated, you can select variations of the elements, like a mix of the elements
The available series
A | Entry-level economical VMs for dev and test | Low traffic, small to med db,test concept, remove after, rare use, non customer facing. |
B | Economical burstable VMs | Low to moderate baseline CPU, but need burst on demand |
D | General purpose compute | Suitable for most prod, fast CPU and optimal CPU-TO-MEM, enterprise applications, RDBMS, |
Dc | Protect data | Confidential, secure, protect code while in use |
E | Opt for in-memory hyper-thr app | SAP HANA, NetWeaver and other in-mem business (large) |
F | Compute opt VM’s | Batch pro, web server, gaming, analytics |
G | Mem and storage opt | Large SQL/NoSql, ERP, SAP data warehouse |
H, Ls, M & Mv2, N | High performance, storage opt, memory opt and GPU enabled | […] |
ref
General purpose, B, Dsv3, Dv3, Dasv4, Dav4, DSv2, Dv2, Av2, DC, DCv2, Dv4, Dsv4, Ddv4, Ddsv4, Balanced CPU-to-memory ratio. Ideal for testing and development, small to medium databases, and low to medium traffic web servers.
Resizing can be done, just check what is allow with reference to region. Stop/de allocate VM (it is removed from cluster), then you can resize it. They may need to reboot and the IP could change.
Disk
All VM have a minimum of two disks, OS (SATA) and temp disk. The temp disk (not managed), short term storage, may be lost during redeploy or maintenance, should survive reboot.
Data disk (managed) up to 4,095 gibibytes, label is choosen, the size of the virtual machine tells amount of disks that can be attached and type.
“When you redeploy a VM, Azure will shut down the VM, move the VM to a new node within the Azure infrastructure, and then power it back on, retaining all your configuration options and associated resources.”
ref https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/redeploy-to-new-node-windows
On windows it is D:, Linux typical /dev/sdb
Storage options
Unmanaged, you manage storage account that is used to store VHD, virtual hard disk that corresponds to VM’s, stored as blobs.
Managed, VHD, stored as page blobs, random IO storage object, managed meaning = abstraction over page blobs, bloc cont and storage acc. Provision the disks and you are ready. SSD (Ultra, premium, standard) and HDD. (If high IOPS premium, if not HDD)
SLA for managed 99.95%
Supported OS Windows and linux, connect with Bastion (portal) RDP, SSH
Create WIN WM look above in the link.
Create Linux VM
Decide auth with SSH key or password
SSH connections, public key is placed on VM, private key on local system
Connect using Azure Bastion
Azure Bastion Service enables you to secure and seamlessly RDP & SSH to your VMs in Azure virtual network, without the need of public IP on the VM, directly from the Azure portal, without the need of any additional client/agent or any piece of software.
Maintenance and downtime
Unplanned hardware maintenance, azure predicts failure to physical machine-> issue unp HW event, live migration from failing HW to healthy HW (pauses VM for short time, performance could be reduced)
Unexpected downtime, fails unexpectedly, network, disk or other. azure migrates VM to healthy physical machine in same datacenter (reboot and could be loss of tmp drive)
Planned maintenance…..
Availability sets
Use this so not all VM’S have one single point of failure, the VM’s should have same functions and same software installed. Then MS makes them run across several physical servers, compute racks, storage and switches (netw). If HW failes, the overall function remains, only a subset of VMs is affected.
For redundancy, several virtual VM’s in ava sets, each app tier in seperate ava set, use load balancer with ava set and managed disk. (Ava sets is created in disaster recovery section or RM template)
Update domain set of nodes, updated together, increment or rolling upgrades. Each domain has a set of VM’s, physical HW so they can be updated/rebooted at the same time. Plan main, one domain is updated.
Fault domains, set of nodes represents a unit of failure(physical), group of VM’s that share HW, switches that is a single point of failure. A host machine with a power supply for example. VM’S in ava set has at least two fault domains.
For protection regarding system, OS, or application then backup /disaster recovery.
Availability zone
Is used to protect from datacenter fail, a zone has has 1->more datacenter, with isolated power, cooling and so on. A minimum of 3 zones in regions. (not all)
Implementation
Combine fault and update domain, if 3 VM’s in 3 zones, then 3 fault and update domains. And VM’s in different zones is not updated at the same time.
Zonal service, mark the resource to a zone
Zone redundant service, platform replicates, i.e zone-redundant storage
Scaling concepts
Vertical, up and down, increase/decrease VM in size regarding workload
- Useful:A service that is not so much used in the weekends, then reduce size in weekends, save cost
- Useful:Increase size to deal with large demand, without creating more VM’s
Horizontal, out and in, change number of VM’S according to work.
Keep in mind
- Vert, more limitations, need more HW, upper limit and region dependent
- Vert, need reboot for the change
- Hor, more flexible, many machines
Scale sets
Is used for identical VM’s, all must be configured the same. On demand VM can be added and removed, manual or automated.
- Same base OS and config, easy managed
- Load balancer, 4 layer and 7 layer
- Minimal interruption for user
- [….]
Implement scale set
https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/quick-create-portal
Scale set, with autoscale (min/max number of VM)
Extensions
Maintain/create VM is or can be much work, same steps and task over and over again. How to automate this?
Custom script extension
Login an check that IIS is available, but not installed
Install-WindowsFeature -Name Web-Server
Save the code on your local machine, ie inst_iis.ps1
Navigate to to the VM and extensions and locate the Custom Script Extension resource, select, and click create. (Upload script to storage…)
Press ok below and wait
Desired state configuration
“The primary use case for the Azure Desired State Configuration (DSC) extension is to bootstrap a VM to the Azure Automation State Configuration (DSC) service. The service provides benefits that include ongoing management of the VM configuration and integration with other operational tools”
https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/dsc-overview