OS Deployment – Deploying Hyper-V hosts using System Center Virtual Machine Manager 2012 SP1 PowerShell Prompt – Part 1(2)

Working with OS deployment pretty much means that, I don’t really care if it is a client OS or a server OS, its still Windows from my perspective, there are small differences, but basically it is the same. One of the challenges you might have is to deploy Hyper-V host machines using System Center Virtual Machine Manager 2012 SP1 and with challenge I mean its is very opposite from MDT or SCCM, or even WDS since all of those belongs to “controlled my client/agent” but when it comes to SCVMM it is more of “controlled by SCVMM”. In this first part I will cover the Server Deployment, not the network configuration and reason is that I do this in a 2 –step process for many reasons, but the most obvious is:

  • If a customer would like to use any other method for the OS deployment part I can easily remove this part and replace it with the customer demands and still keep my script that does the network configuration easily
  • Using this method it pretty much work with any hardware in any configuration


Yes, there are some

  • You need to have a PXE environment and it cannot co-exists with Configuration Manager and it needs to be added to SCVMM
  • The server/compute/host needs to be configured to boot in PXE mode
  • The server needs to support IPMI or SMASH and you also need the password for that
  • SMBiosGuid mess: This is the bad and ugly, some vendors have ONE SMBiosGuid number when you ask IPMI and an other when the server boots and contacts WDS and therefore we need to know the “real” SMBiosGuid number (Easy, just boot the machine into PXE and check the WDS log


In the picture you can see the SMBiosGuid number that is used by the server when presenting it self to the PXE server, if that is correct it all works, otherwise we need to “cheat” just a bit and we do that by providing the real SMBiosGuid (can only be done using PowerShell)

The solution:

For this to work you need to have created the basic things in SCVVM, tings like logical network and such and now over to PowerShell :-) and here is how it looks:

Here is all the variables we use

  • $OSDComputername = “The name of the computer to be installed”
  • $BMCAddress “The IP address of the BMC”
  • $MGMMacAddress “The Mac Address that should be used as the management NIC”
  • $MGMIPAddress “The IP address the computer should have as the Management IP address”
  • $HOSTProfileName “The name of the Host Profile to be used”
  • $HostGroup “The host group in SCVMM to put it”
  • $IPv4Subnet “The subnet of the Management IP address”
  • $RunAsAccount “The IPMI RunAsAccount that has the correct permissions to perform IPMI operations”
Section 1 :

The Parameter section, this section is created so that you can either read all the information from an .csv file or provide it on command like like it was a CMDLet


Section 2 :

We have all data, now we just need to get the data from SCVMM so we can start deploying, we also add a DNS A record for the machine, now that should NOT be needed, but to increase the odds to success I have started to add it since I hate “almost”


Section 3:

Time to deploy


Section 4:

You also need the CSV file to put in all the data and here is an example


And the you need to kick of the deployment

Import-Csv SCVMMostDeploy.csv | Deploy-HostII.ps1


Download here

3 replies »

  1. Pingback: TechNet Blogs
  2. I am interested in the way SCVMM deploy the VMMs from template or how it injects the XML with the settings selected during the deployment configuration. Cant find such information anywhere. It is definitely not MDT and DISM but what and how it is working? Thank you for the information!
    BTW Very nice blog! Really like your posts!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.