Virtualización

Hyper-V Links for Friday Night

Virtual PC Guy - Sáb, 17/07/2010 - 05:29
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/07/16/hyper-v-links-for-friday-night.aspx';

Well, the week is over so I thought I would quickly share some links.

Vijay has posted a great article on how to install the SP1 beta on our standalone Hyper-V Server product.  So now you really have no excuse to not be looking at dynamic memory / RemoteFX (both of which are supported on Hyper-V Server).

Meanwhile – the Virtualization launch page on TechNet (http://technet.microsoft.com/en-us/bb802511.aspx) has been updated with a “Hyper-V Tools” section that gives you pointers to a number of home grown tools from Microsoft for working with Hyper-V:

Cheers,
Ben

Categorías: Virtualización

Installing Service Pack 1 on Microsoft Hyper-V Server 2008 R2

Virtualization Team Blog - Vie, 16/07/2010 - 21:09

 With the release of Beta of Service Pack 1 for Windows Server 2008 R2 a number of you have asked about Service Pack 1 for the standalone Microsoft Hyper-V Server 2008 R2, and whether the new capabilities of Dynamic Memory and RemoteFX will be available for it. Absolutely, both Dynamic Memory and RemoteFX have been developed for Microsoft Hyper-V Server 2008 R2 as well.

 

In order to get these capabilities for the Microsoft Hyper-V Server 2008 R2, you will need to install the Beta of Service Pack 1 on Microsoft Hyper-V Server 2008 R2. Note that the first wave of the Service pack installer is only in 5 languages (English, French, German, Japanese and Spanish), so if you try and apply the package to Microsoft Hyper-V Server 2008 R2 (which has 11 language packs installed by default) you will rightly see the following screen

 

 

 

 It’s pretty simple to uninstall these language packs to thereafter install the Service pack. In order to uninstall the language packs, there is nifty utility included (lpksetup.exe). Launch this from an administrator’s command prompt and select “Uninstall display languages”.

On the next screen, select the all languages other than the five (English, French, German, Japanese and Spanish). Of course if you want to save some additional disk space, you can uninstall other languages as well and leave just the language that you use in your environment, Click next and let the tool do its job. Thereafter you can apply Service Pack 1. Enjoy!!

Vijay Tewari

Principal Program Manager, Windows Server Virtualization

Categorías: Virtualización

Update to private cloud toolkit for System Center

Virtualization Team Blog - Mié, 14/07/2010 - 18:43

Back in February we started working with partners and TAP customers on a toolkit to create private cloud environment.  See our February blog about the Dynamic Infrastructure Toolkit for System Center.

A couple updates were announced Monday at our Worldwide Partner Conference. First, the tool has a new name: System Center Virtual Machine Manager Self-Service Portal 2.0 (the portal). Second, we reached the release candidate milestone. You can download it here. A release candidate milestone means it’s feature complete, and is nearing completion. We expect the portal to be finalized and released to the web in calendar Q4.

You can read more about the self-service portal tool over at the System Center team blog (here). Here's an excerpt:

The self-service portal provides the following features that are exposed through a web-based user interface:

  • Configuration and allocation of datacenter resources: Store management and configuration information related to compute, network and storage resources as assets in the VMMSSP database.
  • Customization of virtual machine actions: Provide a simple web-based interface to extend the default virtual machine actions; for example, you can add scripts that interact with Storage Area Networks for rapid deployment of virtual machines.
  • Business unit on-boarding: Standardized forms and a simple workflow for registering and approving or rejecting business units to enroll in the portal.
  • Infrastructure request and change management: Standardized forms and human-driven workflow that results in reducing the time needed to provision infrastructures in your environment.
  • Self-Service provisioning: Supports bulk creation of virtual machines on provisioned infrastructure through the web-based interface.Helps business units to manage their virtual machines based on delegated roles

Patrick

Categorías: Virtualización

Dynamic Memory Resources

Virtual PC Guy - Mié, 14/07/2010 - 01:37
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/07/13/dynamic-memory-resources.aspx';

If you are thinking about trying out dynamic memory in the Windows Server 2008 R2 SP1 beta release – here are some handy resources to read before you get going:

Dynamic Memory Technical Overview whitepaper

This paper talks about what dynamic memory is, what it does and how it does it.  It is a good read for those curious to understand what is happening under the covers.

http://download.microsoft.com/download/E/0/5/E05DF049-8220-4AEE-818B-786ADD9B434E/Implementing_and_Configuring_Dynamic_Memory.docx

Hyper-V Dynamic Memory Evaluation Guide

This article steps you through the process of setting up SP1 and enabling dynamic memory.  It also gives you some good tips on configuration and troubleshooting.

http://technet.microsoft.com/en-us/library/ff817651(WS.10).aspx

Windows Server 2008 R2 Service Pack 1 – TechNet Center

For all things “Windows Server 2008 R2 Service Pack 1” related – the TechNet Center has you covered.

http://technet.microsoft.com/en-us/library/ff817647(WS.10).aspx

Hyper-V: Dynamic Memory Survival Guide

The TechNet Wiki also has a “Dynamic Memory Survival Guide” article with some extra links.

http://social.technet.microsoft.com/wiki/contents/articles/hyper-v-dynamic-memory-survival-guide.aspx

Cheers,
Ben

Categorías: Virtualización

Dynamic Memory Coming to Hyper-V Part 6…

Virtualization Team Blog - Mar, 13/07/2010 - 06:17

======================================================

Preamble: The point of this series, and the spirit in which it is written, is to take a holistic approach at the issues facing our customers, discuss the complexities with regard to memory management and explain why we’re taking the approach we are with Hyper-V Dynamic Memory. This isn’t meant to criticize anyone or technology, rather to have an open and transparent discussion about the problem space.

======================================================

In the past few blogs we’ve covered Page Sharing and Second Level Paging. Today, let’s dig into what we’re delivering with Hyper-V Dynamic Memory in Windows Server 2008 R2 SP1 as well as our free hypervisor Microsoft Hyper-V Server 2008 R2 SP1. So what is Dynamic Memory?

Dynamic memory is an enhancement to Hyper-V R2 which pools all the memory available on a physical host and dynamically distributes it to virtual machines running on that host as necessary. That means based on changes in workload, virtual machines will be able to receive new memory allocations without a service interruption through Dynamic Memory Balancing. In short, Dynamic Memory is exactly what it’s named.

Let’s dive in an explain how all this works starting with the new Dynamic Memory settings. Here are the new settings available on a per virtual machine basis. Here’s a screenshot:

Dynamic Memory In Depth

With Hyper-V (V1 & R2), memory is statically assigned to a virtual machine. Meaning you assign memory to a virtual machine and when that virtual machine is turned on, Hyper-V allocates and provides that memory to the virtual machine. That memory is held while the virtual machine is running or paused. When the virtual machine is saved or shut down, that memory is released. Below is a screenshot for assigning memory to a virtual machine in Hyper-V V1/R2:

With Hyper-V Dynamic Memory there are two values: Startup RAM and Maximum RAM and it looks like this:

Startup RAM is the initial/startup amount of memory assigned to a virtual machine. When a virtual machine is started this is the amount of memory the virtual machine will be allocated. In this example, the virtual machine will start with 1 GB.

The Maximum RAM setting is the maximum amount of memory that the guest operating system can grow to, up to 64 GB of memory (provided the guest OS supports that much memory). Based on the settings above, here’s an example of what the memory allocation could look like over a workday...

As you can see, the workload is dynamically allocated memory based on demand.

Next, let’s look at the Memory Buffer.

Memory Buffer: In one of the earlier blogs posts in this series, we discussed the complexity of capacity planning in terms of memory. To summarize, there is no “one size fits all” answer for every workload as deployments can vary based on scale and performance requirements. However, one consistent bit of feedback was that customers always felt more comfortable by providing additional memory headroom ‘just in case.’

We completely agree.

The point being you want to avoid a situation where a workload needs memory and Hyper-V has to start looking for it. You want some set aside memory as buffer for these situations, especially for bursty workloads.

The Dynamic Memory buffer property specifies the amount of memory available in a virtual machine for file cache purposes (e.g. SuperFetch) or as free memory. The range of values are from 5 to 95. A target memory buffer is specified in percentages of free memory and is based on current runtime memory usage. A target memory buffer percentage of 20% means that in a VM where 1 GB is used, 250 MB will be ‘free’ (or available) ideally for a total amount of 1.25 GB in the virtual machine. By default, Hyper-V Dynamic Memory uses a default buffer allocation of 20%. If you find this percentage is too conservative or not conservative enough, you can adjust this setting on the fly while the virtual machine is running without downtime.

This takes us to the last Dynamic Memory setting, Memory Priority.

Memory Priority: By default, all virtual machines are created equal in terms of memory prioritization. However, it’s very likely you’ll want to prioritize memory allocation based on workload. For example, I can see a scenario where one would give domain controllers greater memory priority than a departmental print server. Memory Priority is a per virtual machine setting which indicates the relative priority of the virtual machine's memory needs measured against the needs of other virtual machines. The default is set to ‘medium’. If you find that you need to adjust this setting, you can adjust this setting on the fly while the virtual machine is running without downtime.

 

Dynamic Memory Works Over Time With A Few VMs…

I’ve explained the per VM settings and shown how this would work with a single virtual machine, but how does Dynamic Memory work with multiple virtual machines? Below is an example to show just how Dynamic Memory works. I’ve kept this example simple on purpose to avoid confusion. Let’s assume I have a small server with 8 GB of memory. I’m going to run three virtual machines, one from Finance, Sales and Engineering. Each virtual machine is given the same settings: Startup RAM = 1 GB and Maximum RAM = 4 GB. With these settings, each virtual machine will start 1 GB and can grow up to 4 GB as needed.

Virtual Machine Start. On the left graphic below, you can see three virtual machines starting. Each virtual machine is consuming 1 GB of memory for Startup RAM. On the right graphic below, you can see the total amount of memory being used in the entire system ~3 GB.

15 minutes later. The Finance VM is running reports while the Engineering VM starts an analysis job. With Dynamic Memory, the Finance VM is allocated 3 GB of memory, the Engineering VM is allocated 2 GB of memory while the Sales VM remains at 1 GB. System wide, the server is now using 6 GB of its 8 GB or 75% of the total physical memory.

30 minutes later. The Finance VM is running reports while the Engineering VM starts an analysis job. With Dynamic Memory, the Finance VM is allocated 2 GB of memory, the Engineering VM is allocated 3.5 GB of memory while the Sales VM remains at 1 GB and a fourth VM, Service VM is started using 1 GB of memory. System wide, the server is now using 7.5 GB of its 8 GB of memory for VMs. At this point the server is fully allocated in terms of memory and is using its memory most efficiently.

 

At this point, the question I’m always asked is, “What now? What if a virtual machine still needs more memory? Does the parent start paging?”

No.

At this point, Dynamic Memory will attempt to reclaim pages from other virtual machines. However, in the absolute worst case where no free pages are available, the guest operating system will page as needed, not the parent. This is important because the guest operating system knows best what memory should and shouldn’t be paged. (I covered this back in Part 5...) Finally, when free memory does become available from other virtual machines, Dynamic Memory will move memory as needed.

Over-Subscription & the CPU Analogy

One argument we routinely hear is that there’s nothing wrong with over-subscription. Customers tell us that they take a bunch of physical servers, virtualize them and run the server with over-subscribed CPUs without issue, so why is this an issue with memory?

Great analogy, wrong conclusion.

Example 1: Suppose you are running 8 physical servers at 10% utilization, virtualize them and run those 8 virtual machines on a single server for a total of ~85% utilization. In this example, you’re not over-subscribing the CPU and the server still has 15% CPU headroom.

Over-subscription is this…

Example 2: Suppose you are running 8 physical servers at 50% utilization, virtualize them and run those 8 virtual machines on a single server. The single server would max out at 100% utilization, but because the workloads require ~400% utilization, performance would be terrible. What would you do? Move virtual machines to other servers of course to avoid over-subscription. In short, what you really want to do is maximize resource utilization to get the best balance of resources and performance.

That’s exactly what we’re doing with Hyper-V Dynamic Memory.

Customer Requirements & Dynamic memory

When it comes to virtualization and memory, virtualization users have repeatedly provided the following requirements:

  1. Use physical memory as efficiently and dynamically as possible with minimal performance impact. Customers investing in virtualization hosts are purchasing systems with larger memory configurations (32 GB, 64 GB, 128 GB and more) and want to fully utilize this system asset. At the same time, they’re purchasing this memory to provide superior performance and to avoid paging.
  2. Provide consistent performance and scalability. One frequent comment from virtualization users is that they don’t want a feature with a performance cliff or inconsistent, variable performance. That’s makes it more difficult to manage and increases TCO.

You got it. Here’s why we’ve chosen the path we have with Dynamic Memory.

  1. Dynamic Memory is truly a dynamic solution. Memory is allocated to virtual machines on the fly without service interruption based on policy.
  2. Dynamic Memory avoids significant performance penalties by not adding additional levels of paging which can significantly impact performance
  3. Dynamic Memory takes advantage of Large Memory Pages and is, in fact, optimized for Large Memory Pages
  4. Dynamic Memory is a great solution for virtualizing servers and desktops (BTW, Dynamic Memory works fine with SuperFetch)

Cheers,

Jeff Woolsey

Principal Group Program Manager

Windows Server & Cloud, Virtualization

P.S. Here are the links to all of the posts in this blog series:

Categorías: Virtualización

Dynamic Memory Beta – Supported Guest Operating systems

Virtual PC Guy - Lun, 12/07/2010 - 18:58


At TechEd this year we announced that dynamic memory would be supported for virtual machines that were running the following guest operating systems:

  • Windows Server 2003 Web, Standard, Enterprise & Datacenter (32-bit and 64-bit)
  • Windows Server 2003 R2 Web, Standard, Enterprise & Datacenter (32-bit and 64-bit)
  • Windows Server 2008 Web, Standard, Enterprise & Datacenter (32-bit and 64-bit)
  • Windows Server 2008 R2 Web, Standard, Enterprise & Datacenter (64-bit)
  • Windows Vista Enterprise & Ultimate (32-bit and 64-bit)
  • Windows 7 Enterprise & Ultimate (32-bit and 64-bit)

But not all of these operating systems will support dynamic memory with the beta release.  Only the following operating systems are supported with the beta release:

  • Windows Server 2003 Enterprise & Datacenter (32-bit and 64-bit)
  • Windows Server 2003 R2 Enterprise & Datacenter (32-bit and 64-bit)
  • Windows Server 2008 Enterprise & Datacenter (32-bit and 64-bit)
  • Windows Server 2008 R2 Enterprise & Datacenter (64-bit)
  • Windows Vista Enterprise & Ultimate (32-bit and 64-bit)
  • Windows 7 Enterprise & Ultimate (32-bit and 64-bit)

The following guest operating systems will be supported after the beta release:

  • Windows Server 2003 Web & Standard (32-bit and 64-bit)
  • Windows Server 2003 R2 Web & Standard (32-bit and 64-bit)
  • Windows Server 2008 Web & Standard (32-bit and 64-bit)
  • Windows Server 2008 R2 Web & Standard (64-bit)

Cheers,
Ben

Categorías: Virtualización

Windows Server 2008 R2 SP1 Beta now available

Virtual PC Guy - Lun, 12/07/2010 - 18:28
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/07/12/windows-server-2008-r2-sp1-beta-now-available.aspx';

Starting today you can download the Windows Server 2008 R2 SP1 beta release.  For Hyper-V this specifically means that you can start evaluating the following new Hyper-V features:

  • Dynamic Memory – the new feature that allows Hyper-V to dynamically change the amount of memory assigned to a virtual machine at run time, to get higher consolidation ratios.  I spoke about this at TechEd US 2010 – and you can watch the movie here.
  • RemoteFX – provides support for rich graphics (Silverlight, 3D, etc…) when using Hyper-V to host desktop virtual machines.

You can register to download the beta here: http://www.microsoft.com/windowsserver2008/en/us/sp1.aspx

Note that while registration is required, there is no approval process and you will get immediate access to the bits.

Cheers,
Ben

Categorías: Virtualización

Download beta of Windows Server 2008 R2 sp1

Virtualization Team Blog - Lun, 12/07/2010 - 16:36

Over at the Windows Server Division blog, Oliver says the beta is available to download. Oliver focuses on Windows Server 2008 R2 sp1, but Windows 7 sp1 beta is also available. All of this was announced today at our Worldwide Partner Conference in Washington, D.C.

Here's an excerpt from Oliver's post:

The two most important developments in SP1 for Windows Server 2008 R2 are:

Dynamic memory lets Hyper-V administrators pool available memory on a physical host and dynamically distribute it to any virtual machine(s) running on that host. So as the workloads on that physical workload change, requiring more or less memory, Dynamic Memory will let administrators change the memory allocation to their VMs without service interruption. For a deeper look at Dynamic Memory check here.

RemoteFX enhances Microsoft desktop virtualization. RemoteFX lets Windows Server 2008 R2 administrators provide an even richer and user-transparent desktop virtualization experience. RemoteFX delivers rich content, independent of any graphics stack, to server-hosted virtual and session-based desktops, allowing them to support any screen content, including full-motion video, portable graphics stacks such as Silverlight, and 3D applications. Because it can use virtualized graphics on the server and advanced codecs , RemoteFX can deliver those experiences to a much wider array of target devices, including standard desktops and laptops but also an emerging slew of thin clients. You'll also be able to forward the USB ports of the local client to the virtual machine being accessed on the device - just like you can forward the local printer over RDP today. [UPDATE - see Max's new blog post on partner support for RemoteFX]

