Git Product home page Git Product logo

dscr-for-vmware's Introduction

Desired State Configuration Resources for VMware

Overview

The VMware.vSphereDSC module is a collection of DSC Resources. This module includes DSC resources that simplify the management of vCenter and ESXi settings, with a simple declarative language.

The VMware.vSphereDSC module contains resources which are configuring:

  • NTP, DNS, TPS and Syslog settings of VMHosts.
  • Motd and Issue Advanced Settings of VMHosts.
  • Host services of VMHosts.
  • SATP Claim Rules of VMHosts.
  • Statistics and Advanced Settings of vCenters.

The Module also contains resources for Creating, Updating and Deleting Clusters.

For more information about all available Resources, please visit the wiki page of the repository: Wiki.

Getting Started

Requirements

VMware.vSphereDSC module contains Microsoft PowerShell Desired State Configuration Resources. The following table describes the required dependencies for running VMware.vSphereDSC Resources.

Required dependency Minimum version
PowerShell 5.1 (PS Core not supported)
PowerCLI 10.1.1

For information on how to install PowerShell, please visit Installing Windows PowerShell.

For information on how to install PowerCLI, please visit the PowerCLI Blog.

You also need to configure the DSC LCM on a Windows machine where the resources will run. For more information on how to configure it, please visit Desired State Configuration Quick Start

Installing the VMware.vSphereDSC Resources

  1. Copy the VMware.vSphereDSC Module to one of the system PowerShell module directories.For more information on installing PowerShell Modules, please visit Installing a PowerShell Module.

  2. In PowerShell import the VMware.vSphereDSC Module:

     Import-Module -Name 'VMware.vSphereDSC'
    

    To check if the module was successfully installed:

     Get-DscResource -Module 'VMware.vSphereDSC'
    

Applying VMware.vSphereDSC Resource Configuration

Configuring PowerCLI

To configure PowerCLI you can use the PowerCLISettings DSC Resource and specify which settings you want to be configured. For more information on the available settings, please visit the wiki page of the PowerCLISettings DSC Resource.

Example

The following example uses VMHostNtpSettings Resource and configures the NTP Server and the 'ntpd' Service Policy.

  1. You need to compile the Configuration File to MOF:
     $ntpConfigPath = Join-Path (Join-Path (Join-Path (Get-Module VMware.vSphereDSC -ListAvailable).ModuleBase 'Configurations') 'ESXiConfigs')'VMHostNtpSettings_Config.ps1'
     . $ntpConfigPath -Name '<VMHost Name>' -Server 'Server Name>' -User '<User Name>' -Password '<Password for User>'
    
  2. To Test if the NTP Settings are in the desired state:
     Test-DscConfiguration -ComputerName <The name of the machine on which you are applying your configuration> -Path .\VMHostNtpSettings_Config\
    
  3. To Apply the NTP Configuration:
     Start-DscConfiguration -ComputerName <The name of the machine on which you are applying your configuration> -Path .\VMHostNtpSettings_Config\ -Wait -Force
    
  4. To get the latest applied configuration on your machine:
     Get-DscConfiguration
    

If you want to apply other configurations, you just need to compile the configuration file and pass the path of the created MOF file to the DSC cmdlets.

For more information about the DSC cmdlets please visit the PSDesiredStateConfiguration.

Documentation and Examples

For a full list of resources in VMware.vSphereDSC and examples on their use, check out the Desired State Configuration Resources for VMware wiki.

Examples with Chef, Puppet and Ansible can be found here.

Branches

master

Build Status Coverage

This is the branch to which contributions should be proposed by contributors as pull requests. The content of the module releases will be from the master branch.

Contributing

The Desired State Configuration Resources for VMware project team welcomes contributions from the community. For more detailed information, refer to CONTRIBUTING.md.

License

The Desired State Configuration Resources for VMware is distributed under the BSD-2.

For more details, please refer to the BSD-2 License File.

dscr-for-vmware's People

Contributors

dmilov avatar dscautomation avatar lucdekens avatar rockaut avatar sdbrett avatar simeongerginov avatar vmwsrpbot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.