vSphere 5.0实践:使用PowerCLI部署虚拟机

云计算 虚拟化
本文介绍如何使用脚本PowerCLI来同时部署多台虚拟机。

   使用克隆及模板的方式来部署虚拟机,但不管是从模板部署还是对虚拟机进行克隆,都只能一对一,不能一对多。如果需要部署N台虚拟机的话,两种方法都不是那么有效。那么是否有更快捷的方法呢?当然有,用脚本PowerCLI。接下来我就用PowerCLI来同时部署多台虚拟机。

  Step1:自定义虚拟机模板

  Registration information: name company

  Computer name: Use the virtual machine name (important)

  Product key: Didn’t need it because I’ve configured KMS

  Password: Company default local administrator password, selected: Automatically login as the Administrator: 2

  Timezone: GMT+0100 (Amsterdam)

  Runonce: none

  Network: Typical settings

  Workgroup or Domain: selected to auto join the domain with domain administrator credentials + domain name (important)

  Operation System Options: Selected: Generate New Security ID (SID)

  Step2:VM模板设置

  Hard disk: 40 GB with only OS configured with company standard policy

  VMware tools: Latest, this must be installed for Specification Template and NIC

  Network: VMXNET3 (needed VMware Tools for driver)

  Step3:脚本保存(saved as: FileserverDeploy.ps1)

  New-vm -vmhost esx04.vmpros.local -Name FS-SVR01 -Template WIN2008R2_Template -Datastore datastore2

  -OSCustomizationspec WIN2008R2_Template

  New-vm -vmhost esx04.vmpros.local -Name FS-SVR02 -Template WIN2008R2_Template -Datastore datastore2

  -OSCustomizationspec WIN2008R2_Template

  New-vm -vmhost esx04.vmpros.local -Name FS-SVR03 -Template WIN2008R2_Template -Datastore datastore2

  -OSCustomizationspec WIN2008R2_Template

  New-vm -vmhost esx04.vmpros.local -Name FS-SVR04 -Template WIN2008R2_Template -Datastore datastore2

  -OSCustomizationspec WIN2008R2_Template

  New-vm -vmhost esx04.vmpros.local -Name FS-SVR05 -Template WIN2008R2_Template -Datastore datastore2

  -OSCustomizationspec WIN2008R2_Template

  -vmhost = Target host;

  -Name = Name of new VM;

  -Template: From wich template you want to deploy the new VM;

  -Datastore: Target datastore to place the new VM;

  -OSCustomizationspec = Wich “prep” template you want to deploy the new VM;

责任编辑:贾隆 来源: 51CTO.com
相关推荐

2013-03-06 14:41:07

vSphere Web

2013-09-03 11:35:27

vSphere虚拟机存储

2013-10-17 09:50:43

vSphere cli虚拟机光驱

2010-10-13 10:16:44

备份VMware vS虚拟机

2011-04-06 09:29:51

vSphere虚拟机备份

2013-03-20 15:21:56

vSphere Rep

2017-08-14 09:32:57

虚拟机存储VMware VDP

2012-08-08 11:12:40

IBMdW

2011-04-01 10:40:44

vSphereVMotion虚拟机

2013-07-17 09:21:47

vSphere vMo虚拟机

2013-12-03 16:38:35

vSphere HA虚拟机

2011-03-30 09:35:48

vSphere虚拟机

2012-11-12 10:35:54

IBMdw

2011-11-10 09:32:41

虚拟化vSphere 5.0存储I

2012-03-01 10:01:48

虚拟化桌面虚拟化VMware vSph

2009-04-24 21:19:43

Vmware虚拟化虚拟机

2013-10-28 09:32:47

基础设施即服务IaaS部署虚拟机安全

2013-10-28 09:22:14

IaaS部署虚拟机安全虚拟机管理

2012-05-18 10:22:23

2009-07-24 13:37:51

虚拟机VSM服务器虚拟化
点赞
收藏

51CTO技术栈公众号