vmware / power-validated-solutions-for-cloud-foundation

PowerShell Module for VMware Validated Solutions
https://vmware.github.io/power-validated-solutions-for-cloud-foundation/
BSD 2-Clause "Simplified" License
45 stars 24 forks source link

Add support for `Enable-SupervisorCluster` to name a supervisor cluster #764

Open benhtodd opened 2 months ago

benhtodd commented 2 months ago

Code of Conduct

Description

Would like Enable-SupervisorCluster to be able to name the Supervisor cluster with a custom name. Currently it names the supervisor from the parameter -Cluster which is clearly documented as The name of the vSphere cluster. There is a parameter -mastetDNSName which is documented as "The master DNS name." Which I am not so sure I know what it means. I tried it for my purposes to no avail.

Use Case(s)

Is it a must the Supervisor Cluster is to be named the same as the vsphere cluster?

Potential Configuration

Parameter called -supervisorName....?

References

No response

tenthirtyam commented 1 week ago

Looks like this is simply based on the current logic of the function that includes:

Cluster = (Get-Cluster -Name $cluster)

For example:

param (
    [Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()] [String]$cluster,
    [Parameter (Mandatory = $false)] [ValidateNotNullOrEmpty()] [String]$supervisorName
)

# other...

if ($inputParameterValidation -eq $true) {
    $internalWMClusterInput = @{
        # other...
        Cluster = $supervisorName -or (Get-Cluster -Name $cluster)
        # other...
    }
}

# other...

This way, if $supervisorName is provided, it will be used directly; otherwise, it will get the cluster by the name $cluster.

benhtodd commented 1 week ago

@tenthirtyam - Not able to pass supervisorName ? image image

tenthirtyam commented 1 week ago

My comment above is a possible fix for the function.