Create Hyper-V VM with DSC

This topic contains 2 replies, has 3 voices, and was last updated by  Ryan Bartram 1 day, 7 hours ago.

  • Author
    Posts
  • #92414

    Jonas Wanninger
    Participant

    Hello Guys,

    I am aware that I can easily create a Hyper-VM with the xHyper-V resource. I am also aware that I can place a configuration file inside windows so Windows can apply the configuration at startup. But can I automate the installation of Windows itself?

    So my goal is that I create a HyperV-VM, install the OS automatically and then place a DSC file inside Windows so PowerShell can apply it at startup. The only part I am missing is the automated Windows install.

  • #92417

    postanote
    Participant

    An Windows unattended installation has been a common thing for many, many years now. This is fully documented on TechNet and many other resources.

    When you say...

    The only part I am missing is the automated Windows install.

    What exactly are you looking for that is not already provided by TechNet resources relative unattended Windows install?

    Resources

    The Windows Deployment Services (WDS)...
    http://technet.microsoft.com/en-us/windowsserver/dd448616.aspx

    Windows Deployment Tools Technical Reference
    https://technet.microsoft.com/en-us/library/hh825039.aspx

    Utilizing Windows Deployment Services in Windows Server 2012 R2...

    ...functionality is the "supported" method to do automated installations of server and client OS's in a fully-featured way.

    If you don't want to go that heavyweight you could look at building unattended answer files
    http://technet.microsoft.com/en-us/library/ff699026.aspx

    that will be used to automate the setup process. This is also a "supported" process, but you're more "on your own" and it's not a completely integrated solution. (You sound like you're comfortable writing code so this might just be up your alley.)

    Automatic Installation of Hyper-V Hosts with Windows Server 2012 R2
    This is an unattended.xml Installation File for an automatic Installation of Windows Server 2012 R2 Hyper-V Role.The unattended file is generated through Windows System Image Manager. Download the File, place it in a root volume during setup, i.e. a USB Media. It will be detected
    https://gallery.technet.microsoft.com/Automatic-Installation-of-1dd3266f

  • #93981

    Ryan Bartram
    Participant

    The automation of your entire machine could be done with DSC. If you slip the MOF file and the dependant modules directly into the VHDX then on boot DSC will take over and configure everything. You could go one step further and copy the meta mof in the VHDX, on boot the machine should then go to appropriate pull server and pull all the configs and modules it needs. Microsoft has a good article about the process for doing that https://docs.microsoft.com/en-us/powershell/dsc/bootstrapdsc. Hope this helps

You must be logged in to reply to this topic.