lamw / vsphere-with-tanzu-nsxt-automated-lab-deployment

vSphere with Tanzu using NSX-T Automated Lab Deployment
212 stars 79 forks source link

Connect-VIServer A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. #2

Closed i1wan closed 4 years ago

i1wan commented 4 years ago

Got this error when I try to deploy the script:

Connect-VIServer: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:941
Line 941
 $vc = Connect-VIServer $VCSAIPAddress -User "administrator@$VCSAS …
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4/14/2020 8:56:33 PM Connect-VIServer  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

This resulted in a lot of errors during the deployment.

It looks like the variables are lost somewhere during the lifetime of the script.

lamw commented 4 years ago

It looks like the VCSA was not deployed successfully or had issues. Did you look at the console output to see if there were any issues or the log for more details?

i1wan commented 4 years ago

I just deleted the VM's and I will try again tomorrow morning. Will let you know the outcome tomorrow.

lamw commented 4 years ago

When I say console output, I mean the script output on the screen. There shouldn't be any errors and same with the log file, if there's issues its possible you had enter incorrect/invalid information

i1wan commented 4 years ago

Below you will find the log output:

I have altered the information that needed to be altered and all prereqs are met according to the documentation.

[04-14-2020_11:58:52] Connecting to Management vCenter Server vcsa-01.home.local ...
[04-14-2020_11:59:01] Deploying Nested ESXi VM pacific-esxi-7 ...
[04-15-2020_12:02:46] Adding vmnic2/vmnic3 to Pacific-VTEP ...
[04-15-2020_12:03:16] Updating vCPU Count to 4 & vMEM to 24 GB ...
[04-15-2020_12:03:20] Updating vSAN Cache VMDK size to 8 GB & Capacity VMDK size to 100 GB ...
[04-15-2020_12:03:28] Powering On pacific-esxi-7 ...
[04-15-2020_12:03:28] Deploying Nested ESXi VM pacific-esxi-8 ...
[04-15-2020_12:04:10] Adding vmnic2/vmnic3 to Pacific-VTEP ...
[04-15-2020_12:04:41] Updating vCPU Count to 4 & vMEM to 24 GB ...
[04-15-2020_12:04:44] Updating vSAN Cache VMDK size to 8 GB & Capacity VMDK size to 100 GB ...
[04-15-2020_12:04:51] Powering On pacific-esxi-8 ...
[04-15-2020_12:04:51] Deploying Nested ESXi VM pacific-esxi-9 ...
[04-15-2020_12:05:30] Adding vmnic2/vmnic3 to Pacific-VTEP ...
[04-15-2020_12:06:07] Updating vCPU Count to 4 & vMEM to 24 GB ...
[04-15-2020_12:06:09] Updating vSAN Cache VMDK size to 8 GB & Capacity VMDK size to 100 GB ...
[04-15-2020_12:06:16] Powering On pacific-esxi-9 ...
[04-15-2020_12:06:17] Deploying NSX Manager VM pacific-nsx-3 ...
[04-15-2020_01:17:39] Updating vCPU Count to 6 & vMEM to 24 GB ...
[04-15-2020_01:17:41] Disabling vCPU Reservation ...
[04-15-2020_01:17:45] Powering On pacific-nsx-3 ...
[04-15-2020_01:17:46] Creating VCSA JSON Configuration file for deployment ...
[04-15-2020_01:17:48] Deploying the VCSA ...
Error:      Problem Id: None      Component key: vpxd-svcs      Detail:
An error occurred while starting service 'vpxd-svcs'      Resolution:
Cannot fetch certificate from 'localhost'. Error: [WinError 10061] No connection
could be made because the target machine actively refused it
Error message: The VCSA deployment has failed VCSA Deployment Start Time:
2020-04-14T23:32:21.252Z VCSA Deployment End Time: 2020-04-15T01:39:42.408Z
[04-15-2020_03:50:05] Deploying NSX Edge VM pacific-nsx-edge-3a ...
[04-15-2020_04:01:17] Updating vCPU Count to 8 & vMEM to 32 GB ...
[04-15-2020_04:01:19] Powering On pacific-nsx-edge-3a ...
[04-15-2020_04:01:21] Creating vApp vGhetto-Nested-Project-Pacific-NSX-T-External-Lab-tZAMCwfQ ...
[04-15-2020_04:01:23] Moving Nested ESXi VMs into vGhetto-Nested-Project-Pacific-NSX-T-External-Lab-tZAMCwfQ vApp ...
[04-15-2020_04:02:06] Moving pacific-vcsa-3 into vGhetto-Nested-Project-Pacific-NSX-T-External-Lab-tZAMCwfQ vApp ...
Move-VM: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:913
Line |
 913 |          Move-VM -VM $vcsaVM -Server $viConnection -Destination $VApp  …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:10 AM Move-VM  Could not obtain the result of task
     | '/VIServer=vsphere.local\administrator@vcsa-01.home.local:443/Task=Task-task-96480/'. Task name is
     | 'RelocateVM_Task'. The following error occured: Unexpected error occured. Cannot convert type
     | 'VirtualMachineFeatureRequirement' to 'Object'.

