powershell - Is it possible for DSC to deal with the creation and advanced configuration of Virtual Machines? -


i'm trying create configuration, using powershell dsc, me create sharepoint farm using virtual machines. assuming have windows 10 machine hyper-v installed configuration script create required vms, example dc, spa1, spw1, spw2 , spdb1, configure network connections , connect domain controller (dc1), proceed install sharepoint/sql server prerequisites , installation before going on configure farm, once available.

i've created configurations complete various stages unable figure out how connect them work in orchestrated manor. example can create vms or perform install , configuration of sharepoint can't these configurations work in tandem.

having read dsc documentation thought might possible using composite resources unable configuration continue onto new virtual machine after creation.

from composite resource documentation:

configuration renamevm {      import-dscresource -module testcompositeresource     node localhost     {         xvirtualmachine vm         {             vmname = "test"             switchname = "internal"             switchtype = "internal"             vhdparentpath = "c:\demo\vhd\rtm.vhd"             vhdpath = "c:\demo\vhd"             vmstartupmemory = 1024mb             vmstate = "running"         }     }      node "192.168.10.1"     {         xcomputer name         {             name = "sql01"             domainname = "fourthcoffee.com"         }     } } 

ideally node names dynamically declared in configuration data , not explicitly defined i.p addresses. i'm having trouble hyper-v configuration creating multiple switches that's separate issue. guess question is:

is possible create configuration deals creation , advanced configuration of virtual machines?

the problem running against conceptual 1 of dsc does.

reading document linked, says

configurations declarative powershell scripts define , configure instances of resources. upon running configuration, dsc (and resources being called configuration) “make so”, ensuring system exists in state laid out configuration.

dsc designed configure instance of resource. @ basic level dsc configuration run on single machine, configuring machine specified state.

dsc scripts should constrained work within boundaries of machine running on. seems part of problem experiencing.

if have 2 sets of scripts. deploy vm script, runs against hyper-v server , sharepoint build configures vm once has launched. seems trying launch sharepoint script within hyper-v deploy script. @ stage though sharepoint server outside of boundary of control of hyper-v server (apart atomic vm capabilities, start,stop, delete etc)

instead suggest see them 2 entirely separate entities. there no need have scripted connection between creating vm , installing sharepoint.

at high level pipeline

  1. run deploy configuration create new vm. @ point vm running configuration complete. has no other actions.
  2. the vm builds , starts, part of initial configuration run bootstrap script tells function.
  3. the vm contacts dsc server, tells function, , requests configurations available it.
  4. the vm downloads configurations, , configures sharepoint server (or sql server, etc)
  5. if there external dependencies, i.e. can install sharepoint before sql has completed, have dependson shared file. i.e. if \\server\share\sqlcompleted.txt exists or whatever other mechanism fits environment.

building servers way removes dependencies, means if decide want switch esx need change deploy script. equally if move cloud deployment.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -