VMware {code} Community
cli4
Contributor
Contributor

How to get/answer question via VIX API?

What I'm trying to do is to create virtual machines using C program with VIX API. First I create a VM as template. Then I copy all files of the first VM and do some neccessary modificaitons on the copy. After that, I use VIX API to regiester the new VM. From the web interface, I can see registration is successful. At last, I try to use VIX API to power on the new VM. The power on process hangs up in the middle way, and from the web interface, I can see it appears a "?" mark on the new VM, I click the "?" mark, and get a question to ask if I copied or moved the VM file since it detects uuid conflit. After I choose "I copied it", the uuid of the new VM is updated and the new VM get successfully powered on.

My question is that if it's possible to let my C program automatically answer the question via VIX API or some other mechanism? I want to automatically create new VMs based on the template VM.

Thanks in advance.

Reply
0 Kudos
3 Replies
admin
Immortal
Immortal

VIX won't help. If you're using ESX you can use the API's AnswerVM method. This is via a separate API though.

If you're using workstation you could consider UI automation technologies like AutoIt. We have a demo of doing something like this in PowerShell. This might give you a few ideas anyway, it uses a tool called WASP.

cli4
Contributor
Contributor

I'm sorry that I forgot to mention that I'm using VMware Server 2.0. Can anything help on that?

Reply
0 Kudos
radicalgeek
Contributor
Contributor

I have had the same issues, and for anyone else that comes across this here is what I have done

Open up the .vmx file of the Template VM in notepad and add:

uuid.action = "create"

save the file.

now when the template is downloaded to the machine and vix PowerOn method is called, the prompt will not pop up (workstation) as this line tells it that you copied it.

Reply
0 Kudos