dscr-for-vmware icon indicating copy to clipboard operation
dscr-for-vmware copied to clipboard

[Feature] Include a 'default' configuration for each resource

Open lucdekens opened this issue 5 years ago • 4 comments

As discussed in #39 and #101, all resources shall contain a configuration file demonstrating the 'defaults' as taken by vSphere. The 'defaults' are the values taken by vSphere when no explicit values are specified.

Since the 'defaults' may change between vSphere versions, the configuration shall indicate for which vSphere version it contains the 'defaults'.

lucdekens avatar Oct 14 '19 16:10 lucdekens

Using this information in the ExportVMHostConfiguration script would seriously lower the number of generated lines.

Just saying :-)

lucdekens avatar Mar 10 '20 06:03 lucdekens

Yes I agree and I propose to add each configuration here as a separate comment and then add them to the repository with a single PR. What do you think ?

SimeonGerginov avatar Mar 10 '20 07:03 SimeonGerginov

Sounds like a plan.

One aspect to consider before doing that is the relation between defaults and the vSphere version. Some defaults change with the vSphere version.

lucdekens avatar Mar 10 '20 07:03 lucdekens

VMHostNtpSettings DSC Resource default configuration for vSphere versions 6.5, 6.7 and 7.0:

Configuration VMHostNtpSettings_Default_Config {
    Param(
        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [string]
        $Server,

        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.Management.Automation.PSCredential]
        $Credential,

        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [string]
        $VMHostName
    )

    Import-DscResource -ModuleName VMware.vSphereDSC

    Node localhost {
        VMHostNtpSettings VMHostNtpSettings {
            Server = $Server
            Credential = $Credential
            Name = $VMHostName
            NtpServer = @()
            NtpServicePolicy = 'Off'
        }
    }
}

SimeonGerginov avatar May 02 '20 12:05 SimeonGerginov