Feed aggregator

Reading Hyper-V Event logs with PowerShell

Virtual PC Guy - Jue, 23/01/2014 - 18:03

Here is a handy tip – it is quite easy to gather any information that Hyper-V puts in the event log from PowerShell.

You can get all Hyper-V related events by running:

Get-WinEvent -FilterHashTable @{LogName ="Microsoft-Windows-Hyper-V*"}

But I would not recommend that, as you will get a lot of events!  What is more useful is just displaying any error messages that were logged in the last 24 hours – with a command like this:

Get-WinEvent -FilterHashTable @{LogName ="Microsoft-Windows-Hyper-V*"; StartTime = (Get-Date).AddDays(-1); Level = 2}

Alternatively – you can look at the warnings with this command:

Get-WinEvent -FilterHashTable @{LogName ="Microsoft-Windows-Hyper-V*"; StartTime = (Get-Date).AddDays(-1); Level = 3}

Which gives an output like this:

Cheers,
Ben

Categorías: Virtualización

Using PowerShell to Update Integration Components with SCVMM

Virtual PC Guy - Mié, 22/01/2014 - 19:24

Given that the process for updating integration components in System Center Virtual Machine Manager has been optimized for large scale operations – and obvious question is: how do I script this?

The answer is quite simple.  All you need to do is to get the virtual machine object and run:

Set-VM –VM $vm –InstallVirtualizationGuestServices $TRUE –RunAsynchronously

Here is an example of me running it on my server:

Note that you will need to stop the virtual machine first (if it is running) before calling this command.

Cheers,
Ben

Categorías: Virtualización

Updating Integration Services with SCVMM

Virtual PC Guy - Mié, 22/01/2014 - 00:28

As a Hyper-V program manager, I am very familiar with the process for upgrading virtual machines using Hyper-V.  But I also often get questions about how you do this through System Center Virtual Machine Manager – and why the experiences are different.

How you do it is easy enough – right click on the virtual machine and select Install Virtual Guest Services.  But there are some key things to know that catch some people off guard.

The biggest one is this:  you cannot update the integration services with SCVMM while the virtual machine is running.

Here you can see that I have bought up the contextual menu on a running virtual machine, and the install virtual guest services option is disabled:

If I shutdown the virtual machine first, and try again – you will see that the option is enabled:

If I select to install virtual guest services at this point in time, SCVMM will go ahead and do so with no further input from me.

But why does SCVMM require that the virtual machine is off (when Hyper-V does not)?  The short answer is because the in-box Hyper-V tools and SCVMM were designed for very different users.

The in-box Hyper-V tools do not require you to turn off the virtual machine in order to update the integration components, which is nice, but they do require you to login to the virtual machine in order to complete the installation process.  This makes sense when you are managing a handful of virtual machines on a single server – but it does not scale to hundreds of virtual machines across multiple physical servers.

SCVMM handles integration component update by mounting the virtual hard disk and performing an offline installation of the integration components.  While this does require that the virtual machine is turned off first, it makes it much easier to perform on large sets of virtual machines.

Cheers,
Ben

Categorías: Virtualización

Update: Capacity Planner for Hyper-V Replica

Virtualization Team Blog - Mar, 21/01/2014 - 17:54

In May 2013, we released the first version of the Capacity Planner for Hyper-V Replica on Windows Server 2012. It allowed administrators to plan their Hyper-V Replica deployments based on the workload, storage, network, and server characteristics. While it is always possible to monitor every single perfmon counter to make an informed decision, a readymade tool always makes life simpler and easier.

The big plus comes from the fact that the guidance is based on actual workload and server characteristics, which makes it a level better than static input-based planning models. The tool picks the right counters to monitor, automates the metrics collection process, and generates an easily consumable report.

The tool and documentation have been updated for Windows Server 2012 R2 and can be download from here: http://www.microsoft.com/en-us/download/details.aspx?id=39057 

What’s new

