- Beware The VMware Core Tax & More
-
Virtualization Nation,
We'd like to again offer congratulations to AMD on the release of their new 6-core Opteron ("Istanbul") processors. As Bryon mentioned, Hyper-V R2 goes hand in hand with these new processors with support for AMD's Rapid Virtualization Indexing, advanced power savings with Core Parking and, of course, more cores means compute resources to run more virtual machines. In fact, two factors that have fueled virtualization have been the rise of 64-bit (x64) computing and the rapid growth of multi-core processors.
Bring On The Cores
Even an entry level laptop these days is dual-core. On desktops, the news is even better. I saw an ad in the paper a few days ago for a very powerful HP desktop system with an AMD quad-core processor and 8 GB of memory that runs Hyper-V like a champ for $600. Well, the news is only getting better. Our partners at AMD and Intel are continuing to ratchet up the core counts and if you've been reading any of the popular tech sites around the web you may have read that we'll soon be seeing processors with 8+ cores per processor. That's a tremendous amount of compute power. In fact, with all this compute power, you're going to be more inclined to virtualize than ever. This is great news for our customers who are trying to lower cost.
However, one question that has hit our inboxes recently has been, "Does Hyper-V have a core tax?"
Huh?
Core Tax? What's that?
At Microsoft, we don't license per core, generally, we license per server or per processor. In this case of Windows Server:
- Windows Server 2008 Standard is licensed per physical server and supports up to 4 physical processors whether there are 1, 2, 4, 6 or 8+ cores per processor
- Windows Server 2008 Enterprise Edition is licensed per physical server up to 8 physical processors whether there are 1, 2, 4, 6 or 8+ cores per processor
- Windows Server 2008 Datacenter Edition is licensed per processor whether there are 1, 2, 4, 6 or 8+ cores per processor
This is great for our customers. As they invest in newer hardware with greater capabilities, performance, scalability there's no penalty for moving to the latest cutting edge systems with ever increasing core counts. After being questioned about a "core tax," I looked into why this was being asked.
Now I know.
VMware & The Core Tax
With VSphere, VMware only supports 6 cores per processor for most of their versions. If you want support for more than 6 cores per processor you have to upgrade from:
- Standard ($795 per processor) to Advanced ($2245 per processor) a 282% increase (no, that's not a typo) OR
- Enterprise ($2875 per processor) to Enterprise Plus ($3495 per processor) a 22% increase
Ouch.
From their website:
What do Analysts Think?
In a recent blog, Scott Lowe (virtualization analyst) wrote:
What's up with Advanced having a 12-core limit, but Enterprise having a 6-core limit? Because existing VI3 Enterprise customers will be grandfathered into vSphere 4 Enterprise if they have an active SnS [VMware Support and Subscription], this strikes me as nothing more than an attempt to extort more licensing fees.
Extort? Ouch.
How The Enterprise Plus SKU Affects Enterprise Customers
With vSphere, VMware created a new, higher end tier, Enterprise Plus, so that Enterprise customers, who used to be the top tier customers and paid for a VMware Support and Subscription (SnS) contract to be eligible for free major and minor version upgrades, are finding that they will have to pay for an upgrade to Enterprise Plus when they decide to move to newer more powerful hardware with more cores. Thus, the Core Tax for VMware users.
What Do VMware Customers Think?
From HERE.
The enforced SnS renewal is particularly galling for companies that just recently renewed their contracts, said Andrew Storrs, and independent consultant in Vancouver, Canada. "It's not so bad if you only have six months left [on SnS], but what if you have 2.5 years left?" To take advantage of the upgrade promotion, IT managers are in the awkward position of having to ask to for more money for their SnS, "just for the privilege of using a normal [VMware] edition next year."
"A lot of people are pretty p@#$%d about it," he added.
What about VMware "Standard" Customers?
In addition, VMware has very quietly removed some features (such hot add virtual disks) that used to be in VMware Standard and pushed those up to Advanced. So, VMware Standard customers are LOSING FUNCTIONALITY "upgrading" to VSphere. If you want those hot add capabilities back, VMware Standard Customers will need to pay for an upgrade from VSphere Standard ($795 per processor) to Advanced ($2245 per processor).
A 282% increase.
Think that's bad? VMware didn't stop there.
The News Gets Worse (Hope You're Sitting Down)
Two things that are interesting:
- It's odd that Enterprise Edition supports fewer cores per processor than Advanced. Paying more and getting less isn't exactly customer friendly. To add insult to injury, VMware is dropping the Enterprise SKU altogether this year to force customers to purchase an upgrade to Enterprise Plus. (HERE & HERE) Double ouch.
- It's also interesting that VMware caps the number of cores per processor at 12. What happens when a processor comes out that includes more than 12 cores? 16? 24? 32? More? Will that require an upgrade to Enterprise Super Plus?
I'll let you draw your own conclusions, but VMware's track record speaks for itself.
CUSTOMERS: FIRST & FOREMOST
No Core Tax. At Microsoft, we don't license per core, generally, we license per server or per processor. When we do license per processor, it's per processor regardless of how many cores are present. I should also point out that the FREE standalone Microsoft Hyper-V Server 2008 R2 supports up 8 physical processors whether there are 1, 2, 4, 6 or 8+ cores per processor as well.
Read that last sentence again.
Microsoft Enterprise Customers with Software Assurance: For our valued customers that purchased Windows Server 2008 with their Microsoft Enterprise Agreement & Software Assurance, here's just a fraction of the new Hyper-V R2 capabilities you'll be receiving with your upgrade to Windows Server 2008 R2 included as part of your agreement:
- Live Migration
- Major Scalability Boosts
- Green IT Enhancements
- 10 Gb/E Ready
- Cluster Shared Volumes
- Hot Add Virtual Disks
- and this is just for starters
In addition, I haven't even started discussing the new capabilities in Windows Server 2008 R2 outside of Hyper-V such as:
- Powerful Hardware and Scaling Capabilities
- Reduced Power Consumption
- Connection Broker for a Virtual Desktop Infrastructure (VDI)
- Ubiquitous Remote Access
- Improved Branch Office Performance and Management
- Simplified Management for SMBs
- Remote Application and Desktop Access
- and much, much more
included as part of your agreement. That's taking care of your customers.
Cheers,
Jeff Woolsey
Principal Group Program Manager
Windows Server, Hyper-V
- System Center Virtual Machine Manager 2008 R2 - Quick Storage Migration
-
Hi, I'm Edwin Yuen, a Senior Technical Product Manager at Microsoft's Integrated Virtualization team. In today's blog, I'd like to discuss another type of migration being added to System Center Virtual Machine Manager 2008 R2, Quick Storage Migration.
Quick Storage Migration (QSM) In Brief
As you may have seen, we recently released the Release Candidate for System Center Virtual Machine Manager 2008 R2. One of the most anticipated features of SCVMM 2008 R2 is Quick Storage Migration (QSM) which enables the migration of the storage of VM from one location to another. For example, suppose you have virtual machines on a leased SAN (SAN 1). The lease runs out and you decide to upgrade to a new SAN (SAN 2) with more capacity, better performance and additional capabilities. Quick Storage Migration allows you to move the virtual machine which resides on SAN 1 to SAN 2. I have had a number of request for more details on how this works so we've written this brief guide to QSM. (In addition, we wanted to make this technology broadly available, not just the biggest enterprises. More on that below.)
QSM relies on Windows Server 2008 R2 Hyper-V and Background Intelligent Transfer Service (BITS). QSM can move the virtual disks of a running virtual machine independent of storage protocols (iSCSI, FC) or storage type (local, DAS, SAN), with minimal downtime.
QSM Is One of Many Migration Technologies Supported in Virtual Machine Manager's Portfolio
| VM Migration Type | Platforms available on | Technology used for transfer | Expected downtime for VM |
| Live Migration | - Hyper-V
(2008 R2) - ESX 3.0, 3.5
| - Windows Server 2008 Failover Cluster
- Hyper-V
- vMotion for ESX
| None - No service interruption while virtual machine is moved
|
| Quick Migration | | - Windows Server 2008 Failover Cluster
- Hyper-V
| Under 1 minute in most cases - VM is put into save-state while it is moved from one cluster node to another using the cluster failover mechanism
|
| SAN Migration | | - Windows Server 2008 Hyper-V and Virtual Disk Service (VDS) Hardware Providers
- N-Port Identification Virtualization (NPIV) on Emulex and QLogic Fibre Channel HBAs
- iSCSI on EMC, HP, Hitachi, NetApp, EquiLogic arrays
| Under 1 minute in most cases - VM is put into save-state while it is moved from one virtual machine host to another using unmasking and masking operations at the SAN level
|
| Network based migration (aka LAN migration)
| - Virtual Server
- Hyper-V
- ESX
| - BITS for Virtual Server and Hyper-V
- sFTP for ESX
| Minutes to hours (W2K8, W2K3 hosts) - VM needs to be stopped or in saved state for the entire duration of transfer
Under 1 minute in most cases (W2K8 R2) - VM can remain running for the almost entire duration of the transfer of its virtual disks from once storage location to another
- VM is put into save-state for a brief interval to migrate its memory state and associated differencing disks.
|
| Storage Migration Type | Platforms available on | Technology used for transfer | Expected downtime |
| Storage vMotion | | | None - No perceived service interruption while the virtual disks associated with a virtual machine are moved from storage location to another
|
| Quick Storage Migration | | | Under 1 minute in most cases (W2K8 R2) - VM can remain running for the almost the entire duration of the transfer of its virtual disks from once storage location to another
- VM is put into save-state for a brief interval to migrate its memory state and associated differencing disks.
|
Note on Processor Compatibility Mode:
To increase the mobility of a running virtual machine across hosts with different processor versions (with in the same processor family), Windows Server 2008 R2 Hyper-V offers Processor Compatibility Mode. This feature masks processor feature differences between the source and destination hosts. With this enabled, you can migrate a virtual machine from a host with Pentium 4 VT processors to a host with Nehalem processors. Processor Compatibility Mode does not require advanced processor features like Intel VT Flex Migration or AMD-V Extended Migration. For more on Processor Compatibility Mode, check out Jeff's Blog a few weeks ago where he goes into detail here.
How QSM Works
QSM uses native Windows platform technologies: Hyper-V and BITS. There are 2 scenarios of interest:
Scenario 1: VM Storage Migration: VM Compute Stays on the Same Server and the VM Storage Migrates from One Storage to Another
1. In the SCVMM console, a new action labeled Storage Migration is now available.
2. When the user right-clicks on a running virtual machine and selects the Migrate Storage action, a wizard is presented. The user provides the path to the new location to be used by the VM. If all the VMs files (configuration and VHD files) are to be placed in a single location the user has only to provide the "Virtual Machine Path". If one or more VHD files for the VM need to be placed at a separate location, the user can explicitly change the location of each VHD by selecting it from the list under "Disks" and clicking the "Browse" button next to it to specify the path for the VHD.
3. SCVMM takes a Hyper-V snapshot of the running virtual machine. This will create a differencing disk for each VHD connected to the VM. All disk write operations from that point forward go into the differencing disk. The original base VHD is no longer changing since it is in a read-only state.
4. With the base VHD in a read-only state, SCVMM starts to transfer the file from the source location to the target location using BITS. This represents the bulk of the data that needs to be transferred and the VM remains running during this transfer. In addition, QSM does not depend on storage types, and the user is free to select any storage destination that is accessible to the Hyper-V host.
5. Once the base VHD is transferred, the virtual machine is put into "Saved State".
6. In "Saved State", SCVMM can transfer the differencing disk created by the snapshot and memory associated with the "Saved State" to the destination location for the VM.
7. Once all the files are transferred, SCVMM exports and then re-imports the virtual machine on the same Hyper-V host with any necessary modifications to the configuration.
8. The snapshot created on step 3 is merged back into the base VHDs
9. Virtual machine is re-started from saved state
10. Job completes
11. The diagram below illustrates the steps performed by QSM on a Hyper-V R2 host.
Scenario 2: VM Migration (Relocation): VM Compute Moves to a News Server AND VM Storage Moves from One Storage to Another
1. In the SCVMM console, the user right-clicks on a running virtual machine and selects the Migrate action, a wizard is presented to help with the migration. The Migrate action initiates the migration of a VM from one host to another host. As part of the VM migration, all of the VMs files are moved to storage that is attached to the destination host. Storage Migration technology enhances the experience by allowing the move for a running virtual machine and limiting the down time of the VM to just the window required to move the save state files (as explained below).
2. The user first selects the destination host based on the desired star rating presented by Intelligent Placement. The user then provides a destination folder for the configuration file and the associated virtual disks. By default, the wizard will put all disks in the same location as the configuration file. After completing the wizard, the migration job is submitted.
3. SCVMM creates a placeholder virtual machine on the destination host. The virtual machine is not powered on so there is no need to reserve CPU or memory resources at this time. Intelligent placement has already accounted for the impact on the destination host of the VM being migrated.
4. SCVMM takes a Hyper-V snapshot of the running virtual machine. This will create a differencing disk for each VHD connected to the VM. All disk write operations from that point forward go into the differencing disk. The original base VHD is no longer changing since it is in a read-only state.
5. With the base VHD in a read-only state, SCVMM starts to transfer the file from the storage location on the source host to a storage location on the target host using BITS. Since QSM does not depend on storage protocols or storage types, the user is free to select any storage destination as long as the Hyper-V can access it.
6. Once the base VHDs are transferred, the virtual machine is put into Saved State.
In Saved State, SCVMM can transfer the differencing disks created by the snapshot and associated memory state.
7. Once all the files are transferred, SCVMM exports the virtual machine and transfers the exported virtual machine configuration to the target host and then imports the virtual machine to Hyper-V host with any necessary modifications to the configuration.
8. The snapshots are merged back into the base VHDs as part of the import process.
9. Virtual machine is started from saved state
10. Job completes
How QSM Compares To VMware Storage VMotion
| | VMM 2008 R2 + Windows Server 2008 R2 Hyper-V | VMware (vCenter 2.5 + ESX 3.5) |
| Migration of virtual machines across two hosts with independent storage | Supported | Not Supported |
| Migration of virtual machines with snapshots | Supported | Not Supported |
| Migration of Virtual machine with Virtual Disks | Supported | Supported (persistent mode) |
| Requires sufficient resources to support two instances of the virtual machines running concurrently | Not Required | Required |
| Additional Licensed Required | None | VMotion License |
| Number of concurrent storage Migrations allowed | 10 | 4 |
| Storage Migrations supported in the Administrator Console | Yes (QSM and Storage vMotion) | No |
| Storage Migrations supported in the CLI | Yes (QSM and Storage vMotion) | Yes |
| Protocol agnostic | Yes | Yes |
| Support for migrations of VMs and storage between hosts with different processors versions (same manufacturer) | Yes (use Hyper-V R2 Processor Compatibility Mode to increase the number of compatible hosts ) | Not Applicable |
Microsoft: Driving Down Costs
One thing our customers have been telling us loud and clear is that they are very, very happy we are offering Live Migration for FREE with Hyper-V R2. With Quick Storage Migration, we knew we had another opportunity to drive down the costs for storage migration capability that has been largely priced out of the reach of most customers. Specifically, VMware Storage VMotion is only available in their Enterprise/Enterprise Plus SKUs ($2875 & $3495 per processor respectively). Contrast this with the fact that Quick Storage Migration is included with System Center Virtual Machine Manager 2008 R2 both the Enterprise Edition and the Workgroup Edition which will be available for starting at about $500.
For a small five node cluster consisting of two and four processors servers, that would cost at a minimum:
| | Virtual Machine R2 QSM | VMware |
Three Nodes; Two Processor Servers | ~$500 | $11,500 |
Five Nodes; Two Processor Servers | ~$500 | $28,750 |
Five Nodes Four Processor Servers | ~$500 | $57,500 |
That's customer focus.
Cheers,
Edwin Yuen
Sr. Technical Product Manager
- Guest Blog: The Role of IT in an Economic Downturn: Spend Smarter, Not Smaller
-
Hello everyone, Richard Campbell here from Campbell & Associates based in Vancouver, BC. I am not only the host of RunAs Radio (www.runasradio.com) but also a Microsoft Regional Director and MVP.
It’s fun being an IT consultant during boom times – my clients are only focused on getting more customers, expanding territories and getting new products to market. There’s no time to worry about costs, it’s time to spend and grow. Speed to market is key and building in lots of capacity so that you can keep serving your new markets is essential.
Looks like that fun is over for the moment, and I’m back in a role I’m comfortable with also: Focusing on return on investment. When the boom times end, it’s time to get back to efficiency and profitability. And there’s lots to do. Whether my clients are technology centric (a company with a retail web site) or technology supported, IT can play a huge role in making the business more profitable and more efficient. Apparently I’m not alone, according to a survey commissioned by Microsoft’s Server & Tools Business (www.microsoft.com/infrastructure) the majority of IT professionals recognize that improving end-user productivity is a key reason for innovation in IT.
Ultimately, information technology can benefit a business two ways: It can improve the performance of the business by making it possible for more revenue to be generated for the same cost or the same revenue for less cost. A new order entry system might allow sales clerks to process two hundred orders in a day where they used to only process one hundred – that’s a great boost in efficiency and profitability. The other benefit technology can bring to a company is better instrumentation: Allowing the management of the business to see more clearly where revenue is made and expenses are incurred. This information then is turned into changes of behavior that increase the profitability of the business.
In an economic downturn, the challenge for the IT Pro is getting back to the concepts of return on investment for technology. This involves studying in detail how the business makes money and where the expenses are incurred. Once those facts are known, then the next step is to find opportunities to improve. It’s really as simple as that. However, the challenge is gathering those core facts – perhaps a better instrumentation system is needed to be able to find opportunities to improve. Maybe that means you need a consultant to help guide the way, or you have the skills in-house, either way the job is clear: spend smarter, not smaller. Don’t focus only on reducing your spend, but on spending on the things that makes your company more profitable and more efficient.
-Richard
- Guest post: Hyper-V gives every Windows shop a free pass into “innovation”
-
Hi, my name is Matt Lavallee and I am the Director of Technology at MLS Property Information Network, Inc., based in Massachusetts. Although you may not recognize the company name, we are one of the 700+ multiple listing service (MLS) companies that provide data warehousing for the Real Estate industry in the U.S. As my company took the early step to virtualizing our environment on Hyper-V last year, Microsoft asked me to share my opinion on the results of its recent survey on the state of IT infrastructure investments, conducted by Harris Interactive.
One point that stands out on the survey — and should surprise no one — is the shift to belt-tightening in IT: 84% of US respondents cited improving business efficiency (51%) and reducing IT costs (33%) as their priorities in light of the economic downturn. However, I personally disagree that this new mindset is a direct reaction to the economy or that the decreased allocation of IT budget to innovation (29% in the US) are necessarily bad things.
First, let us consider that the IT budget is a relatively fixed value year over year — while it may respond to inflation and some cyclical purchases, the vast majority of budget is spent on payroll, annualized licensing, backups, ISP costs, and the regular refresh of equipment. To me, this eliminates a significant stratum of budget from consideration for “innovation” unless you just built your environment last year on five-year-old technology.
Second, the actual varying allocation of budget goes to “special projects”, which, for lack of a better term, includes “innovation”. Here is where the survey findings drew too many conclusions and where I feel the indication is astray from real trends.
Consider my environment: We recently made the switch to virtualization and the broad deployment of Hyper-V. This included a change in direction for our hardware refresh (bigger servers), incremental SAN purchases, and some new investment in networking (10GbE)… perhaps enough to reflect the 25% investment in “innovation”, per the survey. A balance sheet, however, would not reflect that we redesigned the entire infrastructure and now run up to 60% more efficiently: all you will see is a marked decrease in operational overhead at the end of the year (i.e., improved business efficiency and reduced IT costs, as the survey reflected).
So why is there no correlation between advancing the infrastructure and innovation spending? I believe that the technology ecosystem has afforded smarter IT spending, particularly with the (dramatic) rise in computing density, the problems it has solved and challenges it introduced, and the tools that were created (or improved) to meet those challenges. PUE (Power Usage Effectiveness) and “green” concepts were alien just five years ago, but now dominate most datacenter conversations. Virtualization via Hyper-V gives every Windows shop a free pass into “innovation” and grants us many new opportunities that were previously out of budgetary reach.
Some question whether this change indicates that IT is no longer aligned with business goals and driving success… I offer that our current focus clearly demonstrates that we are doing exactly what the business needs us to do.
Matt
- Server & Tools Business Exec to discuss state of IT, answer your questions on June 23
-
Do you have questions about Microsoft’s efforts to deliver new server infra (Windows Server, virt, System Center, Forefront security) to customers and partners?
What is Microsoft doing about enterprise security?
Are you interested in hearing how other IT pros are reacting to economic conditions and where they’re investing?
On Tuesday, June 23rd from 10:30am – 11:00am (PDT), you're invited to join a teleconference with Bob Kelly, corporate VP of Infrastructure Server Marketing. Bob will talk about the state of IT within the context of results from a new Harris Interactive study. The study, of 1,200 IT professionals from the U.S., United Kingdom, Japan and Germany, was commissioned by Microsoft’s Server & Tools Business.
There will be time for your questions following the brief presentation. Submit questions over the phone or you can submit them at any time leading up to, or during, the teleconference by tweeting with the Twitter hashtag, #qs4ms. If you are interested in attending, please REGISTER NOW. Once you open the invite box, you can save and close to your calendar.
Patrick
- Re: Windows Server 2008 SP2 Hyper-V
-
Hi Isaac Roybal here. I’m a technical product manager on the Windows Server team covering Hyper-V.
It’s been 3 weeks since the release of Windows Server 2008 Service Pack 2 (SP2) and we’re seeing great adoption. From a Hyper-V point of view, we’re excited because the final Hyper-V release is an integrated feature in SP2 making it easier and faster to deploy Hyper-V. If you recall, when Windows Server 2008 was released, Hyper-V Beta was included. This meant to get the final Hyper-V release, you needed to go to Windows Update, download and go through the update process.
With Windows Server 2008 SP2, Hyper-V final bits are included so there’s no need to pull down individual downloads which speeds up deployments. There are also some notable updates in SP2, including scalability enhancements for running on systems with up to 24 logical processors which enables support for up to 192 running virtual machines, update for Hyper-V when managed with System Center Virtual Machine Manager 2008 and updates for backup/restore of virtual machines with the Volume Shadow Copy Service (VSS).
For those of you who have already deployed Hyper-V, SP2 is a simple upgrade. Here are a couple of top-of-mind things to think about when you’re planning your upgrade or fresh install of SP2:
· In-place upgrades of Windows Server 2008 to Windows Server 2008 SP2 is supported for both the parent partition and child VMs.
o If the Hyper-V role was enabled on the parent partition prior to the upgrade to SP2, it will be automatically enabled once the upgrade is completed.
o Uninstall any prerelease versions of SP2 that might be installed.
· If a fresh SP2 install is being done and you’d like to move VMs to it, export the VMs from the originating Windows Server 2008 host and import them on the SP2 host.
· Integration Components (ICs) for the child virtual machines must be updated to the SP2 version.
o If you’re doing a fresh install or an upgrade of SP2 on the parent partition, it does not update the integration components inside the virtual machine. Be sure to update the VM ICs after SP2 is installed.
o If you have virtual machines created on the Beta version of the Windows Server 2008 Hyper-V role, and you installed the Beta version of the integration components on those machines, you must uninstall the integration components and reinstall the latest SP2 integration components.
o When upgrading to SP2 inside a Windows Server 2008 child VM the ICs are automatically upgraded.
o If you are running a supported Windows operating system other than Windows Server 2008 as a VM, you need to use vmguest.iso to upgrade the integration components
Isaac
UPDATE. Responding to question by Ed051042
Yes, your assertion is correct. Follow these steps when upgrading a cluster to SP2:
1. Evacuate the cluster node of VMs via quick migration (assuming you’ve extra capacity) to other nodes in the cluster.
2. Upgrade the node to SP2 while it is still part of the cluster
3. Once the SP2 install is complete, quick migrate those VMs back to node and update VMs’ ICs. The last bit is important.
4. Follow the same process starting step #1 until entire cluster had been updated to SP2
For more info see KB 174799 which outlines how to install SPs on a cluster and Microsoft's Failover and Network Load Balancing Clustering Team Blog which explains a rolling upgrade of a cluster.
- VMware FUD Fiasco Final
-
Virtualization Nation,
For those of you who have been following the "VMware FUD Fiasco" blog thread (Part 1, Part 2, Part 3 & Part 4), it's been an unfortunate incident that has gone on far too long. However, I'm pleased to report that we've finally reached resolution and it's time to close this chapter. What resolution am I talking about? Specifically,
VMware has admitted their mistake, apologized and removed the video.
Let's start with VMware's apology and then I'll discuss our testing and results.
VMware Apology From Scott Drummonds
http://blogs.vmware.com/vmtn/2009/06/an-apology-from-scott-drummonds.html
"I made a bad call.
About a month and a half ago, I anonymously posted a YouTube video depicting a controversial test of Microsoft's Hyper-V. The video was a bit hyperbolic in its dramatization of Hyper-V's reliability.
Unfortunately, my intention to stir the pot with eye-poking banter has put my credibility and by association VMware's credibility in question among some of you. For this I apologize.
I've removed the video from YouTube. I've also sent a note of apology to Jeff Woosley at Microsoft.
My focus, and clearly VMware's focus, is to help our 140,000 plus customers get the most from their technology investments. This is our commitment. We will absolutely work our best to live up to the high standard you've come to expect from us. And when we mess up, we'll be the first to address the mistake head on.
Scott"
Scott: Looking forward to your email. Please send it to Jeff Woolsey, not Woosley. Tx.
IT 101: System Requirements
Before we dive into our testing and results, now's a good time to mention that whenever you deploy any software you should always ensure that you meet the minimum system requirements for any software. I know this sounds like IT 101, but whether it's Windows, ESX, Exchange, SQL, Oracle, <insert application/operating system here>, those minimum requirements are there for a reason. Ensuring you meet system requirements should be Step 1 in any deployment. If you don't meet minimum requirements, you're running in an unsupported and likely untested configuration.
For example:
- Windows Server 2008 has a minimum requirement of 512 MB of memory. However, the VMware test was configured with 256 MB. (BTW, Windows Server 2008 Setup includes a block to prevent you from installing on a systems that don't meet the minimum memory requirement. However, once you've installed Windows Server 2008, you can subsequently reduce the memory size. Thus, you have to go out of your way to get into this state.)
- Windows Server 2008 (x64) requires a minimum of 32 GB of disk space. The VMware test was configured with 12 GB.
- Windows Server 2008 (x86) requires a minimum of 20 GB of disk space. The VMware test was configured with 12 GB.
In short, VMware's performance benchmark team didn't even get Step 1 correct. I'm going to leave it at that.
Despite these tests not meeting the minimum system requirements, we configured our tests to match these settings.
Guest Crash
After setting up and configuring the test, we let it run. For days the test ran without issue. We let it run over the weekend.
When we came back in the office Monday morning, lo and behold, we encountered a guest crash.
We immediately performed a root cause analysis and traced this back to an issue that was found and fixed (KB article and fix posted) in Windows (specifically PatchGuard) over a year ago in April 2008. Let's dig in.
Further Analysis
The issue (and details) I'm referring to is here. I reviewed our support logs to see how common this issue is. It's quite rare in fact. We've had less than two dozen reports since Windows Server 2008 went gold and there are millions of Windows Server 2008 deployments and thus, the fix was not made available via Windows Update. However, a public solution has been in place since April 2008 so if a customer searched our public Knowledge Base or contacted our Customer Service & Support (CSS) they'd easily find a resolution. In addition, the fix has already been included with both Windows Server 2008 Service Pack 2 and Windows Server 2008 R2.
To be crystal clear, here's how this relates to Windows Server 2008 Gold, Windows Server 2008 SP2, and Windows Server 2008 R2 with links.
- Windows Server 2008 Gold: In the rare occurrence that someone ran into this issue, we posted a Knowledge Base Article which includes a fix. That link is here: http://support.microsoft.com/kb/950772/
- Windows Server 2008 Service Pack 2: The fix has already been incorporated into Windows Server 2008 Service Pack 2 which is publicly available here: http://technet.microsoft.com/en-us/windows/dd262148.aspx.
- Windows Server 2008 R2 (and future): The fix has already been incorporated into Windows Server 2008 R2 (and future releases). Windows Server 2008 R2 is currently at the Release Candidate milestone and will ship for the holidays.
Finally, I'd like to point out that this issue could occur within any virtual machine environment such as Hyper-V, Xen or VMware ESX/vSphere. In fact, we know it occurs on ESX because, in researching this issue, I found that VMware reported this issue on ESX.
No Parent Crash Here
With the guest issue identified, we started up the test again so we could look for any parent crashes.
- Days pass. No issues/no crash.
- We setup additional, larger systems from multiple vendors and run the same tests with even higher consolidation ratios. 64+ VMs running for days.
- Many days pass. No issues/no crash.
- We decide to add some of our own private stress tests into the mix that stress every part of the system. No issues/no crash.
To sum it up, we haven't been able to reproduce any host crash at all.
I'd also like to reiterate that of the 750,000+ downloads of Hyper-V RTM, we've had 3 reports of crashes under extreme stress and with the same error code as seen in the video bugcheck (0x00020001). The solution in all three cases was to upgrade the server BIOS which solved the problem. This can happen as hypervisors interact very closely with the hardware and BIOS updates generally include updated microcode for processors oftentimes to address errata.
At this point without the physical system we're unable to repro and if Scott/VMware would like to send the crashdump, we'd be interested in reviewing it, but at this point we're out of avenues to explore.
Virtualization & High Availability
This seems like an opportune time to remind folks about the importance of virtualization and high availability (HA). Since day one, Windows Server 2008 Hyper-V integrates with Failover Clustering to provide high availability. This means in the case of something very bad occurring, like someone yanking out the power cable or hardware failure, Hyper-V virtual machines will automatically restart on another server without user intervention. If you're running virtual machines in a production environment, high availability is a must. If you're running virtual machines without HA, I strongly urge you to rethink that decision.
Our customers understand the importance of virtualization and High Availability. In fact, the top feature request from our customers for our free Hyper-V offering, Microsoft Hyper-V Server, was to provide High Availability.
We thought we'd do better and provide both High Availability and Live Migration with Microsoft Hyper-V Server 2008 R2.
That's customer focus.
To Our Customers
We are pleased and humbled by the incredible response you've given Hyper-V.
Thank you.
Specifically, I mean:
- In the first 7 months of Hyper-V RTM availability, we've had over 750,000 downloads of Hyper-V gold bits.
- Hyper-V is the fastest growing x86/x64 hypervisor in history. We are laser focused on our customers and providing high performance, high quality virtualization for everyone from small business to Fortune 500 customers.
- We have hundreds of Hyper-V case studies from customers worldwide and we're winning new customers daily.
We thank you for your support and look forward to helping you reduce your costs, optimize your infrastructure and provide the best solutions that span your desktops to the datacenter to the cloud.
Cheers,
Jeff Woolsey
Principal Group Program Manager
Windows Server, Hyper-V
- Check out the Visual Studio Team System blog
-
Many of you will be interested to learn more about forthcoming lab management capabilities in Visual Studio Team System 2010. Or you may have lunch or meetings with a dev who you want to know more about VSTS 2010 Lab Management. That last part is a nod to "that darn reality" post at SharkTank.
So check the VSTS Lab Management team blog.
Recent posts include:
Patrick
- Windows Server 2008 R2 Hyper-V and AMD's 6-core Opteron
-
Hello, this is Bryon Surace. I’m a senior program manager on the Windows virtualization team at Microsoft. The recent announcement by AMD regarding the 6-core AMD Opteron processor (codenamed ‘Istanbul’) marks another milestone in AMD’s continued mission to create processors designed to provide performance, efficiency, and value.
The newly announced 6-core AMD Opteron processor will provide a total of 24 logical processors (cores) on a 4-socket system and 48 logical processors (cores) on an 8-socket system. In a non-virtualized IT environment, there aren’t many apps/services that are designed to utilize these large system resources. However, with Hyper-V in Windows Server 2008 R2, it’s a natural fit. WS08 R2 Hyper-V provides support for these new processors allowing large resources to be used to consolidate potentially hundreds of virtual machines on a single host.
Hyper-V, as part of Windows Server 2008 R2 (RTM by end of July) will provide support for up 64 Logical processors (see blog announcement here). As such, Hyper-V combined with AMD’s new 6-core Opteron processors provide a solid virtualization platform on which to consolidate large numbers of virtual workloads. Combined with WS08 R2 Core Parking technology, cores on the new Opteron processors can be fully utilized during peak times, or can be put into a sleep state (‘parked’) during idle times further reducing power consumption.
In addition to the increase of supported logical processors, WS08 R2 Hyper-V also takes full advantage of advancements included in the newest generation processors. Specifically Hyper-V will take advantage of Second Level Address Translation such as AMD’s Rapid Virtualization Indexing (RVI). Through RVI, the AMD processor provides two levels of address translation. This additional page table is used to translate guest physical addresses to system physical address allowing the guest to control its own page tables. In WS08 R2, Hyper-V can use the AMD RVI technology to increase performance of the virtualization platform and results in system resource savings. These savings include a drop in Hypervisor CPU time as well as a reduction in memory overhead.
The cooperative development efforts between Microsoft and AMD continue to be highly valued and directly result in providing an industry-leading virtualization platform.
Bryon
- Update on the VMware FUD Fiasco.
-
Virtualization Nation,
If you've been following the VMware FUD fiasco, I just wanted to provide a quick update.
In the last post, we finally reached a point where VMware provided some basic information about their configuration and we immediately began working to reproduce the test. As I mentioned in the last blog, the Hyper-V team is fanatical about the stability of Hyper-V. If there's an issue, we're not going to hide. We will address the issue and provide a fix. Period. We are 100% customer focused and committed to world class support. We've still got some more work to do, but I told you that I'd provide an update in early June so I want to do just that.
Testing Tidbit
On the testing front, I don't want to deliver incomplete information, but I'll give you this tidibt. We haven't found any Hyper-V crashes and we have found problems with VMware's tests.
The VMware Ask
Also in the last blog, we provided VMware the opportunity to resolve this matter and demonstrate partnership. Specifically,
To Bruce Herndon/VMware
In your blog you state that this issue "shows little sign of abating." This statement implies that you're interested in resolving this matter.
Finally, something we can agree on.
If you indeed want to resolve this matter, then:
- Take down the video.
- Send us a crashdump so we can take a look sooner rather than later. Send the crashdump to your Microsoft Technical Account Manager (TAM). If you need help, let us know and we'll follow-up.
- Pledge this won't happen again.
Unfortunately, VMware has done none of the above and remained silent. Since we're going to spend a few more weeks testing, we'd like to again provide VMware the opportunity to take us up on this offer and demonstrate partnership.
Speaking of Partnership.
In the meantime, this seems like a great opportunity to mention a few of the things we've done to help our partners develop for both Windows and Hyper-V. I'll cover that in my next blog.
Cheers,
Jeff Woolsey
Principal Group Program Manager
Windows Server, Hyper-V
- HP releases Insight Control suite for Microsoft System Center
-
Hello - I’m Zane Adam, senior director of System Center and Virtualization marketing at Microsoft. I wanted to share some exciting news related to Microsoft’s virtualization and System Center offerings and HP’s Insight Control Suite for System Center. With the official release today of Insight Control Suite for System Center, HP has taken a significant step in advancing the dynamic datacenter for customers with HP ProLiant and HP BladeSystem platforms by enabling HP Insight Control capabilities to be invoked directly from the Microsoft System Center consoles.
We believe the combination of the System Center suite, Microsoft’s virtualization offerings and Insight Control suite for System Center will help further ease the customer experience by reducing complexity and the requirements on administrator’s time, delivering integrated management of virtual machines, the underlying host systems and optimizing the utilization of resources, power and space. Today’s release of ICE-SC includes a combination of functionality delivered seamlessly through System Center and HP Systems Insight Manager. At a high level, the fully integrated components include:
} Bare Metal deployment – delivered via an Operating System Deployment (OSD) toolkit that plugs directly into System Center Configuration Manager
} PRO pack integration – the ability to manage virtual machines running on ProLiant host systems through System Center consoles
} Lights out remote management – via an iLO Advanced license
} Enhanced configuration and inventory information for ProLiant systems surfaced in the System Center Configuration Manager console
} ProLiant system health monitoring from the System Center Operations Manager console
} All backed by the power of the HP Services organization with 30,000 Microsoft-trained professionals
Congratulations to HP on bringing this offering to market and providing these powerful capabilities to our mutual customers. Be sure to check out the guest blog post on the System Center blog from Scott Farrand of HP.
Thanks - Zane
- Hyper-V R2 Import/Export – Part 6 - So, what happened to Configuration-only export?
-
There have been multiple customers who have voiced concern that the Configuration-only export feature is gone. It has not. Configuration-only export is still very much present in Hyper-V in R2. It just so happens that we have taken the option out from the UI. The user can still utilize this capability via the API.
This brings us to the next question: “Why did you take it out of the UI?” The main motivation behind taking it out of the UI is that the user would not be able to easily import such a VM through the UI. Given our import UI, there is no way for the user to specify the locations of the VHD files during import. Ideally, we would have had an import wizard or the like where the user could specify the location of all the VHD files before launching the import process. However, short of that, it is best not to expose any of that functionality via the UI.
The ability to do a configuration-only export of a VM is available via SCVMM R2, which is built to use the new API. However, if you are not using SCVMM, you can script against that API. Here are a couple of sample scripts (VBScript) for doing the configuration-only export of a VM and for importing that VM. Many thanks to Madhan Gajendran and Dinesh Kumar Govindasamy for writing these scripts:
Exporting config-only
option explicit
dim objWMIService
dim managementService
dim fileSystem
const JobStarting = 3
const JobRunning = 4
const JobCompleted = 7
const wmiStarted = 4096
const wmiSuccessful = 0
Main()
'-----------------------------------------------------------------
' Main
'-----------------------------------------------------------------
Sub Main()
dim computer, objArgs, vmName, vm, exportDirectory
set fileSystem = Wscript.CreateObject("Scripting.FileSystemObject") computer = "."
set objWMIService = GetObject("winmgmts:\\" & computer & "\root\virtualization") set managementService = objWMIService.ExecQuery("select * from Msvm_VirtualSystemManagementService").ItemIndex(0)
set objArgs = WScript.Arguments
if WScript.Arguments.Count = 2 then
vmName = objArgs.Unnamed.Item(0)
exportDirectory = objArgs.Unnamed.Item(1)
else
WScript.Echo "usage: cscript ExportVirtualSystemEx.vbs vmName exportDirectoryName"
WScript.Quit(1)
end if
set vm = GetComputerSystem(vmName)
if ExportVirtualSystemEx(vm, exportDirectory) then
WriteLog "Done"
WScript.Quit(0)
else
WriteLog "ExportVirtualSystemEx Failed."
WScript.Quit(1)
end if
End Sub
'-----------------------------------------------------------------
' Retrieve Msvm_VirtualComputerSystem from base on its ElementName
'-----------------------------------------------------------------
Function GetComputerSystem(vmElementName)
On Error Resume Next
dim query
query = Format1("select * from Msvm_ComputerSystem where ElementName = '{0}'", vmElementName) set GetComputerSystem = objWMIService.ExecQuery(query).ItemIndex(0)
if (Err.Number <> 0) then
WriteLog Format1("Err.Number: {0}", Err.Number) WriteLog Format1("Err.Description:{0}",Err.Description) WScript.Quit(1)
end if
End Function
'-----------------------------------------------------------------
' Export a virtual system
'-----------------------------------------------------------------
Function ExportVirtualSystemEx(computerSystem, exportDirectory)
dim objInParam, objOutParams
dim query
dim computer
dim exportSettingData
ExportVirtualSystemEx = false
if Not fileSystem.FolderExists(exportDirectory) then
fileSystem.CreateFolder(exportDirectory)
end if
set objInParam = managementService.Methods_("ExportVirtualSystemEx").InParameters.SpawnInstance_() objInParam.ComputerSystem = computerSystem.Path_.Path
query = Format1("ASSOCIATORS OF {{0}} WHERE resultClass = Msvm_VirtualSystemExportSettingData", computerSystem.Path_.Path) set exportSettingData = objWMIService.ExecQuery(query).ItemIndex(0)
'Dont copy the VHDs and AVHDs, but copy the Saved state information and Snapshot configurations if present
exportSettingData.CopyVmStorage = false
exportSettingData.CopyVmRuntimeInformation = true
exportSettingData.CreateVmExportSubdirectory = true
exportSettingData.CopySnapshotConfiguration = 0
objInParam.ExportSettingData = exportSettingData.GetText_(1)
objInParam.ExportDirectory = exportDirectory
set objOutParams = managementService.ExecMethod_("ExportVirtualSystemEx", objInParam)
if objOutParams.ReturnValue = wmiStarted then
if (WMIJobCompleted(objOutParams)) then
ExportVirtualSystemEx = true
end if
elseif (objOutParams.ReturnValue = wmiSuccessful) then
ExportVirtualSystemEx = true
else
WriteLog Format1("ExportVirtualSystemEx failed with ReturnValue {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' Handle wmi Job object
'-----------------------------------------------------------------
Function WMIJobCompleted(outParam)
dim WMIJob, jobState
set WMIJob = objWMIService.Get(outParam.Job)
WMIJobCompleted = true
jobState = WMIJob.JobState
while jobState = JobRunning or jobState = JobStarting
WriteLog Format1("In progress... {0}% completed.",WMIJob.PercentComplete) WScript.Sleep(1000)
set WMIJob = objWMIService.Get(outParam.Job)
jobState = WMIJob.JobState
wend
if (jobState <> JobCompleted) then
WriteLog Format1("ErrorCode:{0}", WMIJob.ErrorCode) WriteLog Format1("ErrorDescription:{0}", WMIJob.ErrorDescription) WMIJobCompleted = false
end if
End Function
'-----------------------------------------------------------------
' Create the console log files.
'-----------------------------------------------------------------
Sub WriteLog(line)
dim fileStream
set fileStream = fileSystem.OpenTextFile(".\ExportVirtualSystemExLog.log", 8, true) WScript.Echo line
fileStream.WriteLine line
fileStream.Close
End Sub
'------------------------------------------------------------------------------
' The string formating functions to avoid string concatenation.
'------------------------------------------------------------------------------
Function Format2(myString, arg0, arg1)
Format2 = Format1(myString, arg0)
Format2 = Replace(Format2, "{1}", arg1)End Function
'------------------------------------------------------------------------------
' The string formating functions to avoid string concatenation.
'------------------------------------------------------------------------------
Function Format1(myString, arg0)
Format1 = Replace(myString, "{0}", arg0)End Function
Importing a VM that was exported config only
The VM exported above can be imported via the following script. Please note that what this script does is to provide a fine-grained control over the different parameters of import and thus can be used for importing a VM regardless of how it was exported (config-only or with VHDs). It just so happens that it is particularly useful for importing a VM that was exported config-only.
option explicit
dim objWMIService
dim managementService
dim switchService
dim fileSystem
const JobStarting = 3
const JobRunning = 4
const JobCompleted = 7
const wmiStarted = 4096
const wmiSuccessful = 0
Main()
'-----------------------------------------------------------------
' Main
'-----------------------------------------------------------------
Sub Main()
dim computer, objArgs, importDirectory, generateNewID
set fileSystem = Wscript.CreateObject("Scripting.FileSystemObject") computer = "."
set objWMIService = GetObject("winmgmts:\\" & computer & "\root\virtualization") set managementService = objWMIService.ExecQuery("select * from Msvm_VirtualSystemManagementService").ItemIndex(0) set switchService = objWMIService.ExecQuery("select * from Msvm_VirtualSwitchManagementService").ItemIndex(0)
set objArgs = WScript.Arguments
if WScript.Arguments.Count = 1 then
importDirectory = objArgs.Unnamed.Item(0)
else
WScript.Echo "usage: cscript ImportVirtualSystemEx-MoreGranular.vbs importDirectoryName"
WScript.Quit(1)
end if
if ImportVirtualSystemEx(importDirectory) then
WriteLog "Done"
WScript.Quit(0)
else
WriteLog "ImportVirtualSystemEx Failed."
WScript.Quit(1)
end if
End Sub
'-----------------------------------------------------------------
' Create a virtual switch by calling CreateSwitch WMI method
'-----------------------------------------------------------------
Function CreateSwitch(name, friendlyName, learnableAddress)
dim objInParam, objOutParams
set CreateSwitch = Nothing
set objInParam = switchService.Methods_("CreateSwitch").InParameters.SpawnInstance_() objInParam.FriendlyName = friendlyName
objInParam.Name = name
objInParam.NumLearnableAddresses = learnableAddress
objInParam.ScopeofResidence = null
set objOutParams = switchService.ExecMethod_("CreateSwitch", objInParam)
if objOutParams.ReturnValue = wmiSuccessful then
set CreateSwitch = objWMIService.Get(objOutParams.CreatedVirtualSwitch)
else
WriteLog Format1("CreateSwitch failed with error code {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' GetVirtualSystemImportSettingData from a directory
'-----------------------------------------------------------------
Function GetVirtualSystemImportSettingData(importDirectory)
dim objInParam, objOutParams
set objInParam = managementService.Methods_("GetVirtualSystemImportSettingData").InParameters.SpawnInstance_() objInParam.ImportDirectory = importDirectory
set objOutParams = managementService.ExecMethod_("GetVirtualSystemImportSettingData", objInParam)
if objOutParams.ReturnValue = wmiStarted then
if (WMIJobCompleted(objOutParams)) then
set GetVirtualSystemImportSettingData = objOutParams.ImportSettingData
end if
elseif objOutParams.ReturnValue = wmiSuccessful then
set GetVirtualSystemImportSettingData = objOutParams.ImportSettingData
else
WriteLog Format1("GetVirtualSystemImportSettingData failed with ReturnValue {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' ImportVirtualSystem from a directory
'-----------------------------------------------------------------
Function ImportVirtualSystemEx(importDirectory)
dim objInParam, objOutParams
dim newDataRoot
dim importSettingData
dim newTargetResourcePaths, newTargetNetworkConnections, newSwitch
newTargetResourcePaths = Array(1)
'Folders in newTargetResourcePaths should be existing
newTargetResourcePaths(0) = importDirectory & "\Temp.vhd"
newTargetNetworkConnections = Array(1)
newTargetNetworkConnections(0) = "Switch_For_Import_Export_Sample"
set newSwitch = CreateSwitch(newTargetNetworkConnections(0), newTargetNetworkConnections(0), 1024)
ImportVirtualSystemEx = false
set objInParam = managementService.Methods_("ImportVirtualSystemEx").InParameters.SpawnInstance_() objInParam.ImportDirectory = importDirectory
set importSettingData = GetVirtualSystemImportSettingData(importDirectory)
importSettingData.GenerateNewId = true
importSettingData.CreateCopy = true
importSettingData.Name = "NewSampleVM-WithFixups"
importSettingData.TargetResourcePaths = newTargetResourcePaths
importSettingData.TargetNetworkConnections = newTargetNetworkConnections
importSettingData.Put_
objInParam.ImportSettingData = importSettingData.GetText_(1)
set objOutParams = managementService.ExecMethod_("ImportVirtualSystemEx", objInParam)
if objOutParams.ReturnValue = wmiStarted then
if (WMIJobCompleted(objOutParams)) then
ImportVirtualSystemEx = true
end if
elseif objOutParams.ReturnValue = wmiSuccessful then
ImportVirtualSystemEx = true
else
WriteLog Format1("ImportVirtualSystemEx failed with ReturnValue {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' Handle wmi Job object
'-----------------------------------------------------------------
Function WMIJobCompleted(outParam)
dim WMIJob, jobState
set WMIJob = objWMIService.Get(outParam.Job)
WMIJobCompleted = true
jobState = WMIJob.JobState
while jobState = JobRunning or jobState = JobStarting
WriteLog Format1("In progress... {0}% completed.",WMIJob.PercentComplete) WScript.Sleep(1000)
set WMIJob = objWMIService.Get(outParam.Job)
jobState = WMIJob.JobState
wend
if (jobState <> JobCompleted) then
WriteLog Format1("ErrorCode:{0}", WMIJob.ErrorCode) WriteLog Format1("ErrorDescription:{0}", WMIJob.ErrorDescription) WMIJobCompleted = false
end if
End Function
'-----------------------------------------------------------------
' Create the console log files.
'-----------------------------------------------------------------
Sub WriteLog(line)
dim fileStream
set fileStream = fileSystem.OpenTextFile(".\ImportVirtualSystemEx-MoreGranular.log", 8, true) WScript.Echo line
fileStream.WriteLine line
fileStream.Close
End Sub
'------------------------------------------------------------------------------
' The string formating functions to avoid string concatenation.
'------------------------------------------------------------------------------
Function Format1(myString, arg0)
Format1 = Replace(myString, "{0}", arg0)End Function
- Hyper-V R2 Import/Export – Part 5 – Import code sample
-
In the following sample, we do a basic import of a VM using the new Import API. This script essentially does what the import UI does; it assumes all the necessary files are present in the import folder and imports from that directory. In a later blog, there will be a sample that will utilize the fine grained capabilities of import in Hyper-V R2. Many thanks to Madhan Gajendran and Dinesh Kumar Govindasamy again for writing this script:
option explicit
dim objWMIService
dim managementService
dim fileSystem
const JobStarting = 3
const JobRunning = 4
const JobCompleted = 7
const wmiStarted = 4096
const wmiSuccessful = 0
Main()
'-----------------------------------------------------------------
' Main
'-----------------------------------------------------------------
Sub Main()
dim computer, objArgs, importDirectory, generateNewID
set fileSystem = Wscript.CreateObject("Scripting.FileSystemObject") computer = "."
set objWMIService = GetObject("winmgmts:\\" & computer & "\root\virtualization") set managementService = objWMIService.ExecQuery("select * from Msvm_VirtualSystemManagementService").ItemIndex(0)
set objArgs = WScript.Arguments
if WScript.Arguments.Count = 1 then
importDirectory = objArgs.Unnamed.Item(0)
else
WScript.Echo "usage: cscript ImportVirtualSystemEx.vbs importDirectoryName"
WScript.Quit(1)
end if
if ImportVirtualSystemEx(importDirectory) then
WriteLog "Done"
WScript.Quit(0)
else
WriteLog "importDirectory Failed."
WScript.Quit(1)
end if
End Sub
'-----------------------------------------------------------------
' GetVirtualSystemImportSettingData from a directory
'-----------------------------------------------------------------
Function GetVirtualSystemImportSettingData(importDirectory)
dim objInParam, objOutParams
set objInParam = managementService.Methods_("GetVirtualSystemImportSettingData").InParameters.SpawnInstance_() objInParam.ImportDirectory = importDirectory
set objOutParams = managementService.ExecMethod_("GetVirtualSystemImportSettingData", objInParam)
if objOutParams.ReturnValue = wmiStarted then
if (WMIJobCompleted(objOutParams)) then
set GetVirtualSystemImportSettingData = objOutParams.ImportSettingData
end if
elseif objOutParams.ReturnValue = wmiSuccessful then
set GetVirtualSystemImportSettingData = objOutParams.ImportSettingData
else
WriteLog Format1("ImportVirtualSystem failed with ReturnValue {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' ImportVirtualSystem from a directory
'-----------------------------------------------------------------
Function ImportVirtualSystemEx(importDirectory)
dim objInParam, objOutParams
dim newDataRoot
dim importSettingData, copyDir, fileSysObj
ImportVirtualSystemEx = false
newDataRoot = importDirectory & "\NewCopy"
'Path in newDataRoot folder should be existing
set fileSysObj = CreateObject("Scripting.FileSystemObject") if fileSysObj.FolderExists(newDataRoot) then
fileSysObj.DeleteFolder(newDataRoot)
end if
copyDir = fileSysObj.CreateFolder(newDataRoot)
set objInParam = managementService.Methods_("ImportVirtualSystemEx").InParameters.SpawnInstance_() objInParam.ImportDirectory = importDirectory
set importSettingData = GetVirtualSystemImportSettingData(importDirectory)
importSettingData.GenerateNewId = true
importSettingData.CreateCopy = true
importSettingData.Name = "NewSampleVM"
importSettingData.TargetVmDataRoot = newDataRoot
importSettingData.TargetSnapshotDataRoot = newDataRoot
importSettingData.TargetVhdDataRoot = newDataRoot
importSettingData.Put_
objInParam.ImportSettingData = importSettingData.GetText_(1)
set objOutParams = managementService.ExecMethod_("ImportVirtualSystemEx", objInParam)
if objOutParams.ReturnValue = wmiStarted then
if (WMIJobCompleted(objOutParams)) then
ImportVirtualSystemEx = true
end if
elseif objOutParams.ReturnValue = wmiSuccessful then
ImportVirtualSystemEx = true
else
WriteLog Format1("ImportVirtualSystem failed with ReturnValue {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' Handle wmi Job object
'-----------------------------------------------------------------
Function WMIJobCompleted(outParam)
dim WMIJob, jobState
set WMIJob = objWMIService.Get(outParam.Job)
WMIJobCompleted = true
jobState = WMIJob.JobState
while jobState = JobRunning or jobState = JobStarting
WriteLog Format1("In progress... {0}% completed.",WMIJob.PercentComplete) WScript.Sleep(1000)
set WMIJob = objWMIService.Get(outParam.Job)
jobState = WMIJob.JobState
wend
if (jobState <> JobCompleted) then
WriteLog Format1("ErrorCode:{0}", WMIJob.ErrorCode) WriteLog Format1("ErrorDescription:{0}", WMIJob.ErrorDescription) WMIJobCompleted = false
end if
End Function
'-----------------------------------------------------------------
' Create the console log files.
'-----------------------------------------------------------------
Sub WriteLog(line)
dim fileStream
set fileStream = fileSystem.OpenTextFile(".\ImportVirtualSystemEx.log", 8, true) WScript.Echo line
fileStream.WriteLine line
fileStream.Close
End Sub
'------------------------------------------------------------------------------
' The string formating functions to avoid string concatenation.
'------------------------------------------------------------------------------
Function Format1(myString, arg0)
Format1 = Replace(myString, "{0}", arg0)End Function
- Hyper-V R2 Import/Export – Part 4 – Export code sample
-
In the following sample, we do a basic export of a VM using the new Export API. Here we export a VM with all the data associated with it. In a later blog, I will cover configuration-only export. Many thanks to Madhan Gajendran and Dinesh Kumar Govindasamy from the Hyper-V team for writing this script:
option explicit
dim objWMIService
dim managementService
dim fileSystem
const JobStarting = 3
const JobRunning = 4
const JobCompleted = 7
const wmiStarted = 4096
const wmiSuccessful = 0
Main()
'-----------------------------------------------------------------
' Main
'-----------------------------------------------------------------
Sub Main()
dim computer, objArgs, vmName, vm, exportDirectory
set fileSystem = Wscript.CreateObject("Scripting.FileSystemObject") computer = "."
set objWMIService = GetObject("winmgmts:\\" & computer & "\root\virtualization") set managementService = objWMIService.ExecQuery("select * from Msvm_VirtualSystemManagementService").ItemIndex(0)
set objArgs = WScript.Arguments
if WScript.Arguments.Count = 2 then
vmName = objArgs.Unnamed.Item(0)
exportDirectory = objArgs.Unnamed.Item(1)
else
WScript.Echo "usage: cscript ExportVirtualSystemEx.vbs vmName exportDirectoryName"
WScript.Quit(1)
end if
set vm = GetComputerSystem(vmName)
if ExportVirtualSystemEx(vm, exportDirectory) then
WriteLog "Done"
WScript.Quit(0)
else
WriteLog "ExportVirtualSystemEx Failed."
WScript.Quit(1)
end if
End Sub
'-----------------------------------------------------------------
' Retrieve Msvm_VirtualComputerSystem from base on its ElementName
'-----------------------------------------------------------------
Function GetComputerSystem(vmElementName)
On Error Resume Next
dim query
query = Format1("select * from Msvm_ComputerSystem where ElementName = '{0}'", vmElementName) set GetComputerSystem = objWMIService.ExecQuery(query).ItemIndex(0)
if (Err.Number <> 0) then
WriteLog Format1("Err.Number: {0}", Err.Number) WriteLog Format1("Err.Description:{0}",Err.Description) WScript.Quit(1)
end if
End Function
'-----------------------------------------------------------------
' Export a virtual system
'-----------------------------------------------------------------
Function ExportVirtualSystemEx(computerSystem, exportDirectory)
dim objInParam, objOutParams
dim query
dim computer
dim exportSettingData
ExportVirtualSystemEx = false
if Not fileSystem.FolderExists(exportDirectory) then
fileSystem.CreateFolder(exportDirectory)
end if
set objInParam = managementService.Methods_("ExportVirtualSystemEx").InParameters.SpawnInstance_() objInParam.ComputerSystem = computerSystem.Path_.Path
query = Format1("ASSOCIATORS OF {{0}} WHERE resultClass = Msvm_VirtualSystemExportSettingData", computerSystem.Path_.Path) set exportSettingData = objWMIService.ExecQuery(query).ItemIndex(0)
exportSettingData.CopyVmStorage = true
exportSettingData.CopyVmRuntimeInformation = true
exportSettingData.CreateVmExportSubdirectory = true
exportSettingData.CopySnapshotConfiguration = 0
objInParam.ExportSettingData = exportSettingData.GetText_(1)
objInParam.ExportDirectory = exportDirectory
set objOutParams = managementService.ExecMethod_("ExportVirtualSystemEx", objInParam)
if objOutParams.ReturnValue = wmiStarted then
if (WMIJobCompleted(objOutParams)) then
ExportVirtualSystemEx = true
end if
elseif (objOutParams.ReturnValue = wmiSuccessful) then
ExportVirtualSystemEx = true
else
WriteLog Format1("ExportVirtualSystemEx failed with ReturnValue {0}", objOutParams.ReturnValue) end if
End Function
'-----------------------------------------------------------------
' Handle wmi Job object
'-----------------------------------------------------------------
Function WMIJobCompleted(outParam)
dim WMIJob, jobState
set WMIJob = objWMIService.Get(outParam.Job)
WMIJobCompleted = true
jobState = WMIJob.JobState
while jobState = JobRunning or jobState = JobStarting
WriteLog Format1("In progress... {0}% completed.",WMIJob.PercentComplete) WScript.Sleep(1000)
set WMIJob = objWMIService.Get(outParam.Job)
jobState = WMIJob.JobState
wend
if (jobState <> JobCompleted) then
WriteLog Format1("ErrorCode:{0}", WMIJob.ErrorCode) WriteLog Format1("ErrorDescription:{0}", WMIJob.ErrorDescription) WMIJobCompleted = false
end if
End Function
'-----------------------------------------------------------------
' Create the console log files.
'-----------------------------------------------------------------
Sub WriteLog(line)
dim fileStream
set fileStream = fileSystem.OpenTextFile(".\ExportVirtualSystemExLog.log", 8, true) WScript.Echo line
fileStream.WriteLine line
fileStream.Close
End Sub
'------------------------------------------------------------------------------
' The string formating functions to avoid string concatenation.
'------------------------------------------------------------------------------
Function Format2(myString, arg0, arg1)
Format2 = Format1(myString, arg0)
Format2 = Replace(Format2, "{1}", arg1)End Function
'------------------------------------------------------------------------------
' The string formating functions to avoid string concatenation.
'------------------------------------------------------------------------------
Function Format1(myString, arg0)
Format1 = Replace(myString, "{0}", arg0)End Function
- Hyper-V R2 Import/Export – Part 3 – The UI
-
Given the rather compressed schedule of Windows Server 2008 R2, we did not have time to get too ambitious with the UI. However, the UI has been modeled to enable the following 3 scenarios:
1. Export VMs with data
2. Import VMs with data
3. Export a snapshot of a VM
4. Provide the option for copy on import or in-place import
5. Allow the user to import the VM with a newly generated ID.
Export UI:
Here is a screen capture of the Export UI you get when you right-click on a virtual machine in the Hyper-V Manager and click “Export…” :

It is still rather rudimentary and allows the user to specify the location to export the VM to. The VM will be exported along with its VHD files and saved state files to the specified folder. You might notice that the check-box for doing a configuration-only export is not there. This is by design, but we do support configuration-only export. More on this topic in a subsequent blogpost.
Exporting a snapshot:
To export a snapshot, right-click on the snapshot you want to export (in the snapshots pane that shows up for a selected virtual machine in Hyper-V) and click on “Export…”. It will bring up the Export UI above.

Import UI:
The import UI is launched from the same spot under the Actions pane in Hyper-V manager:

In the import UI, check the highlighted checkbox and you will end up copying the VM on import, leaving files in the import directory good for a second import.

The other UI elements in the import UI follow the same pattern as in v1: the location for the import directory as well as the option for regenerating the VM’s unique ID. The import UI assumes that all the necessary files for the import to succeed are in the import directory. Ideally, given that the import process has so many fine grained options, we would have had an import wizard to allow the user the full range of choices. However, short of that, the user can script against the APIs to get the functionality they need. There will be a couple of blogs following this with sample scripts that would give the reader a good idea of how to use the APIs.