[04-15-2020_04:02:11] Moving pacific-nsx-3 into vGhetto-Nested-Project-Pacific-NSX-T-External-Lab-tZAMCwfQ vApp ...
[04-15-2020_04:02:17] Moving NSX Edge VMs into vGhetto-Nested-Project-Pacific-NSX-T-External-Lab-tZAMCwfQ vApp ...
Move-VM: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:926
Line |
 926 |              Move-VM -VM $nsxEdgeVM -Server $viConnection -Destination …
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:21 AM Move-VM  Could not obtain the result of task
     | '/VIServer=vsphere.local\administrator@vcsa-01.home.local:443/Task=Task-task-96484/'. Task name is
     | 'RelocateVM_Task'. The following error occured: Unexpected error occured. Cannot convert type
     | 'VirtualMachineFeatureRequirement' to 'Object'.

[04-15-2020_04:02:21] Moving vGhetto-Nested-Project-Pacific-NSX-T-External-Lab-tZAMCwfQ to VM Folder Project-Pacific ...
[04-15-2020_04:02:26] Disconnecting from vcsa-01.home.local ...
[04-15-2020_04:02:26] Connecting to the new VCSA ...
Connect-VIServer: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:941
Line |
 941 |      $vc = Connect-VIServer "10.11.20.112" -User "administrator@vspher …
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:36 AM Connect-VIServer  The HTTP service located at https://10.11.20.112/sdk is
     | unavailable.  This could be because the service is too busy or because no endpoint was found listening
     | at the specified address. Please ensure that the address is correct and try accessing the service
     | again later.

Get-Datacenter: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:943
Line |
 943 |      $d = Get-Datacenter -Server $vc $NewVCDatacenterName -ErrorAction …
     |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:36 AM Get-Datacenter  You are not currently connected to any servers. Please connect
     | first using a Connect cmdlet.

[04-15-2020_04:02:37] Creating Datacenter Pacific-Datacenter ...
Get-Folder: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:946
Line |
 946 |  … centerName -Location (Get-Folder -Type Datacenter -Server $vc) | Out- …
     |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Folder  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:949
Line |
 949 |      $c = Get-Cluster -Server $vc $NewVCVSANClusterName -ErrorAction I …
     |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:02:37] Creating VSAN Cluster Workload-Cluster ...
Get-Datacenter: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:952
Line |
 952 |  …  -Location (Get-Datacenter -Name $NewVCDatacenterName -Server $vc) -D …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Datacenter  You are not currently connected to any servers. Please connect
     | first using a Connect cmdlet.

Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:953
Line |
 953 |          (Get-Cluster $NewVCVSANClusterName) | New-AdvancedSetting -Na …
     |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:02:37] Adding ESXi host pacific-esxi-7 to Cluster ...
Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:966
Line |
 966 |  … Server $vc -Location (Get-Cluster -Name $NewVCVSANClusterName) -User  …
     |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:02:37] Adding ESXi host pacific-esxi-8 to Cluster ...
Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:966
Line |
 966 |  … Server $vc -Location (Get-Cluster -Name $NewVCVSANClusterName) -User  …
     |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:02:37] Adding ESXi host pacific-esxi-9 to Cluster ...
Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:966
Line |
 966 |  … Server $vc -Location (Get-Cluster -Name $NewVCVSANClusterName) -User  …
     |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:37 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:02:37] Enabling VSAN & disabling VSAN Health Check ...
