Using ai to perform boring vmware vsphere tasks
Using Ai to Perform Boring Vmware Vsphere Tasks
AIVMwarevSphere

Using AI to perform boring VMware vSphere tasks

Recently I have been thinking more and more about AI and I wondered if it was possible to use AI to automate boring administrative tasks in vSphere.
First I though to use some Generative AI to provide instruction on how to perform the task, but I had no way to actually get something to perform them for me.

Then today I discovered than you can use a tool called browser-use, combined with a model to perform tasks within a browser.

They way this works is you setup the browser-use system with your model of choice and API key. Then you simply provide a prompt such as “login to this URL with user X and password Y” It then launches a browser session and scans the page then injects your form details.

This is all basic stuff though, so I tried something more complex. I used used these tools to login to the vSphere client and interact with my virtual machines but I think if you get the prompts right, you could even get vMotion to work and far more complex things including advanced configuration.

Before I run through how to set this up, take a look at the quick demo which logs into the vSphere client, deals with an SSL error, navigated around a bunch of errors in the client and then powers on a VM. The prompt for this is in the instructions below.

Demo

Setting up the environment

Install Python

Install Browser Use Web UI

Launch

  • From the same directory you have been working in, run:
    python webui.py --ip 127.0.0.1 --port 7788
  • Open a web browser to:
    http://127.0.0.1:7788
Browser use webui

Configure Browser Use Web UI

  • Open the LLM Configuration and select your model. I am using the DeepSeek Reasoner Model.
  • Locate your model’s API keys
  • This will vary depending on the model you are using.
    • For DeepSeek, Navigate to DeepSeek and then API platform.
    • Create a new account
    • Top up up the account with $2 to get started
    • Next go to API keys and generate a new API key
  • Add your API key to Web UI (Under LLM Configuration)
  • Enter the Base URL for the model. For DeepSeek, this is:
    https://api.deepseek.com/v1
  • Under Agent Settings, it is recommended to disable “Use Vision” due to compatibility issues with DeepSeek
Browser use webui llm configuration
Browser use webui agent settings

Performing vSphere Tasks

Now onto the good bit!

  • Go to Run Agent and enter your prompt.
  • Be sure to provide the URL, user and password plus what you want it to do.

Task Description
1. Open the vSphere client
2. Wait for the licensing banner to load
3. Close the licensing error banner with the x on the top right of the browser
4. Power on the VM using the power on icon

Additional Information
The vSphere client URL is: https://vcf-m01-vc01.lab.local/ui/
The vSphere client username is: administrator@vsphere.local
The vSphere client password is: Password12345!
The VM name is: vcf-m01-nsx01a

What’s interesting here is in the console window you can see what the model is trying to do in plain English, then it tries that.
I also though it was interesting how it tried a few ways to bypass the SSL error until it finally found a good way to do it. Also sometimes it does the wrong thing (opens the wrong menu for example) but it will then close that menu and try again, a little like how a human would make a mistake and correct it.

Share your prompts!

If you manage to get something interesting working such as live vMotion, advanced configurations or even a host upgrade using this method, please let me know.

I’d be happy to put together a library of prompts and credit you for your work.

A note on using LLMs

I highly recommend doing your own research before using DeepSeek’s LLMs, especially for work purposes outside of China.

I would also avoid this use of LLMs to orchestrate tasks in your production environment due to the obvious risks associated with it.

author avatar
Graham
Graham works closely with VMware & Microsoft solutions. He is a VMware Certified Implementation Expert, 8x VMware vExpert & a VMware User Moderator on the official VMware VMTN forums. Feel free to reach out via Twitter @VirtualG.uk or email: contact@virtualg.uk

Leave a Response

This site uses Akismet to reduce spam. Learn how your comment data is processed.