Home » Posts tagged 'VHD'
Tag Archives: VHD
You all know by now that I am a huge Hyper-V fan… I have been using it since 2008, but with the latest release I am unabashedly loving Microsoft’s Layer 1 hypervisor. The fact that it has been included in Windows 8 – as in, no different from the virtualization platform I use in my servers – is just the icing on the cake.
It is true that almost any IT Pro would be able to install and use Hyper-V on either the server or client platform without much guidance. However when you do start out – either with Hyper-V in general, or on a new system – there are a few things that you should know before you go. Here are some of my tips, in no particular order of importance.
1) Change the default file locations!
The default file locations for virtual hard disks and virtual machines are a bit obscure. I like to change them right out of the gate. Depending on which drive I want to store them on (in Windows 8 it is usually the C drive, while on proper servers it will usually not be) I will store them both right off the root… x:\VHDs and x:\VMs. That way I do not have to navigate to the defaults whenever I want to copy a file. I find x:\VHDs much easier than c:\Users\Public\Documents\Hyper-V\Virtual Hard Disks and c:\ProgramData\Microsoft\Windows\Hyper-V.
- In Hyper-V Manager click on Hyper-V Settings… in the Actions Pane.
- Under the Server context, click on Virtual Hard Disks and change the default location. You will have to create the directory before going ahead.
- Still under the Server context, click on Virtual Machines and change the default location. Again, you will have to create the directory first.
It’s as easy as that. Of course, VMs that are already there will not be moved, but going forward all VMs will be placed in the proper directory.
2) Create your Virtual Switch!
When you start creating virtual machines there will be nowhere for them to go and nobody for them to talk to… that is, unless you create a virtual switch (previously called virtual network) to connect them to. Depending on your server and your environment this might be simple or complex, and may require more planning. However the long and the short of it is you have to make three decisions when creating a virtual switch:
- Is the network going to be External (can communicate beyond the physical host), Internal (can only communicate with other VMs on the same host, plus with the host), or Private (can only communicate with other VMs on the same host)?
- If External, what physical NIC (uplink) will it be bound to?
- Can the Management OS (on the host) use the same NIC?
- In the Action Pane of Hyper-V Manager click Virtual Switch Manager…
- In the navigation pane click New virtual switch
- In the right screen select External, Internal, or Private and click Create Virtual Switch
- In the Virtual Switch Properties window delete New Virtual Switch and name the switch something that you will understand (i.e.: CorpNet).
- Click OK to close the Virtual Switch Manager.
Again, this is all there is to it. Plain and easy, no fuss, no muss.
3) Configure Dynamic Memory
When you create a virtual machine there are a few defaults that Hyper-V thinks is a good idea… which I don’t. The main one that comes to mind is the Dynamic Memory option (per VM). When you configure Dynamic Memory the defaults are going to be:
Minimum RAM: 512 MB
Maximum RAM: 1048576 MB
Ok, for a lot of our virtual machines 512MB may be a fine minimum… but unless you are driving a BAWL (Big @$$ Work Load) server on the VM you will nearly never need a terabyte of RAM. Granted it is nice that we have that ability, it is not going to be the norm. On the other hand, not setting a realistic maximum would mean that if your VM were to place a huge memory demand – say, because of an unchecked memory leak or a compromised server, or even something as simple as an Exchange Server grabbing as much physical (ahem… virtual) RAM as it can – then this would necessarily be at the expense of contention resources, which would no longer be available to other virtual machines on the same host.
My recommended best practice is to pick minimums and maximums that are reasonable to you for each server (and those will be different from VM to VM, depending on the load expectations). You will be able to tweak these up or down as needed, but the point is you will have reasonable limits. For many of my servers I set limits such as these:
Startup RAM: 512 MB
Minimum RAM: 512 MB
Maximum RAM: 4096 MB
These settings allow the VM to consume up to 4 GB of RAM when needed and available, but no more than that. If I discover the VM workload needs more then I will tweak it up incrementally. I am not letting resources go to waste, and I am making sure that my VMs work within their means – i.e.: as efficiently as they can.
- Within Hyper-V Manager click on the VM in question and then in the Action Pane (VM Name) click Settings…
- In the Navigation Pane click Memory
- In the Memory window change the Minimum and Maximum RAM as needed.
- Click OK.
4) …and Hard Disks!
By default the virtual hard disks that are created for us in the New Virtual Machine Wizard will be 127 GB. But do they really need to be that big? Actually, in a lot of cases they do. In many cases they should be bigger. Sometimes they should be smaller. If you are creating your disks this way then you should right-size them in the wizard.
With that being said, the one question that the wizard does not ask you is ‘what type of disk would you like to create?’ In Server 2012 there are actually three questions that you should be asked that are only asked when creating your disks using the New Virtual Hard Disk Wizard:
a) Would you like to create a VHD file (with backward-compatibility, and limited to 2 TB in size) or a VHDX file (which adds resilience to consistency issues that might occur from power failures, and are limited to 64 TB in size but offer no backward compatibility)
b) Would you like the disk to be Fixed size (pre-provisioned storage), Dynamically expanding (storage on demand), or Differencing disk (associated with a parent-child relationship with another disk)?
c) Would you like to create the new VHD(X) file based on the contents of an attached physical drive?
The solution is to pre-create your VHD(X) files to spec, and then point to them from the New Virtual Machine Wizard. While dynamically expanding disks are fine for labs and offer greater portability, I never recommend them in a production environment. Also if you think you might need to port your VMs back to Server 2008 (or Windows 7) then VHD will be required.
- From the Hyper-V Manager console in the Actions Pane click New > Hard Disk…
- Go through the wizard and select the options you choose.
- From the New Virtual Machine Wizard click the radio button Use an existing virtual hard disk and point to the right file.
- Click Finish.
Alternately, you could select the radio Attach a virtual hard disk later and create your VMs, then create your VHD(X) files, and then attach them. It seems like more work to me though…
5) …and CPUs!
There are a few new settings in the Processor tab of Hyper-V VMs than there used to be. Not only can you set the number of virtual processors (to the lesser of either a maximum of 64, or the number of physical cores in your computer), but you can also set the VM reserve, the percent of total system resources, the VM limit, and the relative weight. These are all set in the main screen of the Processor Settings page.
What a lot of people do not realize is that there are two subsections to the Processor tab: Compatibility and NUMA. In order to access these you need to expand the + next to Processor in the navigation pane.
NUMA stands for Non-Uniform Memory Architecture, and essentially means that a single VM can use memory that is assigned to different physical CPUs.
Compatibility in this context refers to CPU families, and is a very handy option indeed. In virtualization there is no way to live-migrate a VM from a host running on AMD CPUs to a host running on Intel CPUs. This is not a limitation of Hyper-V, rather of the architecture of CPUs, and is identical in VMware. However CPU family is not the only limiting factor to allow live migrations; CPU properties are a factor too, and because of advancements in the technology it would generally not be possible to live migrate a VM from a host with an older CPU to a host with a newer CPU.
A few years ago VMware saw this as an issue, and along with Intel developed a technology called EVC, or Enhanced vMotion Compatibility. What EVC does is it masks the newer chipset features (generally multimedia signatures and things like that) from the VM, so that all of a sudden you can migrate between older and newer hosts (say, an Intel i7 to an Intel Core Duo). In VMware this is assigned at the Cluster level.
Of course the technology is simple enough, but the intellectual property is not. EVC has the word vMotion (a trademark) in the title. Microsoft cannot use the term vMotion. As such their compatibility mechanism (which works the same way) is called Migrate to a physical computer with a different processor version (MTPCWDPV). The name is not nearly as sexy as EVC, but they compensated by assigning it to the VM instead of the cluster. It is a simple checkbox that you check (or uncheck) under the Compatibility Configuration screen.
If you are going to be using Live Migration between hosts with potentially incompatible CPU then follow these steps:
- Within Hyper-V Manager click on the VM in question and then in the Action Pane (VM Name) click Settings…
- In the Navigation Pane click Processor, then click the + next to Processor to expand the tree.
- Click on Compatibility
- Click the checkbox Migrate to a physical computer with a different processor version.
- Click OK.
Following these simple best practices will not make you an expert in Hyper-V by any means, but it is a good start… what they will allow you to do is get started comfortably and play with the technology without hitting some of the more common stumbling blocks that beginners seem to run into. As your needs grow you will be comfortable enough with the technology to try new things, explore new possibilities. Before long you will be as virtualization expert, ready to tackle concepts such as Shared Nothing Live Migration, Failover Clustering, Cluster Shared Volumes, and much much more.
In the meantime dip your toes into the virtualization waters… it’s warm and inviting, the hazards are not too dangerous, and the rewards are incredible. In no time you will be ready to get certified… but even if that is not your goal you have already taken the first steps to becoming a virtual wiz!
Okay, I am asking for a show of hands: How many of you remember 100MB hard drives? 80? 40? While I remember smaller, my first hard drive was a 20 Megabyte Seagate drive. Note that I didn’t say Gigabytes…
Way back then the term Terabyte might have been coined already as a very theoretical term, but in the mid-80s most of us did not even have hard drives – we were happy enough if we had dual floppy drives to run our programs AND store our data. We never thought that we could ever fill a gigabyte of storage, but were happier with hard drives than with floppies because they were less fragile (especially with so many magnets about).
Now of course we are in a much more enlightened age, where most of us need hundreds of gigabytes, if not more. With storage requirements growing exponentially, the 2TB drives that we used to think were beyond the needs of all but the largest companies are now available for consumers, and corporations are needing to put several of those massive drives into SAN arrays to support the ever-growing database servers.
As our enterprise requirements grow, so must the technologies that we rely on. That is why we were so proud to announce the new VHDX file format, Microsoft’s next generation virtual hard drive files that has by far the largest capacity of any virtualization technology on the market – a whopping 64 Terabytes.
Since Microsoft made this announcement a few months ago several IT Pros have asked me ‘Why on earth would I ever need a single drive to be that big?’ A fair question, that reminds me of the old quote from Bill Gates who said that none of us would ever need more than 640KB of RAM in our computers. The truth is big data is becoming the rule and not the exception.
Now let’s be clear… it may be a long time before you need 64TB on a single volume. However rather than questioning the limit, let’s look at the previous limit – 2TB. Most of us likely won’t need 64TB any time soon; however over the last couple of years I have come across several companies who did not think they could virtualize their database servers because of 2.2TB databases.
Earlier this week I got an e-mail from a customer asking for help with a virtual to physical migration. Knowing who he reached out to, this was an obvious cry for help.
‘Mitch we have our database running on a virtual machine, and it is running great, but we are about to outgrow our 2TB limitation on the drive, and we have to migrate onto physical storage. We simply don’t have any other choice.’
As a Technical Evangelist my job is to win hearts and minds, as well as educate people about new technologies (as well as new ways to use the existing technologies that they have already invested in). So when I read this request I had several alternate solutions for them that would allow them to maintain their virtual machine while they burst through that 2TB ‘limit’.
- The new VHDX file format shatters the limit, as we said. In an upcoming article I will explain how to convert your existing VHD files to VHDX. The one caveat: if you are using Boot from VHD from a Windows 7 (or Server 2008 R2) base then the VHDX files are not supported.
- Storage Pools in Windows Server 2012 allow you to pool disks (physical or virtual) to create large drives. They are easy to create and to add storage to on the fly. I expect these will be among the most popular new features in Windows Server 2012.
- Software iSCSI Target is now a feature of Windows Server 2012, which means that not only can you create larger disks on the VM, you can also create large Storage Area Networks (SANs) on the host, adding VHDs as needed and giving access as BitLocker-encrypted Cluster Shared Volumes (CSVs), another new functionality of the new platform.
- New in Windows Server 2012, you can now create a virtual connection to a real Fibre Channel SAN LUN. As large a volume as you can create on the SAN is your limit – in other words if you have the budget your limit would be petabytes!
With all of these options available to us, the sky truly is the limit for our virtualization environments… Whether you opt for a VHDX file, Storage Pool, Software- or Hardware-SAN, Hyper-V on Windows Server 2012 has you covered. And if none of these are quite right for you, then migrating your servers into an Azure VM in the cloud offers yet more options for the dynamic environment, without the capital expenses required for on-premises solutions.
Knowing all of this, there really is no longer any reason to do a V2P migration, although of course there are tools that can do that. There is also no longer a good reason to invest in third-party virtualization platforms that limit your virtual hard disks to 2TB.
Adaptable storage the way you want it… just one more reason to pick Windows Server 2012!
Although it really is more complicated than this, Microsoft has broken the speed of a computer down to five components: CPU, RAM, graphics and gaming graphics, and hard drive speed. In Vista and then Windows 7 each of these was measured on a scale from 1.0-7.9. In Windows 8 this has been changed to a scale from 1.0 to 9.9.
If you upgrade your computer from Windows 7 to Windows 8 then you will notice that your WEI has dropped; that’s because Microsoft realizes that newer hardware is available, and the hardware that was top of the line three years ago is now a bit longer in the tooth.
Each of the measurements has its own subscore, but the truth is that the speed of your computer is determined by the slowest of these – i.e.: the bottleneck. So the Base Score of your computer – the one in the big blue square – is not a calculation or an average of the others, it is the lowest subscore from the five.
As you can see from the screenshot I took from my own laptop (an HP EliteBook 2740p) my Base Score is a 4.3. As a business user I don’t see a particular need to invest in a machine with high-end graphics (especially pricy in laptops). I don’t play games, and to watch the occasional movie all I need is a simple video card. I am more concerned with the CPU, RAM, and hard drive performance in my system, and with these subscores at 6.8 and 7.7 I am very pleased with the laptop’s performance.
If you would like to check your Windows Experience Index, there are a couple of ways to do it:
- Using the traditional method: In Windows Explorer right-click on Computer, click on Properties, and click on Windows Experience Index.
- In the Windows 8 Start Screen type ‘experience’ (or enough of the word for it to be recognized. Make sure you are in the Settings context, and click Use tools to improve performance.
From the Performance Information and Tools screen, click either Run the assessment or, if you have already run it previously, click Re-run the assessment. Remember, it will not work if you are running on battery power… you will have to plug in your laptops to run it! Also if you are running off a boot-from-VHD you can’t run it because the VHD performance interferes with the ability to measure the actual hard disk speed.
Windows 8 is faster than any operating system I have ever seen, even on legacy hardware. However on newer hardware it is going to be incredible; the only issue with that right now is that you are going to have to wait until October 26th to buy it!