Make sure you check out the new SP1 Beta Resource page on Microsoft.com as well as the TechNet SP1 page -- and don't forget to grab the download here

Patrick

Categorías: Virtualización

I need to read my own blog more often…

Virtual PC Guy - Vie, 09/07/2010 - 07:16
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/07/08/i-need-to-read-my-own-blog-more-often.aspx';

Over the last couple of weeks I have been playing around with some new (for me) server technology.  This has been a lot of fun – and I have been learning a lot.  However, a couple of days ago things started to go wrong.

Specifically I started seeing all sorts of strange problems with my Hyper-V server.  Virtual machines started going offline randomly.  The whole system would go unresponsive for a couple of minutes and then come back.  Once or twice the management operating system stopped responding, while virtual machines continued to respond over the network.

This was concerning to say the least.

However, as I have been busy this week I did not have time to investigate properly.  After three nights dealing with this behavior, I was starting to wonder if I had some failing hardware, and was thinking about what I would need to do over the weekend to track down the cause of the problem.

Then - as I was driving home yesterday – I suddenly realized what the problem was.  Last weekend I had setup a login script for my domain that would install antivirus automatically on any domain-joined computer that did not have antivirus on it already.  When I got home I checked – and there it was.  I setup exclusions for Hyper-V and my server has been rock solid ever since.