Get-VsanClusterConfiguration: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:972
Line |
 972 |          Get-VsanClusterConfiguration -Server $vc -Cluster $NewVCVSANC …
     |                                               ~~~
     | Cannot validate argument on parameter 'Server'. The argument is null or empty. Provide an argument
     | that is not null or empty, and then try the command again.

Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:974
Line |
 974 |          foreach ($vmhost in Get-Cluster -Server $vc | Get-VMHost) {
     |                              ~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:57 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

Get-Datacenter: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:992
Line |
 992 |  … CVDSName -Location (Get-Datacenter -Name $NewVCDatacenterName) -Mtu 1 …
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:57 AM Get-Datacenter  You are not currently connected to any servers. Please connect
     | first using a Connect cmdlet.

New-VDPortgroup: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:994
Line |
 994 |  …    New-VDPortgroup -Server $vc -Name $NewVCDVPGName -Vds $vds | Out-F …
     |                                                             ~~~~
     | Cannot validate argument on parameter 'VDSwitch'. The argument is null or empty. Provide an argument
     | that is not null or empty, and then try the command again.

Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:996
Line |
 996 |          foreach ($vmhost in Get-Cluster -Server $vc | Get-VMHost) {
     |                              ~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:59 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:02:59] Clearing default VSAN Health Check Alarms, not applicable in Nested ESXi env ...
Get-View: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1007
Line |
1007 |          $alarmMgr = Get-View AlarmManager -Server $vc
     |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:59 AM Get-View  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1008
Line |
1008 |          Get-Cluster -Server $vc | where {$_.ExtensionData.TriggeredAl …
     |          ~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:02:59 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

InvalidOperation: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1015
Line |
1015 |          $alarmMgr.ClearTriggeredAlarms($alarmSpec)
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

Get-Cluster: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1019
Line |
1019 |      foreach ($vmhost in Get-Cluster -Server $vc | Get-VMHost) {
     |                          ~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:03:00 AM Get-Cluster  You are not currently connected to any servers. Please connect first
     | using a Connect cmdlet.

[04-15-2020_04:03:00] Creating Project Pacific Storage Policies and attaching to vsanDatastore ...
New-TagCategory: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1033
Line |
1033 |          New-TagCategory -Server $vc -Name $StoragePolicyTagCategory - …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:03:00 AM New-TagCategory  You are not currently connected to any vCenter Server that
     | supports tagging functionality.

New-Tag: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1034
Line |
1034 |          New-Tag -Server $vc -Name $StoragePolicyTagName -Category $St …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:03:01 AM New-Tag  Could not find TagCategory with name 'pacific-demo-tag-category'.

New-Tag: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1034
Line |
1034 |          New-Tag -Server $vc -Name $StoragePolicyTagName -Category $St …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:03:01 AM New-Tag  Value cannot be found for the mandatory parameter Category

Get-Datastore: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1035
Line |
1035 |          Get-Datastore -Server $vc -Name "vsanDatastore" | New-TagAssi …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:03:01 AM Get-Datastore  You are not currently connected to any servers. Please connect
     | first using a Connect cmdlet.

Get-Tag: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1036
Line |
1036 |  … Rules (New-SpbmRule -AnyOfTags (Get-Tag $StoragePolicyTagName))) | Ou …
     |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:03:01 AM Get-Tag  You are not currently connected to any vCenter Server that supports
     | tagging functionality.

[04-15-2020_04:03:01] Disconnecting from new VCSA ...
Disconnect-VIServer: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1040
Line |
1040 |      Disconnect-VIServer $vc -Confirm:$false
     |                          ~~~
     | Cannot validate argument on parameter 'Server'. The argument is null or empty. Provide an argument
     | that is not null or empty, and then try the command again.

[04-15-2020_04:03:01] Connecting to NSX-T Manager for post-deployment configuration ...
[04-15-2020_04:05:47] Successfully logged into NSX-T Manager 10.11.20.118  ...
[04-15-2020_04:05:47] Verifying health of all NSX Manager/Controller Nodes ...
[04-15-2020_04:05:47] Check health status of Mgmt Node 10.11.20.118 ...
[04-15-2020_04:05:47] Checking health of Ctrl Node 10.11.20.118 ...
[04-15-2020_04:05:47] Accepting NSX Manager EULA ...
[04-15-2020_04:05:50] Accepting CEIP Agreement ...
[04-15-2020_04:05:50] Setting up NSX-T Edge to join NSX-T Management Plane ...
[04-15-2020_04:05:50] Connecting back to Management vCenter Server vcsa-01.home.local ...
[04-15-2020_04:05:52] Retrieving NSX Manager Thumbprint ...
[04-15-2020_04:05:53] Configuring NSX Edge pacific-nsx-edge-3a ...
[04-15-2020_04:05:53] Sending admin username ...
[04-15-2020_04:06:01] Sending admin password ...
[04-15-2020_04:06:06] Sending set hostname command ...
[04-15-2020_04:06:17] Sending join management plane command ...
[04-15-2020_04:06:42] Sending final exit ...
[04-15-2020_04:06:42] Disconnecting from Management vCenter ...
[04-15-2020_04:06:42] Adding vCenter Server Compute Manager ...
OperationStopped: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1191
Line |
1191 |          $computeManagerResult = $computeManagerSerivce.create($comput …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | A server error occurred: 'com.vmware.vapi.std.errors.invalid_request': . Check
     | $Error[0].Exception.ServerError for more details.

[04-15-2020_04:07:06] Waiting for VC registration to complete ...
OperationStopped: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1194
Line |
1194 |  …     while ( $computeManagerStatusService.get($computeManagerResult.id …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The path variable {compute-manager-id} in the url has not been resolved.

[04-15-2020_04:07:06] Creating Tunnel Endpoint IP Pool ...
[04-15-2020_04:07:07] Creating Overlay & VLAN Transport Zones ...
[04-15-2020_04:07:07] Creating ESXi Uplink Profile ...
[04-15-2020_04:07:07] Creating Edge Uplink Profile ...
Connect-VIServer: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1263
Line |
1263 |  …       $vc = Connect-VIServer "10.11.20.112" -User "administrator@vsph …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 4/15/2020 4:07:09 AM Connect-VIServer  The HTTP service located at https://10.11.20.112/sdk is
     | unavailable.  This could be because the service is too busy or because no endpoint was found listening
     | at the specified address. Please ensure that the address is correct and try accessing the service
     | again later.

Get-VDSwitch: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1266
Line |
1266 |          $VDS = (Get-VDSwitch -Server $vc -Name $NewVCVDSName).Extensi …
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You are not currently connected to any servers. Please connect first using a Connect cmdlet.

Disconnect-VIServer: C:\Users\Administrator\Downloads\vGhetto\Script\v2.ps1:1268
Line |
1268 |          Disconnect-VIServer $vc -Confirm:$false
     |                              ~~~
     | Cannot validate argument on parameter 'Server'. The argument is null or empty. Provide an argument
     | that is not null or empty, and then try the command again.

[04-15-2020_04:07:10] Creating Transport Node Profile Pacific-Host-Transport-Node-Profile ...
Write-Error: Error in creating NSX-T Transport Node Profile
Write-Error:
({
  "httpStatus" : "BAD_REQUEST",
  "error_code" : 9529,
  "module_name" : "NsxSwitching service",
  "error_message" : "Must provide host_switch_id for HostSwitch of type VDS. Node Id {0}."
}.Exception.Message)

PS C:\Users\Administrator\Downloads\vGhetto\Script>
johannstander commented 4 years ago

Make sure you have the correct subnet configured for your VCSA. $VCSAPrefix = "24"

Also open a remote session from your vCenter Server to the deployed VCSA and check if you see any errors

i1wan commented 4 years ago

This was set correct:

$VCSAPrefix = "24"

Tomorrow I will do another deployment and open the VCSA console to see what is happening.

Thanks

i1wan commented 4 years ago

I can reach the VCSA, but I also see errors in the screen while deploying ...

Screenshot 2020-04-17 at 10 28 47

lamw commented 4 years ago

VCSA deployment was definitely not successful. You should take a look at the logs to see what's going on, I suspect you probably have some incorrect setting/value. To further debug, you can disable the deployment of all other components except for VCSA (this is not specific to the vSphere with Kubernetes or even the script). This usually happens if you have some incorrect value specified

i1wan commented 4 years ago

ok, I will disable the other components and do a base deployment and see what is happening there.

i1wan commented 4 years ago

not solved yet, but will try o look into it when I have time again...