在使用MSBuild和MS Virtual Server和/或Hyper-V Server虚拟化的构建过程中,如何创建虚拟机? [英] How can I create virtual machines as part of a build process using MSBuild and MS Virtual Server and/or Hyper-V Server Virtualization?

查看:110
本文介绍了在使用MSBuild和MS Virtual Server和/或Hyper-V Server虚拟化的构建过程中,如何创建虚拟机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做的是创建一个干净的虚拟机映像作为应用程序构建的输出.

What I would like to do is create a clean virtual machine image as the output of a build of an application.

因此将创建一个新的虚拟机(使用模板很好,安装了操作系统,并安装了一些基本软件)-将在IIS中创建一个新的网站,并将该Web应用程序的构建输出复制到虚拟机硬盘上的某个位置,并且IIS配置正确,虚拟机将启动并运行.

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.

我知道有MSBuild任务可以编写IIS中所有管理操作的脚本,但是如何使用虚拟机编写所有操作的脚本?具体来说,是从模板创建新的虚拟机,对其进行唯一命名,启动,配置等...

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...

我特别想知道是否有人在构建过程中成功实现了任何VM脚本.

Specifically I was wondering if anyone has successfully implemented any VM scripting as part of a build process.

更新:我假设使用Hyper-V,有一组不同的库/API可以编写虚拟机脚本,有人玩过吗?还有具有做类似事情的实际经验的人吗?

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?

推荐答案

结帐适用于Hyper-V的Powershell管理库CodePlex .一些功能:

查找VM
连接到VM ​​
发现和操纵机器状态
备份,导出和快照VM
添加和删​​除VM,配置主板设置.
操纵磁盘控制器,驱动器和磁盘映像
操纵网络接口卡
处理VHD文件

Finding a VM
Connecting to a VM
Discovering and manipulating Machine states
Backing up, exporting and snapshotting VMs
Adding and removing VMs, configuring motherboard settings.
Manipulating Disk controllers, drives and disk images
Manipluating Network Interface Cards
Working with VHD files

这篇关于在使用MSBuild和MS Virtual Server和/或Hyper-V Server虚拟化的构建过程中,如何创建虚拟机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