Now, why am I feeling quite foolish to recount this story?  Apart from the obvious fact that it took me days to figure out what the problem was – I have already blogged about this exact problemTwice.

Sigh…

Cheers,
Ben

Categorías: Virtualización

Installing Windows Virtual PC on Windows 7 Home Editions

Virtual PC Guy - Jue, 08/07/2010 - 07:25
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/07/07/installing-windows-virtual-pc-on-windows-7-home-editions.aspx';

For a while now I have been seeing random people complaining about the fact that they cannot install Windows Virtual PC on Windows 7 Home Editions (Basic or Premium).  This always struck me as odd – as I was sure that this was a supported configuration – but I did not reply as I did not have the time to try this configuration myself and confirm that it did in fact work.

I finally had the chance to try this out – and while I can confirm that running Windows Virtual PC on Windows 7 Home Editions is supported and does work – I also stumbled upon the probable cause of peoples confusion.

If you go to the official Virtual PC website (http://www.microsoft.com/virtualpc) and indicate that you are running Windows 7 Home – you will be (correctly) informed that you are not eligible to run Windows XP Mode:

Unfortunately this page does not explain that you are eligible to run Windows Virtual PC.

To clarify – “Windows Virtual PC” is the virtualization program that allows you to create and run virtual machines on Windows 7.  “Windows XP Mode” is a free pre-configured Windows XP virtual machine.  “Windows XP Mode” is not available for people running Windows 7 Home editions; but these users can download Windows Virtual PC and use a separate (fully licensed) copy of Windows XP to create their own Windows XP virtual machines and get all the functionality of Windows XP Mode.

You can download Windows Virtual PC directly from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=2B6D5C18-1441-47EA-8309-2545B08E11DD

And as you can see – on this page it does state that Windows 7 Home editions are supported:

Hopefully the main webpage can be updated to make this less confusing in the future.

Cheers,
Ben

Categorías: Virtualización

High Performance SQL Server Workloads on Hyper-V Whitepaper

Taylor Brown's Blog - Mar, 06/07/2010 - 19:28

A new whitepaper detailing high performance SQL workloads running in Hyper-V R2 virtual machines.  The paper can be downloaded here...  Below are a few highlights/examples from the paper.

Dedicated Passthough LUN’s vs VHD’s

Figure 3: I/O and disk latency for dedicated pass-through disks versus VHDs

Multi-Instance Throughput: Native versus Virtual (16 core server)

The results of this test are summarized as follows:

  • Slightly higher logical processor utilization is required to achieve the same throughput with virtualization due to minimal additional processor overhead.
  • Native instances and virtual instances achieve the same level of scalability.
  • I/O performance of ~5 percent for pass-through disks is greater than fixed-size VHDs as shown in Figure 3. Note that pass-through disks have an approximately one millisecond lower latency as compared to fixed-size VHDs.

Figure 4: Multi-Instance throughput: native instances versus virtual instances (16 cores)

Taylor Brown
Hyper-V Enterprise Deployment Team
taylorb@microsoft.com
http://blogs.msdn.com/taylorb

Categorías: Virtualización

Hyper-V & iSCSI - in the parent or in the virtual machine?

Virtual PC Guy - Vie, 02/07/2010 - 22:33
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/07/02/hyper-v-amp-iscsi-in-the-parent-or-in-the-virtual-machine.aspx';

Here is a good question:

If you are using iSCSI for all of your storage needs; should you use a software iSCSI initiator inside the virtual machine to connect the iSCSI storage directly to the virtual machine, or should you connect the iSCSI storage to the management operating system (in the parent partition) and then store virtual hard disks / use pass through disks?

The answer is (as usual) not that simple.  Generally speaking – you should always connect the iSCSI storage to the management operating system.  The reason for this is that virtual machines can only connect to iSCSI devices with a software iSCSI initiator, where as the management operating system will be able to use hardware host-bus adapters (HBAs).

That said, there is a time when you will want to use a software iSCSI initiator inside the virtual machine and connect the storage directly to the virtual machine.  You will want to do this if you are trying to cluster the guest operating system inside the virtual machine (as opposed to clustering Hyper-V itself).  In this scenario; having iSCSI storage connected directly to the guest operating system is the only option that works.

Some common questions that I have heard around these recommendations include:

 

  • What if I am just using a software iSCSI initiator inside the management operating system?  Does it really make any difference then?

    Yes, it still matters.  At very least a software iSCSI initiator in the management operating system will be able to take full advantage of all of the network offload / acceleration technologies supported by your physical network adapter.  If you run the software iSCSI initiator in the guest operating system, you will only be able to access the subset of network offload functionality that is exposed on our virtual network adapters.

    Furthermore, in the management operating system it is easier to utilize dedicated storage network adapters and network teaming in order to increase your performance.

  • If I connect the iSCSI storage to the management operating system, should I then pass-through the physical disks to the virtual machines – or should I use virtual hard disks (VHDs) stored on the iSCSI device?

    I have discussed this issue in the past – and I strongly believe that everyone should default to using fixed size virtual hard disks over using physical disks directly connected to virtual machines.  The only exception that I would make with iSCSI storage is if you have some external process (e.g. backup software) that will be manipulating the iSCSI storage directly and is not aware of virtual hard disks.

  • How bad is it to use iSCSI connected a software iSCSI initiator inside the virtual machine?

    Not that bad really.  Chances are that if you are running on gigabit networking you will not really notice much of a performance difference between a software iSCSI initiator in the virtual machine and one in the management operating system.  That said, a software iSCSI initiator in the virtual machine will use a lot more CPU power to achieve the same results as a hardware (or software) iSCSI initiator in the management operating system.  This will eventually cause performance problems if / when your physical computer comes under high load.

Cheers,
Ben

Categorías: Virtualización

Getting More Information About You Cluster LUN’s (Part 3 of 3)

Taylor Brown's Blog - Jue, 01/07/2010 - 18:00
So here’s the scenario you need or want to figure out which LUN is which on your cluster…

On Tuesday I published part 1 where I utilized Get-ClusterParameter and the DiskUniqueIds property to enumerate LUN information for cluster storage, in part 2 I simplified that same approach.   In today’s post I am going to continue utilizing the Get-ClusterParameter again looking at the Physical Disk Private Properties however in this post I’ll be looking at the DiskIdGuid property.  This property contains the GUID for a physical disk formatted with as GPT.  Using this GUID we can match it with VDS and get all of the good information that VDS has about disks.

Method 1

This method is fully supported by Microsoft and is relatively strait forward.

Step 1: Import the FailoverClusters module into your PowerShell Window  
              Import-Module FailoverClusters
Step 2: Get the CSV object your interested in using the Get-ClusterSharedVolume cmdlet
              $csv = Get-ClusterSharedVolume –Name “MyCSV”
Step 3: Get the Cluster Parameters for the CSV object using Get-ClusterParameter
              $CSVParams = Get-ClusterParameter -InputObject $csv
Step 4: Filter to get just the DiskIdGuid 
              ($CSVParams | Where-object -FilterScript {$_.Name -eq "DiskIdGuid"}).Value

Ok now you’ve got the GUID for the LUN it will be something like {32443078-9afc-4c0a-b142-466f582a4051}.

Step 5: Start diskpart.exe
Step 6: Start iterating over disks using select disk <number> and then uniqueid disk until you match the GUID’s. It will look like this:

C:\Users\taylorb>diskpart.exe
Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: 37-4611K2713G

DISKPART> select disk 1
Disk 1 is now the selected disk.

DISKPART> uniqueid disk
Disk ID: {F1B5319E-FF92-40BB-9BC9-D5FFAD0AD66B}

DISKPART> select disk 2
Disk 2 is now the selected disk.

DISKPART> uniqueid disk
Disk ID: {32443078-9AFC-4C0A-B142-466F582A4051}


Step 7: Once you find the disk you want you can use the detail disk command to get more information.  It will look like this:

DISKPART> detail disk

IBM 2810XIV  Multi-Path Disk Device
Disk ID: {32443078-9AFC-4C0A-B142-466F582A4051}
Type   : FIBRE
Status : Reserved
Path   : 0
Target : 1
LUN ID : 2
Location Path : UNAVAILABLE
Current Read-only State : No
Read-only  : No
Boot Disk  : No
Pagefile Disk  : No
Hibernation File Disk  : No
Crashdump Disk  : No
Clustered Disk  : Yes

There are no volumes.

Method 2

This method utilizes an undocumented and unsupported class I first posted about previously in Using The Virtual Disk Service (VDS) From Powershell to Mount and Use VHD's as well as in Virtual Disk Service (VDS) Powershell Script Version 2 - Previously Created Volume Support + Mount Points + Bug Fixes.  Again I must reiterate this is not an officially supported API it has no warrantee – it may break at any time and Microsoft Support can not and will not help you with it.  Now that the disclaimer is over – in this example I am using the VDS api’s to do the mapping for me.

Script #Load the Microsoft Storage VDS Library
#This is an undocumented, unsupported library, there is no warrantee nor gaurantees.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Storage.Vds") | Out-Null
$VdsServiceLoader = New-Object Microsoft.Storage.Vds.ServiceLoader
$VdsService = $VdsServiceLoader.LoadService($null)
$VdsService.WaitForServiceReady()
$VdsService.Reenumerate()

#Build up a collection of all disks presented to the os
$Disks = ($VdsService.Providers |% {$_.Packs}) |% {$_.Disks}

#Import the FailoverClusters module
Import-Module FailoverClusters

#Retreve all of the CSV Lun's
$AllCSVs = Get-ClusterSharedVolume
foreach ($Csv in $AllCSVs)
{
    $CSVParams = Get-ClusterParameter -InputObject $Csv
    
    #Retreve the DiskIDGuid Object from the Cluster Parameters
$DiskGUIDString = ($CSVParams | Where-object -FilterScript {$_.Name -eq "DiskIdGuid"}).Value
    
    #Match up the DiskID's
$Disk = ($Disks | Where-Object -FilterScript {$_.DiskGuid -eq $DiskGUIDString})
        Write-Host "CSV ClusterResourceName: " $Csv.Name
        Write-Host "DiskID: " $DiskGUIDString
        Write-Host "DiskFriendlyName: " $Disk.FriendlyName
        Write-Host "DiskName: " $Disk.Name
        Write-Host "DiskAddress: " $Disk.DiskAddress
        Write-Host
}
Sample Output Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\taylorb>.\GetCSVDevInfo1.ps1

CSV ClusterResourceName:  Cluster_CSV1_IBMXIV
DiskID:  {32443078-9afc-4c0a-b142-466f582a4051}
DiskFriendlyName:  IBM 2810XIV  Multi-Path Disk Device
DiskName:  \\?\PhysicalDrive2
DiskAddress:  Port1Path0Target1Lun2

CSV ClusterResourceName:  Cluster_CSV2_IBMXIV
DiskID:  {ee36e403-75cb-4e23-87b4-e82af7949f4e}
DiskFriendlyName:  IBM 2810XIV  Multi-Path Disk Device
DiskName:  \\?\PhysicalDrive3
DiskAddress:  Port1Path0Target1Lun3

CSV ClusterResourceName:  Cluster_CSV3_IBMXIV
DiskID:  {5db28bcb-6ed3-4b80-b363-861a25cc10e4}
DiskFriendlyName:  IBM 2810XIV  Multi-Path Disk Device
DiskName:  \\?\PhysicalDrive4
DiskAddress:  Port1Path0Target1Lun4

Taylor Brown
Hyper-V Enterprise Deployment Team
taylorb@microsoft.com
http://blogs.msdn.com/taylorb

Categorías: Virtualización

Getting More Information About You Cluster LUN’s (Part 2 of 3)

Taylor Brown's Blog - Mié, 30/06/2010 - 18:08
So here’s the scenario you need or want to figure out which LUN is which on your cluster…

Yesterday I posted a script which used Get-ClusterParameter and the Physical Disk Private Properties to gather information on the storage being used by the cluster – as promised here’s a less verbose version of that script…

Script Import-Module FailoverClusters
$csv1 = Get-ClusterSharedVolume Cluster_CSV1_IBMXIV
$csvParams = Get-ClusterParameter -InputObject $csv1
$DiskUniqueIds = ($csvParams | Where-object -FilterScript {$_.Name -eq "DiskUniqueIds"}).Value

$CountOfIdentifiers = $DiskUniqueIds[8]

$currentArrayIndex = 12
for($a = 0; $a -lt $CountOfIdentifiers; $a++)
{
    $CodeSet = $DiskUniqueIds[$currentArrayIndex]
    $Length = $DiskUniqueIds[$currentArrayIndex+8]
    $NextOffset = $DiskUniqueIds[$currentArrayIndex+10]
    
    switch ($DiskUniqueIds[$currentArrayIndex+4])
    {
    0 {Write-Host "StorageIdType: VendorSpecific";break}
    1 {Write-Host "StorageIdType: VendorId";break}
    2 {Write-Host "StorageIdType: EUI64";break}
    3 {Write-Host "StorageIdType: FCPHName";break}
    4 {Write-Host "StorageIdType: PortRelative";break}
    5 {Write-Host "StorageIdType: TargetPortGroup";break}
    6 {Write-Host "StorageIdType: LogicalUnitGroup";break}
    7 {Write-Host "StorageIdType: MD5LogicalUnitIdentifier";break}
    8 {Write-Host "StorageIdType: ScsiNameString";break}
    }
    
    switch ($DiskUniqueIds[$currentArrayIndex+12])
    {
    0 {Write-Host "StorageIdAssoc: Device";break}
    1 {Write-Host "StorageIdAssoc: Port";break}
    2 {Write-Host "StorageIdAssoc: Target";break}
    }
    
    $Data = $null
    switch($CodeSet)
    {
    2 { #StorageIdCodeSetAscii
$DiskUniqueIds_ptr = [System.Runtime.InteropServices.Marshal]::UnsafeAddrOfPinnedArrayElement($DiskUniqueIds, $currentArrayIndex+16)
        $Data = [System.Runtime.InteropServices.Marshal]::PtrToStringAnsi($DiskUniqueIds_ptr, $Length)
        break
        }
    
    3 { #StorageIdCodeSetUtf8
$DiskUniqueIds_ptr = [System.Runtime.InteropServices.Marshal]::UnsafeAddrOfPinnedArrayElement($DiskUniqueIds, $currentArrayIndex+16)
        $Data = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($DiskUniqueIds_ptr, $Length)
        break
        }
    
    default { #0=StorageIdCodeSetReserved, 1=StorageIdCodeSetBinary
for($x = ($currentArrayIndex+16); $x -lt ($currentArrayIndex + 16 + $Length); $x++)
        {
            $Data += , $DiskUniqueIds[$x]
        }
        break
        }
    }
    Write-Host "Data: " $Data
    $currentArrayIndex+=$NextOffset

    Write-Host
}
Sample Output

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\taylorb>.\GetCSVDevInfo1.ps1

StorageIdType:  EUI64
StorageIdAssoc:  Device
Data:  0 23 56 0 1 19 0 28

StorageIdType:  VendorId
StorageIdAssoc:  Device
Data:  IBM     2810XIV          1300113001C

StorageIdType:  VendorSpecific
StorageIdAssoc:  Device
Data:  vol=CSV_1

StorageIdType:  VendorSpecific
StorageIdAssoc:  Device
Data:  host=37-4611K2713K

StorageIdType:  TargetPortGroup
StorageIdAssoc:  Port
Data:  0 0 0 0

StorageIdType:  PortRelative
StorageIdAssoc:  Port
Data:  0 0 7 1

 

Taylor Brown
Hyper-V Enterprise Deployment Team
taylorb@microsoft.com
http://blogs.msdn.com/taylorb

Categorías: Virtualización

Montando Laboratorios, Pruebas de concepto y Pilotos de Virtualización: Instalación y Configuración de Virtual Machine Manager

Microsoft, su tecnología y yo - Mié, 30/06/2010 - 00:16

Posts anteriores:

Hola

Hasta el momento hemos tratado diferentes aspectos de los requisitos e instalación de Hyper-V. Con lo que tenemos hasta ahora ya podemos empezar a crear máquinas virtuales y a moverlas entre los hosts del cluster siempre que contemos con las consolas correspondientes instaladas en algún servidor Windows server 2008 R2 o un Windows 7 con las Remote Server Administration Tools (RSAT). En este post vamos a ver como realizar una instalación y configuración inicial de System Center Virtual Machine Manager 2008 R2. Por no llenarlo de pantallazos, he decidido simplemente publicar los mas relevantes. En este PDF he incluido todos.

La instalación de Virtual Machine Manager es bastante sencilla y rápida, y simplemente nos pedirá tomar una decisión por cada uno de los componentes de su arquitectura. Lo mas sencillo es instalar todo sobre el mismo servidor, pero pueden también instalarse por separado den diferentes equipos. Un servidor para la base de datos, otro para el servicio, otro para el portal, la consola de gestión en los clientes y file servers para la biblioteca. Los agentes son necesarios en  los host que se gestionarán, en el servidor que alberga el servicio, y en los servidores que conformen la biblioteca:

          

  • Opción VMM Server.
    • La base de datos. VMM se apoya en una base de datos SQL. Durante el proceso de instalación nos solicitará elegir una instancia ya existente en la red, o podemos también usar el SQL Express  2005 SP3 que viene incluido en el producto. En este último caso, la instalación y configuración de SQL y la creación de la base de datos se realizan de manera completamente desatendida.

  •  
    • La librería. Este componente de VMM es el encargado de mantener el conjunto de “ingredientes” que necesitaremos para desplegar nuevas máquinas virtuales, y constituye un almacén para plantillas y VMs que no es necesario que estén desplegadas en los hosts. ISOs, VHDs, perfiles de hardware, perfiles de software, scripts, etc. se alojan en file shares disponibles en la red, a los que se despliega el agente de Virtual Machine Manager. Es obligatorio que exista al menos una carpeta compartida en la máquina en la que se instala el servicio, por lo que tendremos que elegir donde reside su path por defecto, o proporcionar una carpeta compartida local ya existente. Si no se van a usar otro servidores para la biblioteca, y si VMM se esta montando virtualizado, hay que tener en cuenta que esa carpeta crecerá según vayamos definiendo plantillas, VHDs y máquinas virtuales. En estos casos es interesante asignar por pass-thought o por iSCSI una LUN del almacenamiento, para evitar que el VHD de la propia VM de Virtual Machine Manager crezca indiscriminadamente.

  •  
    • El servicio de VMM. El motor principal de Virtual Machine Manager es este servicio, con su capa de PowerShell por encima. Aquí tenemos que decidir cuales son los puertos que se utilizarán (por defecto el 8100, el 80 y el 443) y especificar si correrá con la cuenta LocalSystem (defecto) o con una cuenta de usuario del directorio activo, que tendremos que hacer administradora local del equipo. Los criterios para elegir entre una u otra opción están listados en estos enlaces, pero será más fácil la integración con SCOM, y, sobre todo, habilitar la posibilidad de compartir ISOs remotamente (How to Enable Shared ISO Images for Hyper-V Virtual Machines in VMM) si se utiliza una cuenta del directorio activo.

  • Opción VMM Administrator Console: La instalación del servicio no incluye la consola gráfica de administración. Deberá instalarse separadamente sobre el servidor, si así se desea, y sobre los equipos cliente desde los cuales se quiera administrar Virtual Machine Manager. Lo único que nos pregunta la instalación es el puerto que se utilizará para conectarse con el servicio, que será el que hayamos especificado arriba. Al lanzar la consola también puede cambiarse, ya que se usa el clásico formato server:puerto:

  • Opción VMM Self Service Portal: El Portal de Autoservicio se instala sobre un servidor que tenga instalado un IIS con los componentes que se citan como requisitos en el pantallazo de abajo. Tendremos que indicar cual es el servidor donde esta corriendo el servicio de VMM y su puerto, y especificar las opciones del servidor Web. Si, como es lo más frecuente, se encuentra con un site ya definido en el puerto 80, dará un error y tenemos tres opciones para salir del paso:
    • Usar otro puerto
    • Usar host headers, para lo que habrá que definir el nombre elegido como alias en el DNS
    • Si no se va a utilizar ese servidor Web para otros menesteres, simplemente borramos o desactivamos el Default Web Site

    

Llegados a este punto ya tenemos una instalación funcional de System Center Virtual Machine Manager:


Para poder empezar a hacer cosas con el, será necesario:

Mas información (http://blogs.technet.com/b/davidcervigon/p/systemcenter.aspx)

Saludos

David Cervigón

Categorías: Virtualización

Getting More Information About You Cluster LUN’s (Part 1 of 3)

Taylor Brown's Blog - Mar, 29/06/2010 - 23:00
So here’s the scenario you need or want to figure out which LUN is which on your cluster… 

Well if you just use the Get-ClusterSharedVolume cmdlet it won’t get you very far…  However there’s another cmdlet Get-ClusterParameter that will give you enough data that when combined with some other PowerShell/.Net magic will.  This function will return the Cluster Object Private Properties for a given object you can look on MSDN to see all of them – in this case we are interested specifically in the Physical Disk Private Properties.

For this first example I am going to utilize the DiskUniqueIds property to extract information about the specific LUN.  Looking at the documentation for this property it returns a STORAGE_DEVICE_ID_DESCRIPTOR structure which has a set of identifiers – after some more digging around it turns out these identifiers are actually STORAGE_IDENTIFIER structures which have some interesting values.  For most of the storage I have in the lab at the very least the vendor ID (StorageIdTypeEUI64) which is actually a bit mask of the IEEE vendor ID along with some vendor specific data (the bit map is documented here and you can search for vendor ID’s here) as well as a VendorID string and some LUN information although some will tell you what port is being used etc…

In order to format all of this data I’m using some inline C# to define a class with the reprehensive structures and enumerations – just copied from MSDN and made pretty for .Net interop.  I also wrote a function in the C# class named DiskUniqueIdstoStorageId, this function takes the byte array returned from calling the Get-ClusterParameter cmdlet and marshel’s it or formats it into the C# classes thus allowing me to consume the now managed object’s in C#.  All in all it might be overkill so look for a shorter version coming soon.

Script $StorageDevice= @"
using System;
using System.Runtime.InteropServices;

public static class StorageDevice
{
    public enum StorageIdCodeSet
    {
        Reserved = 0,
        Binary = 1,
        Ascii = 2,
        Utf8 = 3
    }

    public enum StorageIdType
    {
        VendorSpecific = 0,
        VendorId = 1,
        EUI64 = 2,
        FCPHName = 3,
        PortRelative = 4,
        TargetPortGroup = 5,
        LogicalUnitGroup = 6,
        MD5LogicalUnitIdentifier = 7,
        ScsiNameString = 8
    }

    public enum StorageIdAssoc
    {
        Device = 0,
        Port = 1,
        Target = 2
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    public struct STORAGE_IDENTIFIER
    {
        public StorageDevice.StorageIdCodeSet CodeSet;
        public StorageDevice.StorageIdType Type;
        public UInt16 IdentifierSize;
        public UInt16 NextOffset;
        public StorageDevice.StorageIdAssoc Association;
        
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)]
        public string Identifiers;
    }

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    public struct STORAGE_DEVICE_ID_DESCRIPTOR
    {
        public UInt32 Version;
        public UInt32 Size;
        public UInt32 NumberOfIdentifiers;
        
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)]
        public string Identifiers;
    }


    public static STORAGE_IDENTIFIER[] DiskUniqueIdstoStorageId(byte[] DiskUniqueIds)
    {
        IntPtr ArrayAddress = Marshal.UnsafeAddrOfPinnedArrayElement(DiskUniqueIds, 0);

        STORAGE_DEVICE_ID_DESCRIPTOR devId = 
            (STORAGE_DEVICE_ID_DESCRIPTOR)Marshal.PtrToStructure(
            ArrayAddress, typeof(STORAGE_DEVICE_ID_DESCRIPTOR));

        IntPtr AddressOfIdentifiers = (IntPtr)
            ((long)ArrayAddress + 
            (long)(Marshal.OffsetOf(
            typeof(STORAGE_DEVICE_ID_DESCRIPTOR), "Identifiers")));

        IntPtr OffsetOfIdentifiersStrings = Marshal.OffsetOf(
            typeof(STORAGE_IDENTIFIER), "Identifiers");
            
        STORAGE_IDENTIFIER[] ArrayofSTORAGE_IDENTIFIER = 
            new STORAGE_IDENTIFIER[devId.NumberOfIdentifiers];
            
        IntPtr CurrentAddressOfIdentifiers=AddressOfIdentifiers;
        
        for (int i = 0; i < devId.NumberOfIdentifiers; i++)
        {
            ArrayofSTORAGE_IDENTIFIER[i] = 
                (STORAGE_IDENTIFIER)Marshal.PtrToStructure(
                CurrentAddressOfIdentifiers, typeof(STORAGE_IDENTIFIER));

            IntPtr AddressOfIdentifiersString = 
                (IntPtr)((long)CurrentAddressOfIdentifiers + 
                (long)OffsetOfIdentifiersStrings);
                
            switch (ArrayofSTORAGE_IDENTIFIER[i].CodeSet)
            {
                case StorageIdCodeSet.Ascii:
                    ArrayofSTORAGE_IDENTIFIER[i].Identifiers = 
                        Marshal.PtrToStringAnsi(AddressOfIdentifiersString,
                        (Int32)ArrayofSTORAGE_IDENTIFIER[i].IdentifierSize);
                        
                    break;
                    
                case StorageIdCodeSet.Utf8:
                    ArrayofSTORAGE_IDENTIFIER[i].Identifiers = 
                        Marshal.PtrToStringUni(AddressOfIdentifiersString,
                        (Int32)ArrayofSTORAGE_IDENTIFIER[i].IdentifierSize);
                        
                    break;
                    
                default:
                    for (int x=0; x < ArrayofSTORAGE_IDENTIFIER[i].IdentifierSize; x++)
                    {
                        ArrayofSTORAGE_IDENTIFIER[i].Identifiers = 
                            String.Format("{0} {1:X}", 
                            ArrayofSTORAGE_IDENTIFIER[i].Identifiers,
                            Marshal.ReadByte(AddressOfIdentifiersString, x));
                    }
                    break;
            }
            CurrentAddressOfIdentifiers = (IntPtr)
                ((long)CurrentAddressOfIdentifiers + 
                (long)ArrayofSTORAGE_IDENTIFIER[i].NextOffset);
        }
        return ArrayofSTORAGE_IDENTIFIER;
    }
}
"@
add-type -TypeDefinition $StorageDevice

