How to deploy a new VM on Hyper-V

Now that we’ve seen how to install and configure Hyper-V Server role on our Windows Server 2012 machine, it’s time to deploy a new Virtual Machine using our virtualization product. Note that by now you should have a Windows Server 2012 running Hyper-V. If you haven’t read the last article please read it here before proceeding with this post. All settings were discussed in the last article so please take some time and read it before proceeding with this post. Let’s say you’ve set up everything in our virtualization infrastructure and now you want to build your Virtual Servers that will host most of your company’s applications and services. In this article I will show you how to create and configure a new VM using Hyper-V. Once the VM has been turned on, the installation procedure for a Windows Server is identical to the operation that you’ve been familiar with for some time now.

Create a New Virtual Machine

Without any delays let’s open our Hyper-V console and create a new VM. You will need to navigate to your Hyper-V node, right click it and select New, Virtual Machine. You can also use the Actions menu from the right side of the panel:

Hyper-V Manager

You will need to set a name for the Virtual Machine and select its location if you haven’t configured a repository for your Servers:

New Virtual Machine Wizard

Specifying Generation and the Amount of Memory

In the following section you will have to select one of the two available VM generations. The first generation was introduced in previous versions of Hyper-V and this was the only one available until now.

Virtual Machine - Specify Generation

The second generation brings some new features while dropping older ones. The new generation has a different firmware and new devices. For example, instead of the PCAT Bios used in the first generation, this new technology uses a UEFI firmware. It also dropped the IDE controller, S3 Video, floppy controller, i8042 keyboard controller, PS/2 mouse, the Programmable Interrupt Timer (PIT), the Programmable Interrupt Controller (PIC), the Super I/O device. Instead of all these older features, new devices were added with increased capabilities. I’m not familiar with some of these technologies so instead I will give you a reference link to an interesting article describing Hyper-V generation 2 VM. The security component has been revised and the new generation of VMs has a lower attack surface. Note that you cannot change the generation of your Virtual Machine once you’ve deployed the Server.

You will have to set the amount of memory that your new Server will use. For demonstration purposes I will create a VM with 512 MB of RAM since I’m already using a VM running Hyper-V and I have hardware limitations.

Virtual Machine - Assign Memory

Network Configuration

An important step when creating a new VM is the networking configuration part. You will need to select a device that will bind to the VM network adapter. You can select a virtual switch connected to your physical interface or create a new virtual switch. We’ve talked about these components in a previous article.

Virtual Machine - Configure Networking

Connecting a Storage Device

A storage device must be connected to your Virtual Machine. You have three methods available: create a new virtual hard disk, use an existing virtual hard disk or attach a virtual hard disk later. I will choose the first option and create a new 10 GB virtual hard drive on my local disk.

Virtual Machine - Connect Virtual Hard Disk

Choosing an Installation Option

In the last part of this operation you will need to choose an installation option from the following:

Install an operating system later

Install an operating system from a bootable image file

Install an operating system from a network-based installation server

Based on your needs you can further proceed with the OS Installation. I want to show you how to deploy a new Server using WDS once you’ve created a new Virtual Machine using Hyper-V so I will not install the Operating System right now.

Virtual Machine - Installation Options

Virtual Machine Summary

At the end of the Wizard there is a summary of the new Virtual Machine, make sure that everything is correct and proceed with the VM creation. Your new Server will appear in the Hyper-V Manager console, you can now start the Server by clicking the Start button from the Actions menu.

Virtual Machine - Hyper-V Manager Console

The whole process can be completed much faster using Windows Powershell. Hyper-V module is added to Powershell when you install this Server Role. Open up Powershell and type Get-Module -ListAvailable to view the modules available on your Windows Server. Now type Import-Module Hyper-V and then Get-Command -Module Hyper-V to view all available commands. To create a new VM you’ll need to use the New-VM cmdlet. Check out its help page by typing get-help New-VM -full. To create an identical machine as the one we’ve created earlier, you will need to type in the following:

New-VM -Name “Server2” -ComputerName SRV2 -Path C:\VM\Server2 -MemoryS

tartupBytes 512MB -NewVHDPath C:\VM\Server2\Server2.vhdx -NewVHDSizeBytes 10GB -Generation 2

Hyper-V Manager Windows Powershell

That’s about it for this article folks, I hope we’ve covered all major aspects of VM creation in Hyper-V. We will talk about this technology in future articles that’s why I hope this one will serve you well in learning new things about Hyper-V. Wish you all the best!

You can learn more about Dan Popescu by visiting him on Google+


Posted

in

, , , ,

by

Tags: