lamw / vcf-automated-lab-deployment

Automated VMware Cloud Foundation Lab Deployment
67 stars 29 forks source link

Workload deployment script error at clusterImageId #20

Open jleavers opened 3 months ago

jleavers commented 3 months ago

For me, vcf-automated-workload-domain-deployment.ps1 is failing at the point of adding the clusterImageId to the payload:

[08-20-2024_10:28:21] Retreiving unassigned ESXi hosts from SDDC Manager and creating Workload Domain JSON deployment file wld-w01.json
MethodException: E:\VCF\vcf-automated-workload-domain-deployment.ps1:340
Line |
 342 |          $payload.computeSpec.clusterSpecs.Add("clusterImageId",$clust …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find an overload for "Add" and the argument count: "2".
[08-20-2024_10:28:21] Starting Workload Domain deployment using file wld-w01.json
New-VCFWorkloadDomain: E:\VCF\vcf-automated-workload-domain-deployment.ps1:348
Line |
 350 |  … eployment = New-VCFWorkloadDomain -json $VCFWorkloadDomainDeploymentJ …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The validation task commpleted the run with the following problems:
[08-20-2024_10:28:30] Open a browser to your SDDC Manager to monitor the deployment progress
[08-20-2024_10:28:30] VCF Workload Domain Deployment Complete!
[08-20-2024_10:28:30] StartTime: 08/20/2024 22:26:48
[08-20-2024_10:28:30] EndTime: 08/20/2024 22:28:30
[08-20-2024_10:28:30] Duration: 1.7 minutes to initiate Workload Domain deployment

At this point the creation fails - the task to create the workload domain is not created.

jleavers commented 3 months ago

I ran the command manually:

New-VCFWorkloadDomain -json .\wld-w01.json

This revealed that the validation error was unrelated to the clusterImageId, and was instead due to a duplicate NSX hostname. After resolving this the creation of the workload domain is started, although the clusterImageId error is still in the output as above.

jleavers commented 2 months ago

The error can also be removed by commenting out the $payload.computeSpec.clusterSpecs.Add line, manually retrieving the personality ID before deployment, then adding this to the clusterSpecs.

# Workload Domain Configurations
$clusterImageId = "550e8400-e29b-41d4-a716-446655440000"
    "computeSpec" = [ordered] @{
        "clusterSpecs" = @(
            [ordered] @{
                "name" = "wld-w01-cl01"
                "clusterImageId" = $clusterImageId

[08-22-2024_07:17:12] Retreiving unassigned ESXi hosts from SDDC Manager and creating Workload Domain JSON deployment file wld-w01.json [08-22-2024_07:17:12] Starting Workload Domain deployment using file wld-w01.json [08-22-2024_07:17:30] Open a browser to your SDDC Manager to monitor the deployment progress [08-22-2024_07:17:30] VCF Workload Domain Deployment Complete! [08-22-2024_07:17:30] StartTime: 08/22/2024 19:13:53 [08-22-2024_07:17:30] EndTime: 08/22/2024 19:17:30 [08-22-2024_07:17:30] Duration: 3.62 minutes to initiate Workload Domain deployment