We received feedback from our customers on how the tool can be made better, and we threw in a few improvements of our own. Here is what the updated Capacity Planner tool has:

  1. Support for Windows Server 2012 and Windows Server 2012 R2 in a single tool
  2. Support for Extended Replication
  3. Support for virtual disks placed on NTFS, CSVFS, and SMB shares
  4. Monitoring of multiple standalone hosts simultaneously
  5. Improved performance and scale – up to 100 VMs in parallel
  6. Replica site input is optional – for those still in the planning stage of a DR strategy
  7. Report improvements – e.g.: reporting the peak utilization of resources also
  8. Improved guidance in documentation
  9. Improved workflow and user experience

In addition, the documentation has a section on how the tool can be used for capacity planning of Hyper-V Recovery Manager based on the ‘cloud’ construct of System Center Virtual Machine Manager.

 

So go ahead, use the tool in your virtual infrastructure and share your feedback and questions through this blog post. We would love to hear your comments!

28-Feb-2014 update:  Keith Mayer has an excellent guided hands-on lab demo that can be found here.

Categorías: Virtualización

Network Recommendations for a Hyper-V Cluster in Windows Server 2012

Virtualization Team Blog - Dom, 19/01/2014 - 15:23

We recently published a TechNet document http://technet.microsoft.com/library/dn550728.aspx which provides guidance on configuring your network for a Hyper-V Cluster in Windows Server 2012.

A snip of the summary from the document:

Windows Server 2012 supports the concept of converged networking, where different types of network traffic share the same Ethernet network infrastructure. In previous versions of Windows Server, the typical recommendation for a failover cluster was to dedicate separate physical network adapters to different traffic types. Improvements in Windows Server 2012, such as Hyper-V QoS and the ability to add virtual network adapters to the management operating system enable you to consolidate the network traffic on fewer physical adapters. Combined with traffic isolation methods such as VLANs, you can isolate and control the network traffic.

There are some major improvements from the Windows Server 2008 R2 guidance and there is a lot of emphasis on converged networking. The document also provides a practical example which isolates different kinds of traffic and assigns bandwidth ‘weight’.

Categorías: Virtualización

GA of Hyper-V Recovery Manager (HRM)

Virtualization Team Blog - Vie, 17/01/2014 - 05:26

We are excited to announce the General Availability of Hyper-V Recovery Manager or HRM for short. HRM is an Azure hosted service which orchestrates the protection and recovery of virtual machines in your datacenter. Hyper-V Replica replicates your virtual machines from your primary datacenter to your secondary datacenter. To re-emphasize, your VMs are not replicated to Windows Azure. HRM is a service hosted in Azure which acts as the “control plane”.

The high level solution is as follows:

A step by step guide on setting up HRM is available @ http://www.windowsazure.com/en-us/documentation/articles/hyper-v-recovery-manager-configure-vault/

If you have questions on HRM, visit the TechNet forum @ http://social.msdn.microsoft.com/Forums/windowsazure/en-US/home?forum=hypervrecovmgr

Pricing, SLA details for the service is available @ http://www.windowsazure.com/en-us/pricing/details/recovery-manager/

Brad Anderson’s blog on HRM - http://blogs.technet.com/b/in_the_cloud/archive/2014/01/16/announcing-the-ga-of-windows-azure-hyper-v-recovery-manager.aspx – provides more details on the solution.

Categorías: Virtualización

Azure placed as leader by Gartner in Enterprise Application Platform as a Service!

The Official Microsoft IIS Site - Jue, 16/01/2014 - 00:24
Windows Azure has been growing and improving at a very rapid pace, and looks like our efforts are starting to get recognized and appreciated. The most recent sign of this is being classified as “leader” by Gartner in their Q1 2014 Magic Quadrant report. In fact, the Leader quadrant has only two companies – Azure and SalesForce, so we are definitely in good company! The report by Yefim V. Natis, Massimo Pezzini, Mark Driver, David Mitchell Smith, Kimihiko Iijima and Ross Altman also lists Windows...(read more)

Checking Integration Services Versions with SCVMM

Virtual PC Guy - Mié, 15/01/2014 - 19:55

