1 00:00:00,740 --> 00:00:04,730 Let's take a look at Hyper‑V storage, and in particular, 2 00:00:04,730 --> 00:00:09,810 I want to do a comparison contrast between Generation 1 virtual hard disks, 3 00:00:09,810 --> 00:00:12,300 or VHDs, and Generation 2. 4 00:00:12,300 --> 00:00:15,640 As a general rule, you think about the higher the number, 5 00:00:15,640 --> 00:00:20,050 the more features and expandability, etc that you get, and that's true, 6 00:00:20,050 --> 00:00:21,520 that's definitely the case. 7 00:00:21,520 --> 00:00:22,180 However, 8 00:00:22,180 --> 00:00:26,040 there are some wrinkles particularly with Azure that you need to know about. 9 00:00:26,040 --> 00:00:26,610 First of all. 10 00:00:26,610 --> 00:00:29,000 Let's see that we've got Generation 1. 11 00:00:29,000 --> 00:00:33,730 These virtual hard disks can have either the VHD or VHDX extension. 12 00:00:33,730 --> 00:00:36,980 Gen 2 disks can only do VHDX. 13 00:00:36,980 --> 00:00:39,770 There is going to be a significant size difference between 14 00:00:39,770 --> 00:00:43,140 Generation 1 and Generation 2 as you can see here. 15 00:00:43,140 --> 00:00:43,870 Specifically, 16 00:00:43,870 --> 00:00:47,370 Generation 1 disks have a 2 TB max size, and 17 00:00:47,370 --> 00:00:51,320 Generation 2 VHDs have a 64 TB max size. 18 00:00:51,320 --> 00:00:56,940 In terms of memory, 1 TB limit for Gen 1, 12 TB for Gen 2. 19 00:00:56,940 --> 00:01:00,700 Generation 1 can handle 32 or 64‑bit VCPUs. 20 00:01:00,700 --> 00:01:06,440 You can do up to 240 CPUs associated with the Gen 2 disk, 21 00:01:06,440 --> 00:01:08,250 but that's 64‑bit only. 22 00:01:08,250 --> 00:01:09,670 Now, that's an exam alert. 23 00:01:09,670 --> 00:01:13,360 It's not a question of you necessarily having to memorize these numbers, 24 00:01:13,360 --> 00:01:14,570 but no, for instance, 25 00:01:14,570 --> 00:01:17,490 on AZ‑800 if you were to get a case study where they 26 00:01:17,490 --> 00:01:20,760 mention 32 and 64‑bit architectures, 27 00:01:20,760 --> 00:01:25,810 you're not going to be able to do Gen 2 storage on a 32‑bit virtual machine. 28 00:01:25,810 --> 00:01:31,010 The way that the allocation units, that is how data is allocated to those VHDs, 29 00:01:31,010 --> 00:01:36,280 512 bytes for Gen 1, which is really dates back to the early days of BIOS. 30 00:01:36,280 --> 00:01:39,740 Nowadays, 4 KB is the standard allocation unit, 31 00:01:39,740 --> 00:01:43,490 and you have that alignment by default in Generation 2 disks. 32 00:01:43,490 --> 00:01:46,810 Speaking of firmware, Gen 1 is the old school BIOS, 33 00:01:46,810 --> 00:01:52,040 whereas Generation 2 is UEFI, and that UEFI unlocks Secure Boot, 34 00:01:52,040 --> 00:01:53,680 Trusted Platform Module, 35 00:01:53,680 --> 00:01:56,930 and all of the latest and greatest hardware virtualization, 36 00:01:56,930 --> 00:01:59,970 all of the controls that we expect and features that 37 00:01:59,970 --> 00:02:02,000 we expect on modern motherboards. 38 00:02:02,000 --> 00:02:04,860 By contrast, Gen 1, there is no security extension. 39 00:02:04,860 --> 00:02:06,050 So summing up, 40 00:02:06,050 --> 00:02:08,940 we could look at Gen 1 as being there for backward 41 00:02:08,940 --> 00:02:13,300 compatibility with old systems and Gen 2 really being what we 42 00:02:13,300 --> 00:02:16,750 should standardize on with our Hyper‑V VMs. 43 00:02:16,750 --> 00:02:20,630 That having been said, we need to think about what Azure supports. 44 00:02:20,630 --> 00:02:26,250 Now many Microsoft Azure VM role sizes support Generation 2 disks, 45 00:02:26,250 --> 00:02:29,320 however, there is two important got‑yous on this slide. 46 00:02:29,320 --> 00:02:34,580 You can do a Gen 2 VHD in Azure, but the VHD has to be fixed size, 47 00:02:34,580 --> 00:02:39,000 not dynamically expanding, and it has to have the VHD file extension, 48 00:02:39,000 --> 00:02:41,190 which means that in a migration scenario, 49 00:02:41,190 --> 00:02:45,390 you may have some work to do to prepare those local VHDs or 50 00:02:45,390 --> 00:02:48,600 VHDXs for upload to Azure if you're doing, 51 00:02:48,600 --> 00:02:54,340 say, a lift and shift or if you want to create a VM image using a local copy. 52 00:02:54,340 --> 00:02:55,190 Speaking of which, 53 00:02:55,190 --> 00:02:59,890 you do need to know the PowerShell for converting Hyper‑V disks because 54 00:02:59,890 --> 00:03:03,500 you may very well see it on AZ‑800 and even AZ‑801. 55 00:03:03,500 --> 00:03:07,200 To prepare a dynamically expanding VHD, 56 00:03:07,200 --> 00:03:12,230 you can do a compact operation that's Optimize‑VHD as you can see here, 57 00:03:12,230 --> 00:03:16,910 and then you can actually resize a VHD very easily as long as the virtual 58 00:03:16,910 --> 00:03:21,080 machine has stopped using the appropriate Resize‑VHD command. 59 00:03:21,080 --> 00:03:25,500 You can also convert a dynamic Gen 2 disk to a fixed Gen 2 disk. 60 00:03:25,500 --> 00:03:28,850 Now notice that it's not as easy as running a PowerShell 61 00:03:28,850 --> 00:03:33,060 command to convert a Gen 2 disk to a Gen 1 disk, 62 00:03:33,060 --> 00:03:34,540 that's not what we want to do. 63 00:03:34,540 --> 00:03:38,960 We want to, in a migration scenario, stay with Gen 2 wherever possible, 64 00:03:38,960 --> 00:03:41,580 especially now that Gen 2 is supported in Azure, 65 00:03:41,580 --> 00:03:43,470 it's not supported universally, 66 00:03:43,470 --> 00:03:48,310 but I dare say the majority of the Azure VM role sizes support Gen 2, 67 00:03:48,310 --> 00:03:50,110 but in this case, in this example, 68 00:03:50,110 --> 00:03:56,460 we're doing Convert‑VHD to convert our winserv01.vhdx file to a VHD copy, 69 00:03:56,460 --> 00:03:59,560 and notice that we're also turning off dynamic expansion. 70 00:03:59,560 --> 00:04:04,000 We need to have the VHD type set to fixed. Now let's do a demo.