Hacker News new | ask | show | jobs
by gemstones 940 days ago
Oh my lord, I remember dealing with a VSphere API early in my career. They didn't have a concept of service accounts so the official advice for our nightly automation was:

Pay a sysadmin to be up at night, then before your job is meant to run, have them log into the VSphere GUI, open devtools, click refresh to trigger a GET request, copy the cookie, paste the cookie into our custom software, and send it in the cookies of our API requests.

When we asked if there was an easier way, they said that we could probably use Selenium to automate that.

Needless to say, we did not sign the contract, and moved wholesale into AWS.

2 comments

That's about it. Although, instead of using Selinium, you could work out the XML that the GUI runs from and `POSTS`, then make scripts pretend to be the GUI. Then maybe going into the internal postgres database that runs it to get the data that is not on the GUI.

Not funny. :)

Oh haha I forgot how much information was not exposed in the API at all. I remember having to bring in a senior engineer because I thought I was going crazy. I could only ever find like half of the useful data on a server I just provisioned.
As someone with a vast amount of experience automating vsphere, this is made up bullshit.

API access got a lot better once they introduced the powershell API (which can also be used via C#) but the solution you're describing is the result of people not knowing what they're doing.

It looks like the automation api was introduced in 2021. (!!!)

I stopped using it in like 2014 or 2015 after years of requesting improvements (like better ways to automate things without stuff breaking all the time).

Me too. I have not touched it for over 2 years and big clients sre unlikely to make huge upgrades quickly anyway.

It sounds great they have arrived at the 20th century. Powershell and C#? Don't tell me it is SOAP and all XML? I kinda like the way most cloud apis are just REST and json under the hood with vendor supported python packages that work well on all major platforms.

This sounds like a Ruby on Rails developer who cannot fathom that not everyone thinks having to update their framework every 6 months is unacceptable.
PowerCLI is something like 10+ years old, and all it did was used the existing API's but put a pretty sheen on it for those that were confused by the graph ideas used in their full-on API.
This was almost a decade ago, I assume (hope?) things have changed in a decade of trying. But it was official VMWare advice! It was literally in their documentation too.