· 6 years ago · Jan 14, 2020, 10:26 PM
1------------------------------Describe the options available to create and manage an Azure Virtual Machine------------------------------
2
3How to create resources:
4 Az Res Manager
5 Ezpz, inefficient, time consuming
6 Allows templating (JSON files)
7 "You can delete the resource group, which deletes all of the resources, tweak the template, and try again"
8 ResGroups allow automation of tasks through template tweaking
9 Replication of enviroments: "Once you have it working the way you want it, you can take that template and easily re-create multiple versions of your infrastructure, such as staging and production."
10
11 Az PowerShell
12 Ezpz, automate repetition, error minimization.
13 Best for one-off environment setups
14 Example (Creation of a VM):
15 New-AzVm `
16 -ResourceGroupName "TestResourceGroup" `
17 -Name "test-wp1-eus-vm" `
18 -Location "East US" `
19 -VirtualNetworkName "test-wp1-eus-network" `
20 -SubnetName "default" `
21 -SecurityGroupName "test-wp1-eus-nsg" `
22 -PublicIpAddressName "test-wp1-eus-pubip" `
23 -OpenPorts 80,3389
24
25 Az CLI
26 Also ezpz, and bash!
27 Best for one-off environment setups
28 Example (Creation the same VM):
29 az vm create \
30 --resource-group TestResourceGroup \
31 --name test-wp1-eus-vm \
32 --image win2016datacenter \
33 --admin-username jonc \
34 --admin-password aReallyGoodPasswordHere
35
36 Programmatic (APIs)
37 Az REST APIs
38 All these are really just thin API wrappers. it is T H I C C
39 Client SDK:
40 Best for transactional activities.
41 Forreal, look at this shit, same VM:
42 var azure = Azure
43 .Configure()
44 .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
45 .Authenticate(credentials)
46 .WithDefaultSubscription();
47 // ...
48 var vmName = "test-wp1-eus-vm";
49
50 azure.VirtualMachines.Define(vmName)
51 .WithRegion(Region.USEast)
52 .WithExistingResourceGroup("TestResourceGroup")
53 .WithExistingPrimaryNetworkInterface(networkInterface)
54 .WithLatestWindowsImage("MicrosoftWindowsServer", "WindowsServer", "2012-R2-Datacenter")
55 .WithAdminUsername("jonc")
56 .WithAdminPassword("aReallyGoodPasswordHere")
57 .WithComputerName(vmName)
58 .WithSize(VirtualMachineSizeTypes.StandardDS1)
59 .Create();
60
61Azure VM Extensions
62 Azure VM extensions are small applications that allow you to configure and automate tasks on Azure VMs after initial deployment
63
64Azure Automation Services
65 If you have a lot of infrastructure services, you might want to consider using higher-level services in Azure to help you operate from a higher level.
66
67 Azure Automation allows you to integrate services that allow you to automate frequent, time-consuming, and error-prone management tasks with ease. These services include process automation, configuration management, and update management..
68 Process Management
69 Setup watcher tasks to respond to events in the datacenter (such as errors)
70 Configuration Management
71 Track software updates, allowing for update skipping.
72 Microsoft Endpoint Configuration Manager allows management for the company's PC, servers and mobiles, as well as VMs.
73 Update Management
74 Manage update and patches vfor VMs.
75 Access status and schedules of update installations and review update results.
76
77------------------------------Manage the availability of your Azure VMs------------------------------
78
79Availability = %time service is up
80
81Azure VMs run on Azure Datacenter.
82Microsoft auto-migrates VMs to healthy hosts on failure.
83
84Microsoft auto-updates VMs. Generally no issue, but they might be rebooted.
85 Only for underlying Azure software/hardware. VM OS&Software won't be auto-updated.
86
87
88Availability set
89 logical feature. Avoid single point of failure.
90 Use at least 2 VMs capable of the same tasks.
91
92------------------------------
93[Tip]
94
95Microsoft offers 99.95% SLA for multi-instance VMs in an Availability set.
96------------------------------
97
98Fault Domains
99 Logical group of hardware sharing a common power source and network switch.
100 (Such as a rack in a datacenter)
101
102 In availability sets, the first two VMs are sure to be in different fault domains to avoid Single Point of Failure.
103
104Update Domains
105 Logical group of hardware that can undergo maintenance or reboots at the same time.
106
107 VMs are placed in update domains to minimize failure when hosts update.
108
109Failover across locations
110 Az Site Recovery replicates workloads from a primary site to a secondary location.
111 This allows for failure to occurs in the primary site, and allows failover to secondary site.
112
113 Two significant advantages:
114 - No $$$ for a second physical datacenter, reducing costs.
115 - Run failover for recovery drills without impacting Prod environments.
116 Test planned and unplanned failovers. No good plan for disaster without breaking stuff.
117
118 Recovery plans can include auto scripts, Azure Automation runbooks, or manual intervention steps.
119
120 Azure Site Recovery works with Az resources, Hyper-V, VMWare and phys on prem servers. Key part in business continuity and disaster recovery (BCDR) strategyby orchestrating the replication, failover, and recovery of workloads and applications if the primary location fails.
121
122
123------------------------------Back up your virtual machines------------------------------
124
125Azure Backup
126
127 Literally backup as a service for phys or VMs, both on-prem or cloud.
128
129 It can backup:
130 Files and folders on Windows
131 Application-aware snapshots (Volume Shadow Copy Service)
132 MSSQL Server, SharePoint and Exchange
133 Native support for Az VMs
134 Linux and Win10 clients
135
136 Advantages:
137 Auto Storage Management
138 Auto allocates and manages backup storage, using pay-as-you-go.
139 Unlimited Scaling
140 High availability. It's Azure
141 Multi Storage locations
142 Keep stuff truly safe with Geo Replication
143 Unlimited Data Transfer
144 No charging for data transfers. Only storage.
145 Data Encryption
146 At Rest!
147 Application-consistent backup
148 A recovery point has all required data to restore the backup copy.
149 Long-term retention
150 As long as you want!
151
152 Usage:
153 There's some utilities that need to be downloaded
154 Azure Backup agent
155 System Center Data Protection Manager
156 Azure Backup Server
157 Azure Backup VM extension
158
159 Azure Backups -> Recovery Services -> Blobs