Import-Module FailoverClusters
$AllCSVLuns = Get-ClusterSharedVolume
foreach ($CSV in $AllCSVLuns)
{
    $CSVParams = Get-ClusterParameter -InputObject $CSV
    $DiskUniqueId = ($CSVParams | Where-object -FilterScript {$_.Name -eq "DiskUniqueIds"}).Value
    $StorageId = [StorageDevice]::DiskUniqueIdstoStorageId($DiskUniqueId)
    Write-Host "CSV ClusterResourceName: " $CSV.Name
    Write-Host "Identifiers: "
    $StorageId
    Write-Host
    Write-Host
}
  Sample Output

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\taylorb>.\GetCSVDevInfo1.ps1

CSV ClusterResourceName:  Cluster_CSV1_IBMXIV
Identifiers:
CodeSet        : Binary
Type           : EUI64
IdentifierSize : 8
NextOffset     : 28
Association    : Device
Identifiers    :  0 17 38 0 1 13 0 1C

CodeSet        : Ascii
Type           : VendorId
IdentifierSize : 36
NextOffset     : 56
Association    : Device
Identifiers    : IBM     2810XIV          1300113001C

CodeSet        : Ascii
Type           : VendorSpecific
IdentifierSize : 13
NextOffset     : 32
Association    : Device
Identifiers    : vol=CSV_1

