VMware Cloud Community
bzjeurd
Contributor
Contributor
Jump to solution

Question about the Add Host to Cluster workflow

Hello all,

I tried to add a host (previously managed by a old vCenter) to a new vCenter with the title mentionned workflow, and I got this error message.

Authenticity of the host's SSL certificate is not

verified.

If I do the same task with the vSphere client, I get a warning about the SSL thumbprint of the Host that asks me to trust (or not) this thumbprint.

In case of I decide to trust it the host is added in the vCenter.

Is it possible to simulate the SSL thumbprint acceptance in a vCO workflow ?

Thank you for your help!

Bz.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Andreas_Diemer
Enthusiast
Enthusiast
Jump to solution

Hi again Smiley Happy

referring to your initial question I've modified the workflow you've used:

add host to cluster SSL.PNG

Just duplicate the workflow and insert missing lines in scriptable task or import the package added on this post.

Regards, Andreas


don't forget: award points to helpful answers

visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com/

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com

View solution in original post

0 Kudos
6 Replies
tschoergez
Leadership
Leadership
Jump to solution

Hi!

I ran into the same issue, but I couldn't find any API-call to allow/ingore SSL-issues....

If you find a solution, I#m looking foward to Smiley Happy

cheers

joerg

0 Kudos
Andreas_Diemer
Enthusiast
Enthusiast
Jump to solution

Hi bzjeurd,

I've just logged how vC-Client is doing this:

DataCenter.queryConnectionInfo(ESXserver,-1,user,password,null);

This will rise an security alert which is handled by the vC-Client (the SSL thumbprint accept window).

I think, we had to use the eventmanager to do this in vCO.

I will try to figure this out. Any ideas are welcome 🙂

Regards, Andreas

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
0 Kudos
Andreas_Diemer
Enthusiast
Enthusiast
Jump to solution

Update:

the task contains the fault raised. The SSLVerifyFault extends the MethodFault with the property thumbprint. You can use this value to add the host.


I'll be back soon to give you an example workflow.

Regards, Andreas

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
0 Kudos
Andreas_Diemer
Enthusiast
Enthusiast
Jump to solution

Hi again Smiley Happy

referring to your initial question I've modified the workflow you've used:

add host to cluster SSL.PNG

Just duplicate the workflow and insert missing lines in scriptable task or import the package added on this post.

Regards, Andreas


don't forget: award points to helpful answers

visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com/

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
0 Kudos
bzjeurd
Contributor
Contributor
Jump to solution

Thank you very much Andreas.

I'm going to implement right now your modified workflow!

Bz.

0 Kudos
cptredemption
Contributor
Contributor
Jump to solution

So this is a little aged, but it was helpful to me today.

I had to add a second parameter into the addStandaloneHost_Task.  If it was overloaded, it doesn't appear to be anymore in 5.1.  I just added "null" into the second slot.  I also found unless I attempted to connect the host, the task would succeed, meaning no error thrown, meaning it couldn't get the ssl thumbprint.  So for that parameter, I had to set that as true (or asConnected).

For some reason though, the workflow kept bombing out, saying that fault was null.  I did a System.log(Task.Info.State) after the While statement and found the state was still running!  Not sure how it got out of the while statement, but it did.  So rather than the while statement, I did a System.Sleep(10000) and after 10 seconds the state of the task went to "error" and I could access the Task.Info.Error.Fault object that held the SSL Thumbprint.

I didn't play around with different sleep times to see just how much time has to past before the task leaves the running state (the task inside vSphere showed it started and stopped in the same second), nor did I put the sleep statement inside the while loop.  Both would be interesting, but after the time spent getting this far, I'm just leaving it be.

// define default if params is null

if (asConnected == null) asConnected = true;

if (force == null) force = false;

if (port == null) port = 443;

var hostConnectSpec = new VcHostConnectSpec();

hostConnectSpec.force = force;

hostConnectSpec.hostName = hostName;

hostConnectSpec.port = port;

hostConnectSpec.userName = userName;

hostConnectSpec.password = password;

var Folder = cluster.sdkConnection.allHostfolders[0];

var Task = Folder.addStandaloneHost_Task(hostConnectSpec,null,asConnected,false);

System.sleep(10000);

hostConnectSpec.sslThumbprint = Task.info.error.fault.thumbprint;

if (vmFolder != null) hostConnectSpec.vmFolder = vmFolder.reference;

task = cluster.addHost_Task(hostConnectSpec, asConnected, resourcePool);

0 Kudos