This collection of two 2-hour online clinics and an 1-hour online clinic provides IT Professionals experienced in Windows 2000 Server or Windows Server 2003 with the knowledge and skills to implement and manage virtualization technologies.

Topics covered in the clinic within the collection include:•Introduction to Microsoft System Center Virtual Machine Manager 2008

We invite you to join the Microsoft Assessment and Planning (MAP) Beta program! As
a MAP Beta program member you have the opportunity to test drive the next
version of MAP—version 6.0! MAP 6.0 Beta includes some exciting new features to
help you accelerate the adoption Microsoft private and public cloud platforms.
Give the tool a try and let us know what you think!

MAP 6.0 Beta: Accelerate the adoption of Microsoft private and public cloud
platforms

Planning your journey to the cloud just got a bit easier. The next release of the
Microsoft Assessment and Planning (MAP) Toolkit—version 6.0 Beta—includes
assessment capabilities to evaluate workloads for both public and private cloud
platforms. With MAP 6.0 Beta, you now have the ability to identify workloads and
estimate the infrastructure size and resources needed for both Windows Azure and
Hyper-V Fast Track. Also new to MAP 6.0 Beta is the Office 365 client
assessment, enhanced VMware inventory, and Oracle schema discovery and
reporting. Expanded assessment and discovery capabilities from MAP help you
streamline planning for your next migration project. Plan what’s next with
MAP.

New features and benefits from MAP 6.0 Beta release help you:

· Analyze
your portfolio of applications for a move to the Windows Azure
Platform

I have received a number of questions about how to go about setting up remote management of our free Hyper-V server (not the one that is part of Windows). So I thought I would sit down and write up a set of blog posts to talk about how to do this. Today I am going to talk about how to remotely manage a Hyper-V server from a Windows 7 desktop when in a workgroup environment.

I am going to assume that you have already installed Hyper-V server and have configured the server name, workgroup name and networking appropriately (in my case – the server name is “Server1” and the workgroup name is “WORKGROUP” – not very original, I know). Also, I am not going to be talking about the other aspects of setting up a Hyper-V server (e.g. configuring automatic updates, enabling remote desktop, etc…). I am just focusing on how to get remote management working.

Server Configuration

The first thing you will need to do is to go to the Hyper-V server and run SConfig.cmd (this is configured to run automatically when you log into a Hyper-V server – if you have changed this you can start it manually. It is in the Windows\System32 folder on the server). Once you are in SConfig.cmd you will need to:

Note that Server Manager Remote Management requires that you have PowerShell enabled first – so you cannot shuffle this ordering around to try and avoid the reboot.

Select option 5 to Return to main menu

Next, I am going to assume that you are not logged into your Windows 7 computer with the “Administrator” account (which is disabled by default) so you will need to create a second account on the Hyper-V Server. To do this you will need to go into SConfig and:

Select option 3 (Add Local Administrator)

When prompted for an account name – enter the user name that you are using on the Windows 7 desktop (in my case – “Benjamin”).

You will then be asked for a password – and again you should use the same password as you are using on the Windows 7 desktop (no – I am not going to tell you my password)

Next – to enable remote (but read-only) access with device manager – run this command from the command prompt as well: reg add HKLM\Software\Policies\Microsoft\Windows\DeviceInstall\Settings /v AllowRemoteRPC /t reg_dword /d 1 (once again that is a single command).

Finally you will need to restart the server one last time (you can use option 13 on the Sconfig menu).

In most workgroup configurations you will not have reliable name resolution for remote computers (i.e. you need to use the IP address). However – many of the server management tools require that name resolution be working reliably. If you are using a fixed IP address on the Hyper-V server – you can make this work by editing the “hosts” on the desktop computer (note – you can skip this step if you can ping the Hyper-V server using its name and have it resolve to an IP address correctly):

Open the Start menu

Click on All Programs and then on Accessories

Right click on Notepad and select Run as administrator

Once Notepad has opened, use the File menu to Open… a file

Navigate to the “Windows\System32\Drivers\etc” folder on the system drive

Change the file name option from Text Documents (*.txt) to All Files

Open the “hosts” file

At the end of this file – add an entry for your server. The format is basically the IP address of the server followed by the name of the server.

Save the file and exit Notepad.

(Here is the hosts file from my desktop – after I have modified it for my server)

You will need to enable the use of WinRM to connect to your Hyper-V server. To do this you will need to:

Open the Start menu

Click on All Programs and then on Accessories

Right click on Command Prompt and select Run as administrator

Type in winrm quickconfig and hit enter. You will then need to say ‘y’ (yes) to a couple of prompts

Type in winrm set winrm/config/client @{TrustedHosts=”RemoteComputerName”} and hit enter

Substitute “RemoteComputerName” with the name or IP address of your Hyper-V server. In my test environment my desktop computer could not resolve the name of my server – so I just opted to use the IP address. I could also have edited the hosts file on my desktop and used the server name.

While we are here – we should also open the firewall on the client side to allow us to remotely manage the servers storage by running this command: netsh advfirewall firewall set rule group=”Remote Volume Management” new enable=yes

