Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Developing on Virtual Server / Hyper-V   (RSS)

Hyper-V Script: Looking at KVP GuestIntrinsicExchangeItems

You may wonder what that title is about, so let me pause to explain things a little.  One of the Integration Components that gets installed inside the virtual machine with Hyper-V is the "KVP" component - which stands for "Key Value

Hyper-V: Scripting Fixed VHD Creation

This script is practically identically to the one for creating a dynamically expanding virtual hard disk .  The big thing to be aware of is that creation of a fixed size virtual hard disk takes a lot longer - so you need to make sure you handle the

Hyper-V: Scripting Dynamic VHD Creation

Today I would like to show you some basic scripts for creating a new dynamically expanding virtual hard disk.  The tricky thing about doing this is that the WMI interfaces for creating virtual hard disks expect the size of the new virtual hard disk

PowerShell Management Library for Hyper-V

James O'Neill posts here: http://hypervoria.com/hyper-v/hyper-v-powershell-library-now-on-codeplex.aspx to let us know that he has provided a PowerShell Management Library for Hyper-V available here: http://www.codeplex.com/PSHyperv Cheers, Ben

Hyper-V Script: Compact VHD

Continuing on with my walk through the storage WMI API - here are some scripts for compacting VHDs with Hyper-V.  Note that Hyper-V allows you to compact both differencing and dynamically expanding virtual hard disks. PowerShell: # Prompt for the

Hyper-V Script: Validate VHD

Hyper-V provides a handy scripting interface that allows you to validate a virtual hard disk.  You can use this for two main purposes: To confirm that a standard VHD file is correctly structured and not corrupted. To confirm that a differencing disk

Scripting VM Creation with Hyper-V

People have been bugging me for this for a while - so here we go. Here are the VBScripts / PowerShell scripts to create a basic virtual machine: VBScript: Option Explicit   Dim HyperVServer Dim VMName Dim WMIService Dim VSManagementService Dim VSGlobalSettingData

Handling Job Objects with Hyper-V WMI scripting

Many of the methods in the Hyper-V WMI have an odd way of returning status. They can either immediately return a return value - or instead return a job object - and it can be hard to predict which one you are going to get. The reason for this is that

WMI Changes in Hyper-V RC

There have been some changes to the WMI management interfaces in the release candidate of Hyper-V from the previous beta release. While there have been no changes to the model, a number of the strings used in different places have been "cleaned up" to

Mounting a Virtual Hard Disk with Hyper-V

You can mount a virtual hard disk under the parent partition with Hyper-V and a simple script: VBScript: Option Explicit   Dim WMIService Dim VHDService Dim VHD   'Specify the VHD to be mounted VHD = "F:\Windows.vhd"   'Get instance

Renaming a Hyper-V Virtual Machine

Moving on we come to a sample script for changing a setting on a virtual machine - in this case I am changing the virtual machines name. VBScript: Option Explicit   Dim WMIService Dim VM Dim VMManagementService Dim VMSystemSettingData Dim VMName

Shutting down a Hyper-V Virtual Machine

Now to get a little trickier - shutting down a virtual machine: VBScript: Option Explicit   Dim WMIService Dim VMList Dim VMName Dim VMGuid Dim ShutdownList Dim Result   'Specify the name of the virtual machine that I want to shutdown VMName

Starting a Hyper-V Virtual Machine

Next in the line up of scripts - another simple one - starting a virtual machine: VBScript: Option Explicit   Dim WMIService Dim VMList Dim VMName   'Specify the name of the virtual machine that I want to start VMName = "Windows Server

Bring on the Scripts!

Okay! Now that initial documentation of the Hyper-V WMI API is available I thought I would respond with a "Week of Hyper-V Scripts". Starting with a simple one - here is a script that will list the name, identifier and state for each virtual

Mounting VHDs from Managed Code

When Virtual Server 2005 R2 SP1 was released it included the VHDMount tool - that came with a DLL to allow you to control it programmatically.  Unfortunately we were rather light with the documentation / sample code for this.  So today I would
More Posts Next page »
 
Page view tracker