PowerCLI

 View Only
Expand all | Collapse all

Using DSC (Desired State Configuration) with PowerCLI

  • 1.  Using DSC (Desired State Configuration) with PowerCLI

    Posted Mar 08, 2014 02:26 AM

    HAs anyone been successful in using the new DSC with PowerCLI to configure a newly provisioned windows OS in a VM by connecting to the vcenter where the VM is?  would you be willing to share your use case and code?



  • 2.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Mar 12, 2014 03:41 PM

    Anyone?



  • 3.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Mar 12, 2014 04:55 PM

    It's my planning, but I haven't completed my trials yet :smileysad:



  • 4.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Mar 14, 2014 04:04 PM

    Thanks LucD , will look forward to your take on DSC and anyone out there who has used it.



  • 5.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Oct 28, 2014 01:53 PM

    Hi

    I'm trying to use VMWare PowerCLI commandlets in DSC. But I don't get it working.

    I always get the following error:

    The PowerShell provider sc_vcenter_cluster threw one or more non-terminating errors while running the

    Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational.

    Refer to this channel for more details.

        + CategoryInfo          : InvalidOperation: (:) [], CimException

        + FullyQualifiedErrorId : NonTerminatingErrorFromProvider

        + PSComputerName        : localhost

    Also when I try with a simple command "get-VM" I don't get any data.

    Does anyone had success trying DSC with VMWare.



  • 6.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Oct 28, 2014 02:11 PM

    Do you have some more info on the setup you are using.

    Did you you try to write/use a Script Resource to handle the vSphere  ?

    Are you using a push or a pull model ?



  • 7.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Oct 28, 2014 03:07 PM

    Our plan is to manage vCenter/ESX/VM configurations with Powershell DSC.

    So I've written an own DSC Module for creating clusters (Test/Set/get-TargetResource)

    When I'm creating then a DSC Configuration manually and applying it with:

    Start-DscConfiguration <folder> -Wait -Verbose, it's connecting to the vCenter but for every command connecting to the vCenter I don't receive any Data:

    Example: $clusters = get-cluster

    Did you had the same problem?



  • 8.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Broadcom Employee
    Posted Oct 28, 2014 04:42 PM

    Are you able to share the resources you have written here?  I would love to see them.



  • 9.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted Mar 25, 2015 10:40 PM

    This is something I'm planning on looking at as well. I haven't started the DSC modules yet, but I hope to start working on that in the next few weeks. Below I've written about how a DSC configuration might potentially look like to provision a VM.

    http://devblackops.io/vmware-provisioning-with-dsc/

    -Brandon

    @devblackops



  • 10.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted May 08, 2015 08:10 AM

    I know this is rather old, but has anybody been able to do this?

    I am just about to start working on this and rather not reinvent the wheel. Thought about using a PowerShell workflow to build the VM and as part of that create the DSC MOF file which will be remotely applied to the VM. Only thing that's currently worrying me is the remote access to that VM (also, that VM not yet being ready yet after deployment and customisation).

    Cheers

    David



  • 11.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted May 08, 2015 08:32 AM


  • 12.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted May 08, 2015 03:10 PM

    Sounds interesting. I'm interested in seeing what you've developed.



  • 13.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted May 08, 2015 03:13 PM

    You're probably already miles ahead of me :smileygrin:



  • 14.  RE: Using DSC (Desired State Configuration) with PowerCLI

    Posted May 08, 2015 03:22 PM

    I have a working example for creating the VM with DSC here:

    http://devblackops.io/2015/04/10/vmware-provisioning-with-powershell-dsc/

    This will deploy a VM from a template that has a small DSC bootstrap script that will get executed as part of the OS customization. That bootstrap script will configure the LCM in the guest OS to talk to the pull server and grab the DSC configuration for the guest.

    Right now, you have to create two DSC configurations. One for the VM definition which is applied to a provisioning server with PowerCLI installed, and one for the guest OS. I'd like to come up with a way define the state of the VM in a single place (VM and OS config) but at the end of the day, two MOF files would still be generated (VM definition and guest OS).