I have done a number of posts about checking your integration services versions in the past (here and here for example).  But this have all been written using the in-box Hyper-V management tools.  Now that I have SCVMM up and running in my house, I thought I would give a quick run through of how to do this with SCVMM.

The fist thing to point out is that you can just see this directly in the SCVMM UI by choosing to display the VM Additions column:

You can also get this information through PowerShell by running:

Get-SCVirtualMachine | Select Name, VMAddition

(Note, in the screenshot above I am filtering the results to not include Hyper-V Replica recovery virtual machines).

Cheers,
Ben

Categorías: Virtualización

SCVMM, Hyper-V Replica, UI and PowerShell

Virtual PC Guy - Mar, 14/01/2014 - 19:45

Before I get started on this – I do want to be upfront about the context for this post.  In my house I am currently running Hyper-V Server 2012 R2 with Hyper-V Replica enabled.  I am then managing my environment with System Center Virtual Machine Manager 2012 R2.

I am not (yet) using Hyper-V Recovery Manager (http://www.windowsazure.com/en-us/services/recovery-manager/).

Now, if you are unfamiliar with the story here.  Hyper-V Recovery Manager is our official solution for managing Hyper-V Replica with System Center.  This means that I am not doing things “by the book” right now (why?  Because there are only so many hours in the day and this is actually all stuff that I do in my spare time!).

So what is the experience if you are using Hyper-V Replica with System Center Virtual Machine Manager 2012 R2 without Hyper-V Recovery Manager?  In short, not bad.

SCVMM has no support for configuring or orchestrating Hyper-V Replica directly.  I am currently using Hyper-V manager to do that.  It does, however, detect that Hyper-V Replica has been configured and allows me to view the replication health in the SCVMM UI.  There is one annoyance I have found with this configuration:

This is a screenshot of my SCVMM console.  As you can see it has all of my virtual machines and all of their replicas.  I do not have it displayed here – but I can also add a column that shows the replication health.  Unfortunately, there is no way for me to tell which virtual machines are the primary virtual machines and which are the replicas.  Annoying. 

For the most part I can figure this out intuitively (the primary virtual machine is the one that is running!) But if I have a virtual machine that is turned off (like my TS Gateway in the above screenshot) I have not figured out how to tell the primary from the replica using the SCVMM UI.

PowerShell is much better though.

Here it is very easy to tell the virtual machines apart.  Let’s say I wanted to get the primary TS Gateway virtual machine – I would use this command:

$VM = Get-SCVirtualMachine "TS Gateway” | ?{$_.IsPrimaryVM}

Similarly, to get the replica virtual machine I would run:

$VM = Get-SCVirtualMachine "TS Gateway” | ?{$_.IsRecoveryVM}

Nice and simple.

Hopefully I will find the time to setup Hyper-V Recovery Manager soon (after updating my VPN server, setting a new blog site, getting a new mail server up and running, getting the Windows Azure pack loaded…  This may take a while!)

Cheers,
Ben

Categorías: Virtualización

Targeting Group Policy at Hyper-V VMs

Virtual PC Guy - Lun, 13/01/2014 - 19:21

I make heavy use of group policy in my home environment.  It makes it very easy to push out defaults to all of my various computers and virtual machines.  However, there are times when I have a setting that I only want applied to virtual machines.  Luckily this is somewhat simple to do.  You need to open the Group Policy Management console and go to the WMI Filters section.

Here you will want to create as many filters as make sense for your environment (as you can see, I have filters that divide my systems into physical and virtual as well as desktop or server).

Once you have created a filter you will want to add the following WMI filter to target virtual machines:

SELECT * FROM Win32_ComputerSystem WHERE Model = "Virtual Machine"

Finally, associate this filter with the group policy that you want applied to virtual machines in your environment.

Some quick notes:

  • This will only target Hyper-V virtual machines.  If you are using a different virtualization platform you will need to find out what model string that platform returns.
  • To create a group policy that only targets physical computers, just change the ‘=’ to ‘!=’ in the WMI query

Cheers,
Ben

Categorías: Virtualización

Virtual Machine Stop Action in a Cluster

Virtual PC Guy - Vie, 10/01/2014 - 19:04

One of the interesting philosophical debates on the Hyper-V team is “What is the right thing to do when a user stops a clustered virtual machine?”.  Some of us believe that if the user asked to stop the virtual machine – then we should stop the virtual machine (which is what we do by default).  But others believe that if the virtual machine is clustered, it should be restarted automatically, in order to deliver the highest uptime (this is actually what we used to do in the first release of Hyper-V).

What most people do not realize is that this is actually something that you can configure.  To do this you need to:

  1. Open the Failover Cluster Manager
  2. Go to Roles and select the virtual machine in question
  3. Change to the Resources tab at the bottom of the screen
  4. Select the Virtual Machine resource, right click on it, and select Properties
  5. Change to the Settings tab of the properties dialog
  6. Configure the Virtual machine stop action
    1. If you want the virtual machine to stay off if a user turns it off, select Take resource offline until virtual machine restarts.
    2. If you want the virtual machine to restart automatically select Mark resource as failed.

Note, no matter what setting you choose – stopping a virtual machine through the failover cluster manager will stop the virtual machine.  This setting effects what happens when someone uses Hyper-V Manager or Hyper-V PowerShell to stop a virtual machine.

Cheers,
Ben

Categorías: Virtualización

Configuring IIS Smooth Streaming and Application Request Routing Disk Caching.

The Official Microsoft IIS Site - Vie, 10/01/2014 - 11:14
  I recently worked with a customer who was looking at using IIS Smooth Streaming as their Content Distribution mechanism. They also wanted to use ARR Disk Caching to cache the content on the ARR Tier to prevent round trips to the Smooth Streaming Server. (Editors note: This was all pre-recorded content and so caching is a good idea. For Live Streaming you may not want to cache traffic.) So I configured 2 Servers with IIS Media Services 4.1 and set them up with the Big Buck Bunny content. http...(read more)

Disabling VM heartbeat monitoring for a clustered VM

Virtual PC Guy - Jue, 09/01/2014 - 19:04

A Microsoft support engineer recently contacted me with an interesting problem.  They were working with a customer who had an application that was having problems.  They had been trying to diagnose the problem – and had gotten to the point where they had decided that they wanted to get a crash dump from the virtual machine and analyze it.

The problem they were then hitting was that the virtual machine was clustered, and whenever they would try to gather a crash dump, Windows Failover Clustering would detect that the guest operating system had crashed and would restart the virtual machine on another node in the cluster.

Normally, this is exactly what you want to happen.  But in this case it was a problem.

Fortunately, there is a relatively simple way to disable this specific functionality.  What you need to do is:

  1. Open the Failover Cluster Manager
  2. Go to Roles and select the virtual machine in question
  3. Change to the Resources tab at the bottom of the screen
  4. Select the Virtual Machine resource, right click on it, and select Properties
  5. Change to the Settings tab of the properties dialog
  6. Uncheck Enable heartbeat monitoring for the virtual machine and click OK

You should be careful about changing this setting though.  As once you do, clustering will no longer respond to actual guest operating crashes either.

Cheers,
Ben

Categorías: Virtualización

Claudia, the cloud girl from Japan.

The Official Microsoft IIS Site - Jue, 09/01/2014 - 18:21
If you go into a Japanese bookstore, and browse the tech section, you might run into this title – WordPress on Windows Azure: Who is this lovely lady, you might ask yourself…well, meet Claudia Madobe , the cloud girl (her last name means “Window-sill” in Japanese). Claudia was created by Tokura Aya , a tech evangelist from Microsoft Japan with the purpose of helping tell the story of Windows Azure. The book itself is about 160 pages of guidance on using Windows Azure Web Sites to quickly and easily...(read more)

Virtual Machines not shutting down on host shutdown in Windows Server 2012 R2

Virtual PC Guy - Mié, 08/01/2014 - 19:04

Just wanted to let everyone know of a fix for Hyper-V that was included in the November 2013 update rollup for Windows Server 2012 R2 (http://support.microsoft.com/kb/2887595).

The fix in question (http://support.microsoft.com/kb/2896800) applies to Hyper-V servers that:

  • Are not part of a cluster
  • Have had the virtual machine automatic stop action changed from save state to shutdown

Without this fix Hyper-V will turn off a virtual machine (instead of cleanly shutting it down) when the physical computer is shutdown.  With this fix the virtual machine will now be shutdown correctly.

Cheers,
Ben

Categorías: Virtualización

Automatic Virtual Machine Activation in Windows Server 2012 R2

Virtual PC Guy - Mar, 07/01/2014 - 19:04

Automatic virtual machine activation is an easy to miss, but really handy feature in Windows Server 2012 R2.

One of the primary reasons why people buy Windows Server Datacenter today is because it gives them license to run an unlimited number of Windows Server instances inside of virtual machines.  However, you have still needed to manage Windows keys when doing this in the past.

Automatic virtual machine activation means that this is no longer necessary – Windows Server inside a virtual machine is now able to activate against Windows in the host operating system, if it is running an activated version of Windows Server Datacenter.

You can read all about this feature here:

http://technet.microsoft.com/en-us/library/dn303421.aspx

One important thing to know is that if you are installing Windows in a virtual machine, on a system that supports automatic virtual machine activation, and you get asked for a product key – you should use one of the AVMA keys.  They are as follows:

Edition AVMA key Windows Server 2012 R2 Datacenter Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW Windows Server 2012 R2 Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V Windows Server 2012 R2 Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2

Cheers,
Ben

Categorías: Virtualización

Adding Mime Types to your Windows Azure Web Site

The Official Microsoft IIS Site - Mar, 07/01/2014 - 16:00

Have you ever noticed that some existing content is not serving from your Azure Web Site and returns the following message

“The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”

One reason this may occur is due to missing MimeTypes.

To see if this is the case Enable Detailed Error Messages  in Site Diagnostics

After reproducing the issue gather the LogFiles/DetailedErrors folder for your site .

For A Mime Type issue you  will see that his is  404.3 error

In the above error I purposely omitted the “Things you can try” section as this applies to on premise IIS and in Web Sites you cannot run APPCmd.exe to add settings

Instead you can simply add this to the  web config . Here is any example for .woff extensions which I see quite often in Azure Web Site deployments

Add the following to the  <system.webServer>  section of your web.Config.

<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
</staticContent>

Note : If the <staticContent> element already exists you just need to add the <mimeMap> element  to this section for the type you want to add

 

 

Local VM Management on Hyper-V Server with FreeRDP

Virtual PC Guy - Lun, 06/01/2014 - 19:04

A couple of weeks ago I blogged about the Veeam RDP virtual appliance for Remote Management of Hyper-V Server.  Since then I have been inundated with questions, opinions and information about different solutions for managing a Hyper-V server.  I have been spending some time looking at the various options – and one of my favorites has been FreeRDP.

To give some more context – if you are using the free version of Hyper-V Server (you can download it from here: http://technet.microsoft.com/en-us/evalcenter/dn205299.aspx) you can use the Hyper-V management tools remotely from a full installation of Windows.  But if you login locally to the server all you have is PowerShell.

Now, you can do almost everything through PowerShell.  Almost.  The one thing you cannot do is interact with a virtual machine directly.  Luckily – FreeRDP is a simple project that, amongst other things, supports connecting to Hyper-V virtual machines.

To test this out – I created a new Hyper-V Server – and attempted to create and configure the server without using any remote management tools.  After doing the initial server configuration – I used PowerShell to create a virtual switch:

get-netadapter | new-vmswitch -name "Virtual Switch" -AllowManagementOS $true

(Note, my server only had a single network adapter – so I cheated and made this command simple).

Then I created and started a virtual machine:

New-VM -Name "Test 1" -MemoryStartupBytes 1GB -Generation 1 -BootDevice LegacyNetworkAdapter -Path "C:\VMs\Test 1" -SwitchName "Virtual Switch" -NewVHDPath "C:\VMs\Test 1\VHD.vhdx" -NewVHDSizeBytes 40GB

Start-VM "Test 1"

Now we come to the part where I usually need to use a remote management solution.  I downloaded a Windows version of FreeRDP from here: http://www.cloudbase.it/freerdp-for-windows-nightly-builds/ and copied it to C:\FreeRDP on my Hyper-V Server.  To use FreeRDP to connect to a virtual machine – you need to know the virtual machine ID number.  To get this I ran:

Get-VM "Test 1" | Select ID

Which gave me a virtual machine ID of a0a23c9b-11ec-4740-82c5-2e0cf55674f4 (you will get a different one for your virtual machines). Then I  ran:

C:\FreeRDP\wfreerdp.exe /v:localhost:2179 /vmconnect:a0a23c9b-11ec-4740-82c5-2e0cf55674f4

Which worked!

However, I wanted a more elegant solution than this.  So I decided to write a script Cmdlet that would allow me to just provide the virtual machine name that I wanted to connect to:

function Start-VMConnect {   [CmdletBinding()] param ( # CMDLet takes a single parameter of VMNames. # Can be single or plural, can come from the pipeline.   [Parameter(Mandatory=$True,ValueFromPipeline=$True)]$VMnames )   begin { # Path to the binary for FreeRDP   $FreeRDPPath = "C:\FreeRDP\wfreerdp.exe" }   process { foreach ($VMname in $VMnames) { if ($pscmdlet.ShouldProcess($VMname)) { # Get the ID of the virtual machine # If a VM object has been provided - grab the ID directly # Otherwise, try and get the VM object and get the ID from there   if ($VMname.GetType().name -eq "VirtualMachine") {$VMID = $VMname.ID} else {$VMID = (get-vm $VMname | Select -first 1).ID}   # Start FreeRDP start-process $FreeRDPPath -ArgumentList "/v:localhost:2179 /vmconnect:$($VMID)" } } }   end {} }

This Cmdlet (Start-VMConnect) takes either a virtual machine name or a virtual machine object and then connects to it with FreeRDP.  As this is actually a script Cmdlet – you need to use Import-Module to load it:

Once it is loaded you can just use Start-VMConnect and connect to the virtual machine:

Very cool!  I liked this option most of everything I tried – as it was the smallest / lightest weight solution that solved all the problems that I had.

Thanks to Alessandro Pilotti, from Cloudbase Solutions, who gave me the pointers to this solution.

Cheers,
Ben

P.S. Here is a copy of my script Cmdlet:

Categorías: Virtualización

Windows Azure Web Sites (WAWS) - Collecting dumps of the worker process (w3wp.exe) automatically whenever a request takes a long time

The Official Microsoft IIS Site - Lun, 06/01/2014 - 17:42

Websites being slow is perhaps the most common problem every website administrator, and developers run into. If they are extremely unlucky, then see this problem only in their production environment. Many troubleshooting techniques, best practices are available for this scenario. I will try to cover them in a different post as a part of my ASP.NET Troubleshooting series some other time. Meanwhile, you can try looking at this post of mine, where I’ve something that might help you.

For now, let’s focus on Windows Azure Web Sites. As you know this is a closed (well, not completely) hosting environment, and still there are a few things that you can do for this problem – for example, you can try collecting FREB traces for a long running request, and see where it is stuck.

Read the complete post here.

Accessing Hadoop Logs in HDInsight

The Official Microsoft IIS Site - Lun, 06/01/2014 - 17:00
One of the questions the HDInsight team sees a lot is a variation of the question “How do I figure out what went wrong when something does go wrong?” If you are familiar with Hadoop, you are probably also familiar with rolling up your sleeves and digging into Hadoop logs to answer this question. However, we’ve found that many folks using HDInsight don’t know that much of the logging information they are accustomed to using is easily available to them for HDInsight clusters...(read more)
Distribuir contenido