CodeSet        : Ascii
Type           : VendorSpecific
IdentifierSize : 22
NextOffset     : 40
Association    : Device
Identifiers    : host=37-4611K2713K

CodeSet        : Binary
Type           : TargetPortGroup
IdentifierSize : 4
NextOffset     : 24
Association    : Port
Identifiers    :  0 0 0 0

CodeSet        : Binary
Type           : PortRelative
IdentifierSize : 4
NextOffset     : 24
Association    : Port
Identifiers    :  0 0 7 1

CSV ClusterResourceName:  Cluster_CSV2_IBMXIV
Identifiers:
CodeSet        : Binary
Type           : EUI64
IdentifierSize : 8
NextOffset     : 28
Association    : Device
Identifiers    :  0 17 38 0 1 13 0 1D

CodeSet        : Ascii
Type           : VendorId
IdentifierSize : 36
NextOffset     : 56
Association    : Device
Identifiers    : IBM     2810XIV          1300113001D

CodeSet        : Ascii
Type           : VendorSpecific
IdentifierSize : 13
NextOffset     : 32
Association    : Device
Identifiers    : vol=CSV_2

CodeSet        : Ascii
Type           : VendorSpecific
IdentifierSize : 22
NextOffset     : 40
Association    : Device
Identifiers    : host=37-4611K2713F

