Xen And The Art of Hypervisor Maintenance
One of the problems that I have with blog entries is always the title. This is always the bit that takes time and can spoil an entire blog post. Thanks to a friend of mine, I didn’t have a problem this time. She’d suggested the title for me, and it fits nicely. So, thank you Alex.
I’m not going to go through the installation & configuration procedure for Win2k12R2 here. I’m going to assume that, if you have reached this far, then you are already competent and familiar with server-side operations and I really don’t want to start teaching people to suck eggs (or anything else for that matter). Consequently, this part will concentrate on installing the Hyper-V management tools on Win2k12R2 and creating and managing a Microsoft virtual machine within a Microsoft virtual environment inside a Linux virtual environment.
Note: As with other parts of this blog entry, everything I do is done in the context of the way my system is set up. You may have a different set up but the basics are the same (well, at least they should be).
Originally, I created both the Win2k12R2 server (Holly) and the Hyper-V server (Hyperv) on a standard hard drive. Unfortunately, because I’m limited with CPU cores, I had to assign one core to Holly and two to Hyperv. This meant that Holly was reaaallly slowwww. Consequently I decided to move both servers over to the SSD I happened to have installed in my machine. The speed improvement was certainly noticeable. Fortunately, being LV’s in a volume group, moving them was relatively easy using existing commands and no external software required.
Final Server Configurations:
I decided to install Win2k12R2 Server called “Holly” and create a new forest & domain called “shortdale.local“. The server is configured with a 100Gb hard drive (LV on SSD), a single processor core, 4Gb RAM and the basic Active Directory and DNS (no DHCP required) and a static IP.
The last thing to install is the Hyper-V Management Tools from the “Add Roles & Features” Management option in Server Manager. The tools will enable remote management of the Hyper-V server.
Once the management tools have been installed, create a separate admin user (I’ve created ‘canderson‘) and then spin up Hyperv (while keeping Holly running). In this instance I’ve assigned Hyperv two processor cores and 4Gb RAM with a 100Gb hard drive.
Once Hyperv is running it needs to be joined to the domain, in this case my domain ‘shortdale.local’, via the local Hyper-V configuration. You’ll need to provide the admin user that was created earlier, in the format <domain\username>, to enable the server to join the domain.
Once the domain has been joined then the machine will need to reboot.
One thing to note here: If you are using a version of Hyper-V before 2012, it won’t be able to join a 2012 domain as Win2k12R2 defaults to Server 2012 domain level.
You can then add a local administrator (option 3). (I recommend using the admin user created earlier, eg my admin user is “shortdale\canderson”).
Once the Hyper-V server has been configured, the VNC/RDP session can be closed, leaving the server running. About the only time it will be needed is shutting down the server or making changes or running updates.
Hyper-V Management & VM Creation:
Back to Holly. Open the Hyper-V Server manager by opening the Tools menu in the Server Manager and selecting ‘Hyper-V Manager’.
This opens the Hyper-V Manager. At this point there are no VM’s set up and no virtual drives created.
Create a Virtual Hard Drive:
Before creating a VM and its hard drive you need to connect to the Hyper-V server. This is done by right-clicking on the Hyper-V Manager icon and selecting “Connect to Server”.
You can then type the server name in the connection box or browse its entry in the Active Directory, (its a member of the domain, remember):
Once connected, the server name will then appear as a sub-entry below “Hyper-V Manager”. The next step is to create the virtual hard drive.
Right-click on the server name and select ‘New’ and ‘Hard Disk’:
This will start the ‘New Virtual Hard Disk Wizard’:
Click ‘Next’ and select the format of the virtual drive you want to use. I chose VHD as it is compatible with most operating systems
Next, choose the type of drive. Usually, for testing purposes I use the fixed size drive.
Then we need to specify the name and location of the drive. The location specified is a location on the remote Hyper-V server, not the local server.
Lastly, as we are using a fixed drive, we need to specify the size of the drive. Remember, this cannot exceed the size of the LV, less the size of the server installation. You also have to allow for expansion of the operating system due to installation of applications, updates, etc. In this instance, with a LV of 100Gb, I chose a drive size of 50Gb.
Once this is complete, click ‘Next’ and check the summary to make sure that the settings are correct. If they are, then click ‘Finish’ and the hard disk will be created. Depending on the size of the disk, it can take a while, so you may as well go and make a cuppa, have a sandwich or read a book. Once it has finished, then the VM itself can be created.
In Part 11.10 we’ll go through the creation of the virtual machine itself, including memory requirements, processors, virtual DVD ISO files, and other hardware, and the installation of the final VM on top of everything