All posts filed under: Hyper-V

Configuring anti-affinity for Hyper-V virtual machines

If you have worked on VMware, you might already be aware of a concept of DRS rules. Using DRS rules, we can create VM anti-affinity rules so that no two virtual machines hosting similar application roles run on the same ESX host. For example, when you have a virtualized SQL mirror or a virtualized SQL failover cluster, it is critical to separate the SQL virtual machines participating in the application group onto different ESX hosts. This is where we can use VMware DRS rules – “Separate Virtual Machines” rule to be specific.

Windows 8, PowerShell 3.0, and all the goodness!

With Windows 8, I am more interested in managing / automating Microsoft Hyper-V with Windows PowerShell and hence, I will be focusing more on the Hyper-V cmdlets. So, in the coming days, you will see a bunch of blog posts explaining how to use Hyper-V cmdlets in Windows Server 8 to automate the virtual infrastructure.

Find all Hyper-V hosts and windows virtual machines in your AD environment

Several Microsoft products use Service Connection Points (SCP) to advertise themselves using objects stored in Active Directory. Clients query the directory to locate services. Microsoft Hyper-V, as I mentioned, also registers or publishes its information in AD as a service connection point. Now, we can use ADSI or AD cmdlets or Quest AD cmdlets to retrieve this information. To retrieve a list of all “Hyper-V hosts” in the AD environment, Using ADSI

Using Microsoft AD cmdlets

Using Quest AD cmdlets

The above methods retrieve the name of the computers running Hyper-V role. To retrieve a list of all “Windows Virtual Machines” in the AD environment, Using ADSI

Using Microsoft AD cmdlets

Using Quest AD cmdlets

This is it! If you observe the above code, I just changed the Name property alone to either “Microsoft Hyper-V” or “Windows Virtual Machine”. I tested the above commands only on Windows Server 2008 R2 and Windows Virtual machines only. I am not sure if Linux or other virtual machines running on Hyper-V get …

Auto generating VMConnect shortcuts for all Hyper-V virtual machines

I am sure this is one of the things written and read quite a bit. I just want to post my thoughts and how I try to simplify these things for me. I usually don’t write about anything that is not “my” content. As with all other things on this blog, I prefer automation and through this post I will provide a script that creates all the shortcuts for you automatically. If you don’t have the patience to read till the end of this post, click on the link below to access the script that generates these shortcuts. However, read the usage procedure for running the script towards the end of this post. [download id=”14″ format=”4″] What is this about? Coming to the subject of this post, I use Hyper-V at work and at home for various things. One thing I often need to do is access the console of these virtual machines. The usual (/boring) way to do that is to access Hyper-V Management console and then double-click on each virtual machine you need to access. …

Poor man’s P2V just got better; disk2VHD 1.1 is available

A week back I wrote about a new sysinternals tool called Disk2VHD. After the initial 1.0 release, many people have expressed the need for having command line support. Sysinternals team listened to all of this. They just released disk2vhd 1.1. You can now use the following options to perform p2v from command-line. Usage: disk2vhd <[drive: [drive:]…]|[*]> <vhdfile> Example: disk2vhd * c:\vhd\snapshot.vhd Where can you use this option? I can think of many possibilities. You can now use a simple script to walk through all of your systems in the data center and capture all physical hard drives as VHD files. Imagine being able to run this immediately after sysprep to capture the sysprep’ed system volume as VHD file. You can use that as a master image for both physical and virtual machines I will write about the second option sometime soon..Stay tuned.

Hyper-V: VHD Shell Extensions, updated release

I just posted a batch file wrapper around VHD Shell Extensions to find stale VHDs on a Hyper-V Server. However, because of VHDShellExt.vbs design, it will always try to find if the given VHD is associated with a VM on the local Hyper-V machine. One problem with this design is, you need to use the script on all the Hyper-V server machines you have to find any stale VHDs.  I have updated VHDShellExt.vbs to add /Server switch to be able to use it from a non Hyper-V system too. Now, using this new switch you can use the script from even a Windows Server 2003 or Windows XP system.  You can download the new release here Here is the updated documentation for this release