CodeSet        : Binary
Type           : TargetPortGroup
IdentifierSize : 4
NextOffset     : 24
Association    : Port
Identifiers    :  0 0 0 0

CodeSet        : Binary
Type           : PortRelative
IdentifierSize : 4
NextOffset     : 24
Association    : Port
Identifiers    :  0 0 7 3

Taylor Brown
Hyper-V Enterprise Deployment Team
taylorb@microsoft.com
http://blogs.msdn.com/taylorb

Categorías: Virtualización

Talking about “Host-only KVPs”– or “How do you store random stuff in a VM configuration file” [Hyper-V Script]

Virtual PC Guy - Mar, 29/06/2010 - 07:27
tweetmeme_url = 'http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/06/28/talking-about-host-only-kvps-or-how-do-you-store-random-stuff-in-a-vm-configuration-file-hyper-v-script.aspx';

Recently I have had a couple of different people approach me with this problem:

They are developing software to manage / work with virtual machines – and they need a way to associate custom data with a virtual machine.  The problem that they face is how to do this in a way that will survive if the virtual machine gets backed up, failed over, live migrated, snapshotted, etc…

Thankfully there is a simple answer.  In Windows Server 2008 R2 we extended the Key-Value Pair (KVP) functionality to include the concept of “host-only” KVPs.  Simply put – these are key value pairs that get stored in the virtual machine configuration file and can be written / read from the parent partition; but never get sent into the virtual machine.  The way this works is that you use AddKvpItems to add a Msvm_KvpExchangeDataItem where the source field has been set to “4” – which indicates that this is a host-only KVP.

