Tuesday 28 July 2020

Error : Unknown CPI error "Unknown" with message 'getaddrinfo': Name or service not known (esxiXX.XX.XX:443) in 'create stemcell' CPI method (CPI request ID:''cpi-XXXXXX) in BOSH DIRECTOR on vSphere

I got stuck on this error in my homelab while learning BOSH Director from scratch. And it is a well-known issue which we could get stuck sometimes and its "DNS".
I am deploying bosh director where I have DNS working perfectly fine from my machine, within and outside. Even my mobile was able to resolve DNS for all my servers, just to ensure its working fine. But the error kept on saying its a DNS issue.

So BOSH Director was successfully deployed, but while uploading stemcell failed because of the DNS issue. 
What I have figured out, BOSH Director VM in my case is 172.20.10.6 which must have DNS resolution to ESXi as it is going to upload the stemcell VM to a shared Datastore of an ESXi host and onwards you could create your deployment. I was trying to dig into BOSH Director VM for which I was not able to find the password with default installation as mentioned on bosh.io 

 












Now after a while, I figured that you can SSH into bosh director via a jumpbox user which is to be specified at the time of create-env for which you have to add -o bosh-deployment/jumpbox-user.yml.

After creating jumpbox user I logged into BOSH Director, I found the default DNS to be 8.8.8.8 and there was no I was able to make any changes with the default installation.
Now, this global DNS setting is supposed to be pushed by some configuration files. I even logged into stemcell having USERNAME:- vcap & PASSWORD to be c1oudc0w as mentioned on bosh.io to verify if this DNS setting could be already there but no luck!

After a lot of internet search was not able to come across an article that could have helped me to resolve this.

This 8.8.8.8 global DNS setting is pushed by /bosh-deployment/bosh.yml













So there are two ways to fix this:- 
1. You edit this file with your own DNS Server IP then initiate deployment.





































2. You can edit this file and declare an ARRAY type variable at the time of environment creation.












And here I declared my DNS to be array type and it will be there in my bosh0 VM which is created after this create-env.



































And finally, uploading stemcell completed successfully.













No comments:

Post a Comment