Automating VMWare or VirtualPC

独自空忆成欢 提交于 2019-12-03 06:55:57

问题


I'm currently experimenting with build script, and since I have an ASP.net Web Part under source control, my build script should do that at the end:

  1. Grab the "naked" Windows 2003 IIS VMWare or Virtual PC Image from the Network
  2. Boot it up
  3. Copy the Files from the Build Folder to the Server
  4. Install it
  5. Do whatever else is needed

I have never tried automating a Virtual Machine, but I saw that both VMWare and Virtual Server offer automation facilities. While I cannot use Virtual Server (Windows XP Home :-(), Virtual PC works.

Does anyone here have experience with either VMWare Server or Virtual PC 2007 SP1 in terms of automation?

Which one is better suited (I run windows, so the Platform-independence of VMWare does not count) and easier to automate?


回答1:


With VMWare, there is the Virtual Machine Automation APIs (VIX API). You can find the reference guide here. It works with VMWare Server and WorkStation, but AFAIK it's not available for ESX Server.

From the main page for VIX:

The VIX API allows you to write scripts and programs that automate virtual machine operations. The API is high-level, easy to use, and practical for both script writers and application programmers. It runs on VMware Server and Workstation products, both Windows and Linux. Bindings are provided for C, Perl, and COM (Visual Basic, VBscript, C#).




回答2:


Use https://github.com/dblock/vmwaretasks rather than the raw VixCOM API if you're going to do this in C#.




回答3:


I agree with Chris. Virtual Machine Automation APIs is a very good possibility for automating of virtual machine operations. VIX API Version 1.6.2 can be used for automating of ESX guest operations as well.




回答4:


VirtualBox also has API's for automating their VM's.




回答5:


To follow-up to @Chris, ESX is extremely scriptable. A client I've been working with recently has built a web service that launches a VMware script to create the VM they need, then start the VM with a custom boot ISO. That ISO includes all the kickstart or unattend.txt info it needs to do a totally unassisted OS build.



来源:https://stackoverflow.com/questions/4684/automating-vmware-or-virtualpc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!