Combining this with some of my existing code from my general DVD tool script and my parent KVP script – results in this hand “all purpose host-only KVP script”:

# Function for handling WMI jobs / return values Function ProcessResult($result, $successString, $failureString) { #Return success if the return value is "0" if ($result.ReturnValue -eq 0) {write-host $successString} #If the return value is not "0" or "4096" then the operation failed ElseIf ($result.ReturnValue -ne 4096) {write-host $failureString " Error value:" $result.ReturnValue} Else {#Get the job object $job=[WMI]$result.job #Provide updates if the jobstate is "3" (starting) or "4" (running) while ($job.JobState -eq 3 -or $job.JobState -eq 4) {write-host $job.PercentComplete "% complete" start-sleep 1 #Refresh the job object $job=[WMI]$result.job} #A jobstate of "7" means success if ($job.JobState -eq 7) {write-host $successString} Else {write-host $failureString write-host "ErrorCode:" $job.ErrorCode write-host "ErrorDescription" $job.ErrorDescription} } }   # Filter for parsing XML data filter Import-CimXml { # Create new XML object from input $CimXml = [Xml]$_ $CimObj = New-Object -TypeName System.Object # Iterate over the data and pull out just the value name and data for each entry foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Name']")) { $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE } foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Data']")) { $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE } # Display output $CimObj }   # Prompt for the Hyper-V Server to use $HyperVServer = Read-Host "Specify the Hyper-V Server to use (enter '.' for the local computer)"   # Prompt for the virtual machine to use $VMName = Read-Host "Specify the name of the virtual machine"   # Get the management service $VMMS = gwmi Msvm_VirtualSystemManagementService -namespace root\virtualization -computername $HyperVServer   # Get the virtual machine object $VM = gwmi MSVM_ComputerSystem -namespace root\virtualization -computername $HyperVServer | where {$_.ElementName -eq $VMName}   # Get the virtual machine setting data $VSSD = $VM.getRelated("Msvm_VirtualSystemSettingData") | where {$_.SettingType -eq 3}   # Setup parameters for main menu prompt $message = "What do you want to do with host-only KVPs?" $list = New-Object System.Management.Automation.Host.ChoiceDescription "&List", "List the current host-only KVPs." $add = New-Object System.Management.Automation.Host.ChoiceDescription "&Add", "Add a new host-only KVP / update an existing one." $delete = New-Object System.Management.Automation.Host.ChoiceDescription "&Delete", "Delete a host-only KVP." $quit = New-Object System.Management.Automation.Host.ChoiceDescription "&Quit", "Exit the HostKVPTools script." $options = [System.Management.Automation.Host.ChoiceDescription[]]($list, $add, $delete, $quit)   do { # Setting up $KVPSettingData needs to be done inside the loop - as this value needs to be # refreshed after any add / modify / delete operation # Get KVP settings object $Query = "Associators of {$VSSD} Where ResultClass=Msvm_KvpExchangeComponentSettingData" $KvpSettingData = gwmi -Query $Query -namespace root\virtualization -computername $HyperVServer # Ask the user what they want to do with the host-only KVPs write-host $promptResult = $host.ui.PromptForChoice("", $message, $options, 0) write-host   switch ($promptResult) { 0 {# Display existing host-only KVPs $KvpSettingData.HostOnlyItems | Import-CimXml } 1 {# Add a new host-only KVP / update an existing host-only KVP # Prompt for the name for the new KVP $NewKVPName = Read-Host "Specify the name of the KVP to add / update"   # Prompt for the KVP data $NewKVPData = Read-Host "Specify the data for the KVP" # Create new Msvm_KvpExchangeDataItem object $wmiClassString = "\\" + $HyperVServer + "\root\virtualization:Msvm_KvpExchangeDataItem" $newKvpExchangeDataItem = ([WMIClass]$wmiClassString).CreateInstance() # Populate the KVP data item - a source of "4" indicates that it is "host-only" $newKvpExchangeDataItem.Name = $NewKVPName $newKvpExchangeDataItem.Data = $NewKVPData $newKvpExchangeDataItem.Source = 4 # Check to see if we can find the key $matchingString = '<PROPERTY NAME="Name" TYPE="string"><VALUE>' + $NewKVPName $existingKVP = $KvpSettingData.HostOnlyItems | ? {$_ -match $matchingString} # If the key exists - modify it. If not, create it. if ($existingKVP) {$result = $VMMS.ModifyKvpItems($Vm, $newKvpExchangeDataItem.GetText(1))} else {$result = $VMMS.AddKvpItems($Vm, $newKvpExchangeDataItem.GetText(1))} # Handle the results ProcessResult $result "The host-only KVP has been added." "Failed to add host-only KVP." } 2 {# Delete an existing host-only KVP # Prompt for the name for the KVP to delete $KVPName = Read-Host "Specify the name of the KVP to delete" # Check to see if we can find the key $matchingString = '<PROPERTY NAME="Name" TYPE="string"><VALUE>' + $KVPName $existingKVP = $KvpSettingData.HostOnlyItems | ? {$_ -match $matchingString} # If the key exists - remove it. if ($existingKVP) {$result = $VMMS.RemoveKvpItems($Vm, $existingKVP) ProcessResult $result "The host-only KVP has been deleted." "Failed to delete host-only KVP."} else {write-host "No host-only KVP exists with that name"}   }   } } until ($promptResult -eq 3)