Now you will need to use HVRemote to enable remote management of Hyper-V on the desktop computer.

You will be automatically prompted for the name of the server that you want to connect to.

After you enter your server name – you should have full access to manage your Hyper-V server:

The only caveat here is that Performance monitor still connects to the local computer. You can, however, add individual counters from the remote server one at a time. One thing that tripped me up on this issue is that after entering the server name you need to select the Select counters from computer: drop down and hit enter:

Using GUI interfaces like the Hyper-V Manager or System Center Virtual Machine Manager (SCVMM) makes managing Hyper-V quick and easy. However, many times you can do things more quickly if you have the right command line script ready to go. Or many times you have to use command line tools to manage Hyper-V if you want to trigger some action through a script. In this article, I will show you how to use Powershell to manage and configure Microsoft Hyper-V.

Installing Powershell

In order to manage Hyper-V from the command line, you will need Powershell. You can install it both on your Hyper-V server (to start testing on the local machine) and on your local PC (so that you can run Powershell commands to the server remotely). In my case, I just installed it on the server as that is where I will be demonstrating the Hyper-V Powershell commands.

When done, you should see Installation Succeeded and you can click Close.

Now when you go to Start – All Programs, you should see Windows Powershell and you can click on Windows Powershell underneath that.

Figure 2: Starting Powershell’s command line tool

At this point, you should have the distinctive Windows Powershell dark blue command line window up, like this:

Figure 3: Windows Powershell Interface

Before you actually move on to running commands, there is something else that you really want to get – the Hyper-V Powershell Library.

Downloading and Installing the Hyper-V Powershell Library

James O’Neill is the developer of the Powershell management library for Hyper-V and his library is invaluable when it comes to administering Hyper-V from the command line. To download and install it, go to the Powershell management library website above and get the Hyperv.zip file. It contains 2 files inside. Extract these to a simple directory you can get to easily at the command line, like C:\temp or make a directory like C:\powershell.

Unless you want to get into the digital signing of PowerShell scripts you can disable PowerShell security temporarily by doing:

Set-ExecutionPolicy unrestricted

Then, to load this new Hyper-V PowerShell Library you need to do this:

. c:\temp\hyperv.ps1

Notice the “dot” then “space” and then the full path to the Hyper-V PS1 file. That “dot space” is very important because that is what keeps this library in memory for the duration of this PowerShell session.

From here, you will be given a security warning an you must choose “R” to run this script. You should be rewarded with “VM Functions Loaded” and a list of all the commands that you are now enabled to run so that you can manage your Hyper-V Server from the PowerShell command line.

Here is what it looks like:

Figure 4: Installing the Hyper-V PowerShell Library

Now that our library is installed, let us find out how to use it.

Administering Hyper-V using the PowerShell Library

The Hyper-V PowerShell Library User Guide explains how to use the, almost 100, commands included in the library. And remember that each of these almost 100 commands has many parameters. Thus, this is a huge management library for Hyper-V, not just a handful of commands. Explaining how to all the commands goes beyond the scope of this article (and that is why there is a 41 page user guide).

That being said, let me show you how to use a handful of the basic commands in the Hyper-V PowerShell Library.

And keep in mind that, just with any commands you can perform at the command line, they become exponentially more powerful when combined with scripts that can use them intelligently.

Start-VM, Stop-VM, Suspend-VM, and Shutdown-VM – the purpose of these commands are obvious. All you need to provide is the VMElementName as it was shown in Figure 6.

Figure 6: Using the Start-VM command

New-VM – what is the quickest way to create a new guest VM? Just type New-VM and here is what you get, a new virtual machine that you still need to configure and start.

Figure 7: Creating a new virtual machine

Get-VMmemory– lists out all virtual machines on the host and their memory amount.

Figure 8: Get-VMmemory

Get-VMsnapshot

The Get-VMsnapshot command shows all snapshots created in your Hyper-V environment. When it comes to snapshots, you can also use commands like Update-VMsnapshot, New-VMsnapshot, Apply-VMsnapshot, Get-VMsnapshotTree, and Choose-VMsnapshot.

Conclusion

In conclusion, managing Hyper-V from the command line is essential for IT Admin. Doing it with PowerShell just gives you even more power. While you can manage Hyper-V with PowerShell without the PowerShell Management Library – who would want to? James O’Neills’s Powershell management library for Hyper-V is a huge gift for all of the virtualization admins who want to use PowerShell and Hyper-V. I encourage you to try this for yourself – it’s fun and easy.

Compared to the first release, which had a subset of the features available in the Windows Server 2008 edition, this new stand-alone Hyper-V seems to match the capabilities of its Windows-embedded counterpart (this post will be updated if we’ll receive different information). And this includes the most-wanted Live Migration capability.

Instead of having something less, this version of Hyper-V R2 has something more: the capability to boot from flash. This is a major new feature that Microsoft didn’t announce earlier and that may put Hyper-V side by side with VMware ESXi and Citrix XenServer in the OEMs pre-installation options.

Like the Windows-embedded version, Hyper-V Server 2008 R2 is free and will be released to the Microsoft partners through MSDN, TechNet and other distribution channels on August 6.