我想做的是创建一个干净的虚拟机映像作为应用程序构建的输出。
因此,将创建一个新的虚拟机(从模板即可,安装了操作系统,并安装了一些基本软件)——将在 IIS 中创建一个新网站,并将 Web 应用程序构建输出复制到虚拟机硬盘和 IIS 配置正确,VM 将启动并运行。
我知道有 MSBuild 任务来编写 IIS 中所有管理操作的脚本,但是如何使用虚拟机编写所有操作的脚本? 具体来说,从模板创建一个新的虚拟机,对其进行唯一命名,启动它,配置它等等......
具体来说,我想知道是否有人成功地实现了任何虚拟机脚本作为构建过程的一部分。
更新:我假设使用 Hyper-V,有一组不同的库/API 来编写虚拟机脚本,有人使用过吗? 有没有人有真正的实践经验来做这样的事情?
What I would like to do is create a clean virtual machine image as the output of a build of an application.
So a new virtual machine would be created (from a template is fine, with the OS installed, and some base software installed) --- a new web site would be created in IIS, and the web app build output copied to a location on the virtual machine hard disk, and IIS configured correctly, the VM would start up and run.
I know there are MSBuild tasks to script all the administrative actions in IIS, but how do you script all the actions with Virtual machines? Specifically, creating a new virtual machine from a template, naming it uniquely, starting it, configuring it, etc...
Specifically I was wondering if anyone has successfully implemented any VM scripting as part of a build process.
Update: I assume with Hyper-V, there is a different set of libraries/APIs to script virtual machines, anyone played around with this? And anyone with real practical experience of doing something like this?
发布评论
评论(2)
查看 CodePlex 上 Hyper-V 的 Powershell 管理库。 一些特点:
Checkout Powershell Management library for Hyper-V on CodePlex. Some features:
实际上,您可以在 MS Virtual Server 中编写相当多的任务脚本:
http://www.microsoft.com/technet/scriptcenter/scripts/vs/default.mspx?mfr=true
http://msdn.microsoft.com/en-us/library/aa368876(VS.85).aspx
也是虚拟 PC 人员他的博客上有大量关于虚拟服务器/PC 脚本编写以及现在的 Hyper-V 的内容:
http://blogs.msdn.com/virtual_pc_guy/default.aspx
VMware 具有类似的功能:
http://www.vmware.com/support/developer/scripting-API/
You can actually script a fair number of tasks in MS Virtual Server:
http://www.microsoft.com/technet/scriptcenter/scripts/vs/default.mspx?mfr=true
http://msdn.microsoft.com/en-us/library/aa368876(VS.85).aspx
Also Virtual PC guy has got a ton of stuff on his blog about scripting Virtual Server/PC and now Hyper-V here:
http://blogs.msdn.com/virtual_pc_guy/default.aspx
VMware has similar capabilities:
http://www.vmware.com/support/developer/scripting-API/