locked
Hyper-v Virtual machine creation as part of MDT task sequence RRS feed

  • Question

  • Hello,

    I have an existing MDT 2013 environment where I deploy Server 2008 R2 core with Hyper V role to HP Microservers.

    The next step is to use hyper v manager and remotely configure the network and build VMs.

    I would like to try and bring this together, and am sure I have seen similar powershell scripts online, but have not been able to find them despite an afternoon/evening of searching.

    Ideally what I would like to happen is run a powershell script as part of MDT task to do the following.

    1) create switch on hyper v host

    2) build two VMs with fixed hard discs

    3) VMs to automatically start and either PXE boot, which will connect to my existing automated MDT environment, or load the MDT iso image to initiate OS install.

    Is anyone aware of existing scripts which can do this?

    Or have any links which could help me achieve this?

    Please note i am only using server 2008 r2 OS at present.

    Many Thanks

    Sunday, March 30, 2014 9:02 PM

Answers

  • Basically this has a little to nothing to do with MDT.

    It's more about having the powershell scripts to do it, here's a good start:

    http://blogs.technet.com/b/heyscriptingguy/archive/2013/10/16/powertip-create-a-virtual-switch-in-hyper-v-with-windows-powershell.aspx

    http://technet.microsoft.com/en-us/magazine/jj933287.aspx

    Once you have the script's tested and working, you can try to incorporate them into your MDT task sequence. Just add an "Run PowerShell Script" and refer to the script as: %DeployRoot%\Applications\Name Of Script\createVM.ps1 or something like that.

    Good luck!


    If this post is helpful please click "Mark for answer", thanks! Kind regards

    Monday, March 31, 2014 7:09 AM
  • I used Johan's hydration scripts and amended them to suit my requirements, have been able to cut a 30 step procedure down to just 3!

    • Marked as answer by Andrew_ Monday, April 28, 2014 6:48 AM
    Monday, April 28, 2014 6:48 AM

All replies

  • Basically this has a little to nothing to do with MDT.

    It's more about having the powershell scripts to do it, here's a good start:

    http://blogs.technet.com/b/heyscriptingguy/archive/2013/10/16/powertip-create-a-virtual-switch-in-hyper-v-with-windows-powershell.aspx

    http://technet.microsoft.com/en-us/magazine/jj933287.aspx

    Once you have the script's tested and working, you can try to incorporate them into your MDT task sequence. Just add an "Run PowerShell Script" and refer to the script as: %DeployRoot%\Applications\Name Of Script\createVM.ps1 or something like that.

    Good luck!


    If this post is helpful please click "Mark for answer", thanks! Kind regards

    Monday, March 31, 2014 7:09 AM
  • I used Johan's hydration scripts and amended them to suit my requirements, have been able to cut a 30 step procedure down to just 3!

    • Marked as answer by Andrew_ Monday, April 28, 2014 6:48 AM
    Monday, April 28, 2014 6:48 AM