Cheers,
Ben

Categorías: Virtualización

Whitepaper de Capacity Planning de Hyper-V R2 para VDI

Microsoft, su tecnología y yo - Mar, 29/06/2010 - 00:10

Hola

Se acaba de publicar un whitepaper en el que se detallan diferentes aspectos del dimensionamiento de un host de Hyper-V R2 dedicado a un escenario de VDI, es decir, a correr máquinas virtuales con un sistema operativo de escritorio al que se conectarán los usuarios, bien directamente, bien a través de un bróker de conexiones:

Aparece titulado como Remote Desktop Virtualization Host porque ese es el nombre del role de los Remote Desktop Services que se encarga de poner en contacto los servicios de gestión de Hyper-V con el Remote Desktop Connection broker, y porque ha sido el equipo responsable de los Remote desktop Services quien ha realizado el estudio. De hecho lo consideran una continuación del este otro Whitepaper que ya comentamos cuando apareció hace unas semanas:

Obviamente los resultados son aplicables también en el caso de que se esté usando otro bróker, como XenDesktop o vWorkspace.

La metodología utilizada en ambos estudios es muy similar. Se ejecutan scripts de carga de trabajo sobre las sesiones de usuario. En RDS, un servidor (físico o virtual) soporta la suma de las cargas de todos los usuarios que han iniciado sesión, y en VDI cada VM alberga una única sesión. Al final se trata de comparar cuantos usuarios estamos soportando sobre el servidor físico sin que se produzca una penalización en su experiencia de usuario.

No es el propósito de estos dos whitepapers comparar estas dos técnicas de virtualización del escritorio entre si a nivel de rendimiento. Se estima que RDS escala entre 2 y 5 veces mejor que VDI, cosa que debe tenerse en cuenta, junto con los matices de diferencias en funcionalidad y los costes asociados, a la hora de decidir que tipo de escritorio virtual se entrega a cada tipo de usuario. Ninguna de las dos soluciones es la buena si se presenta como la única solución.

Saludos

David Cervigón

Categorías: Virtualización

Imprescindible: Remote Desktop Connection Manager

Microsoft, su tecnología y yo - Dom, 27/06/2010 - 22:47

Hola

Hacia tiempo que andaba buscando una herramienta gratuita para administrar conexiones de Remote Desktop, y que fuera compatible con las últimas versiones del protocolo. En particular, para mi era muy importante que soportara la conexión a través de un Remote Desktop Gateway, para encapsular la comunicación RDC dentro de HTTPS y pode alcanzar servidores remotos situados detrás de firewalls.

Esta herramienta es una evolución de la inexplicablemente desaparecida Remote Desktop Snap-in de la MMC (tsmmc.msc) que teníamos en Windows Server 2003:

Una de las cosas más interesantes que tiene es la posibilidad de gestionar grupos de conexiones que van heredando la configuración si así se desea. Para todas las conexiones de un grupo puedes configurar credenciales comunes, mi querido servidor de puerta de enlace, como se compartirá la ventana de la sesión, si se permiten o no la redirección de dispositivos locales, etc. Y con la opción de “Connect Group” puedes lanzar las todas las conexiones de ese grupo simultáneamente. Y se ve así:

Se puede establecer el tamaño del cliente en cualquier momento, poner una conexión en pantalla completa, y también hacer un “undock” de una de las conexiones para mostrarla en una ventana diferente de la aplicación principal. Los thumbnails son perfectamente operativos, aunque hay que subirlos de tamaño un poco para que esa funcionalidad sea utilizable. Lo bueno es que dicho tamaño es igualmente configurable por grupo. Todo esto, además de para trabajar, puede resultar de mucha utilidad a la hora de usar un proyector para hacer demos. Permite incluso multimonitor.

Hasta ahora la herramienta de este estilo que mas me había gustado es Remote Desktop Manager de Devolutions, que incluye como valor añadido muchos otros tipos de conexiones útiles como Telnet, SSH, VNC, Hyper-V, Vmware, etc.

Espero que os guste tanto como a mi.

Saludos

David Cervigón

Categorías: Virtualización

VDI reference architecture with HP and Citrix

Virtualization Team Blog - Mar, 22/06/2010 - 23:08

At HP's Tech Forum conference, HP started to market a VDI reference architecture, and deployment offer, with us and Citrix. The brochure can be seen here. The VDI offer can be seen here.

The nuts and bolts of the architecture includes:

  • HP ProLiant BL460c server blades
  • HP StorageWorks P4800 SAN
  • HP Insight Control for System Center
  • Citrix XenDesktop 4.0 enterprise edition
  • Hyper-V R2

There are new HP infrastructure services for VDI to help you get started. HP's Dave Donatelli spoke of this VDI architecture (and more) toward the end of his keynote today. It starts around 1:08:00 of Donatelli's keynote.

Patrick

Categorías: Virtualización
Distribuir contenido