Skip to content

Latest commit

 

History

History
121 lines (102 loc) · 5.57 KB

File metadata and controls

121 lines (102 loc) · 5.57 KB

Virtual Machines

  • IaaS (Infrastructure as a Service)

Good commands when practicing

  • 📝 Allow ping: New-NetFirewallRule –DisplayName "Allow ICMPv4-In" –Protocol ICMPv4
  • Install IIS (Webserver): Install-WindowsFeature -name Web-Server -IncludeManagementTools

Grouping of VMs

  • ❗ Defined during creation of VMs, cannot be applied to existing VMs.

Availability set

  • IaaS (Infrastructure as a Service)
  • Holds different tiers (instances) so Azure split them onto different places on hardware.
  • Pay only for VMs
  • Two logical grouping:
    • Fault domains: Grouping of domains with common power source + network switch. Separation protects you from hardware/network/power failures.
      • ❗ Max 3
    • Update domains: Grouping when maintaining (reboot etc) at a time.
      • ❗ Default = 5, Max: 20

Scale set

  • IaaS (Infrastructure as a Service)
  • A scale set is an implicit availability set with five fault domains and five update domains.
  • Holds identical instances of images in the scale set so they can be scaled
  • You deploy it via ARM template

VM Sizes

  • The number of network interfaces they can support is different
  • ❗ Resizing VM causes downtime as the state needs to be stopped.
  • Types:
    • General Purpose: Dsv3, Dv3, DSv2, Dv2, DS, D, Av2, A0-7
      • Balanced CPU-to-memory.
      • Ideal for dev / test and small to medium applications and data solutions.
    • Compute optimized: Fs, F
      • High CPU-to-memory.
      • Good for medium traffic applications, network appliances, and batch processes.
    • Memory optimized: Esv3, Ev3, M, GS, G, DSv2, DS, Dv2, D
      • High memory-to-core.
      • Great for relational databases, medium to large caches, and in-memory analytics.
    • Storage optimized: Ls
      • High disk throughput and IO.
      • Ideal for Big Data, SQL, and NoSQL databases.
    • GPU optimized: NV, NC
      • Specialized VMs targeted for heavy graphic rendering and video editing.
    • High performance: H, A8-11
      • Most powerful CPU

Connect to Virtual Machines

  • Windows
    • In portal, click connect, download RDP file. (enabled by default)
    • SSH in with more configurations
  • 📝 Linux
    • Password
      • SSH in (enabled by default)
      • Optionally you can set-up desktop environment, download and configure (open ports in NSG and VM firewall) RDP client and start it for RDP connections.
    • SSH public key
      • Use PuTTY:
        • Go to session that you saved and type IP address there, e.g. [email protected].
        • In connection SSH=>Auth=>Browse, select the private key.
        • Click "open"

Common management tasks

  • 📝 Moving virtual machines between resource groups or subscriptions
    • Can do using Powershell or Azure Portal
    • It'll prompt to you to move all other dependencies as well.
    • ❗ You cannot move Azure Managed Disks at this time.
    • New resource IDs are created as part of the move. After the VM has been moved, you will need to update your tools and scripts to use the new resource IDs.
  • 📝 Change VM size (scale up & down)
    • ❗ If size is not supported on the physical cluster it's hosted, it'll require deallocation of the VM
    • ❗ If the new size for a VM in an availability set is not available on the hardware cluster currently hosting the VM, then all VMs in the availability set will need to be deallocated to resize the VM.
    • ❗ Deallocation may result in Dynamic IP change.
  • 📝 Download a VM ARM template
    • Includes all of the dependencies.
    • 💡 Storage account name must be unique so you can use something like: [uniqueString(subscription().subscriptionId)]
  • 📝 Swap OS Disk
    • You don't have to delete/recreate/de-allocate the VM.
    • If it's managed disk it must not be in use.

Monitoring

  • Available both for Windows & Linux
    • Diagnostic settings (collected information types) are different on windows & linux.
  • Implemented as Agent VM extension.
  • Configure after/during deployment:
    • Boot diagnostics
      • To see why VM gets into a non-bootable state
    • Guest OS diagnostics
      • Collect additional disk, CPU, and memory data.
  • Gathers metrics, diagnostics, and log data
    • Displayed in Azure portal (metrics and boot diagnostics)
    • Stored in Azure storage of a dedicated account (tables and blobs)
  • Azure Network Watcher is a blade in Azure that provides tools to monitor, diagnose, view metrics, and enable or disable logs for resources in an Azure virtual network.
    • You can add *Connection monitors with source and destination VM to track connection between them.
  • 💡 If you have many different VM machines (e.g. on different tiers), consider larger scale distributed application monitoring systems such as Microsoft EMS.
  • Network Watcher enables you to monitor your VM and its associated resources as they relate to the network that they are in.
    • You can install the Network Watcher Agent extension on a Linux VM or a Windows VM.

Azure Disks vs Azure Files vs Azure Blobs

  • Always hosted in a Storage account.
  • Azure Files
    • Good for "lift and shift" operations.
    • Good if data will be shared by multiple applications.
  • Azure Blobs
    • Support for streaming & random access scenarios.
    • Access application data from anywhere.
    • ❗ Capacity: Max 2 PiB Account Limit
    • E.g. enterprise data like to perform big data analytics.
  • Azure Disks
    • Handles storage account creation for you.
    • Good for lift & shift scenarios for applications that use native file system APIs.
    • ❗ Capacity: Max 5 TiB file shares.
    • You want to store data that's not required to be access from outside the VM to which the disk is attached.